This file provides guidance for AI agents working with this codebase.
Requirements: Go 1.24+, GCC 10+ or Clang, 32GB+ RAM, SSD/NVMe storage
make erigon # Build main binary (./build/bin/erigon)
make all # Build all binaries
make test-short # Quick unit tests (-short -failfast)
make test-all # Full test suite with coverage
make lint # Run golangci-lint + mod tidy check
make gen # Generate all auto-generated code (mocks, grpc, etc.)Run specific tests:
go test ./execution/stagedsync/...
go test -run TestName ./path/to/package/...Build tag required: goexperiment.synctest (set automatically by Makefile)
Erigon is a high-performance Ethereum execution client with embedded consensus layer. Key design principles:
- Flat KV storage instead of tries (reduces write amplification)
- Staged synchronization (ordered pipeline, independent unwind)
- Modular services (sentry, txpool, downloader can run separately)
| Directory | Purpose | Component Docs |
|---|---|---|
cmd/ |
Entry points: erigon, rpcdaemon, caplin, sentry, downloader | - |
execution/stagedsync/ |
Staged sync pipeline | agents.md |
db/ |
Storage: MDBX, snapshots, ETL | agents.md |
cl/ |
Consensus layer (Caplin) | agents.md |
p2p/ |
P2P networking (DevP2P) | agents.md |
rpc/jsonrpc/ |
JSON-RPC API | - |
./build/bin/erigon --datadir=./data --chain=mainnet
./build/bin/erigon --datadir=dev --chain=dev --mine # DevelopmentCommit messages: prefix with package(s) modified, e.g., eth, rpc: make trace configs optional