How brainsonchain/worm-tracker works
Main Components
A. External Systems:
• Hyperliquid Blockchain
• DeepWorms Smart Contract
B. Backend Components:
• HTTP Server (main.go, server.go)
• Block Fetcher Service (fetcher.go)
• SQLite Database (db.go)
• Processor (position.go)
• ABI Interface (abi.json)
C. Frontend Component:
• Web Browser Interface
[External Layer]
[Backend Layer]
[Frontend Layer]
Component Relationships
a. Data Flow:
• Hyperliquid Blockchain → Block Fetcher
• Block Fetcher → SQLite Database
• HTTP Server ← SQLite Database
• HTTP Server → Web Browser Interface
b. API Endpoints (annotate with endpoints):
• "/" (HTML serving)
• "/worm/positions"
• "/worm/historical"
Component Details
Block Fetcher:
• Monitors blockchain
• Parses DeepWorms logs
• Updates database
HTTP Server:
• Serves static content
• Handles API requests
• Returns worm positions
Database:
• SQLite
• Stores position data
• Historical tracking
Frontend:
• 2D visualization
• Real-time updates
• Historical view
Additional Elements
Important aspects:
• Data flow direction indicators
• Request/response paths
• Database schema overview (simplified)
• API endpoint listing
• Component interaction frequency
Technical Details to Highlight
• Go version: 1.22.5
• Database: SQLite
• Container support (note Dockerfile presence)
• Deployment configuration (fly.toml)