Architecture
Single-binary Go explorer architecture
Overview
The explorer is a single statically-linked Go binary with three concurrent subsystems:
explorer binary
├── Indexer goroutines (one per chain)
│ └── Writes to per-chain SQLite + BadgerDB
├── API server (HTTP)
│ └── Reads from all chain databases
│ └── Serves /v1/explorer/{chain}/* endpoints
└── Replicator (optional)
└── Streams WAL to S3 with PQ encryptionPer-Chain Storage
{data_dir}/{chain_slug}/
query/indexer.db # SQLite: blocks, txs, tokens, contracts
kv/ # BadgerDB: hash->data, height->blockEach chain is isolated. No shared database. Zero write contention.
Key Packages
| Package | Purpose |
|---|---|
cmd/explorer/ | CLI entrypoint |
evm/ | Full EVM indexer (blocks, txs, tokens, traces, contracts) |
evm/api/ | REST API server |
evm/api/repository.go | Database query layer |
storage/ | Dual-layer SQLite + BadgerDB |
{x,a,b,q,t,z,k}chain/ | Native DAG chain adapters |
multichain/ | 100+ external chain indexer |
Build Process
# Development
go run ./cmd/explorer --rpc=...
# Production release
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o explorer ./cmd/explorerThe binary is fully self-contained. No external runtime, no Redis, no PostgreSQL required.