Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.84 KB

File metadata and controls

53 lines (39 loc) · 1.84 KB

Erigon Agent Guidelines

This file provides guidance for AI agents working with this codebase.

Requirements: Go 1.24+, GCC 10+ or Clang, 32GB+ RAM, SSD/NVMe storage

Build & Test

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)

Architecture Overview

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 Structure

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 -

Running

./build/bin/erigon --datadir=./data --chain=mainnet
./build/bin/erigon --datadir=dev --chain=dev --mine  # Development

Conventions

Commit messages: prefix with package(s) modified, e.g., eth, rpc: make trace configs optional