Erigon
Chapter 9: Erigon Client - High-Performance Ethereum
Section titled “Chapter 9: Erigon Client - High-Performance Ethereum”Overview
Section titled “Overview”Erigon (formerly TurboGeth) is a high-performance Ethereum implementation written in Go. It’s designed to be faster and more resource-efficient than Geth while maintaining full compatibility.
9.1 What is Erigon?
Section titled “9.1 What is Erigon?”Erigon is a next-generation Ethereum client focused on:
- Speed: Faster synchronization and queries
- Storage Efficiency: Smaller disk footprint
- Performance: Better RPC throughput
- Modularity: Separate components
Erigon vs Geth
Section titled “Erigon vs Geth”┌─────────────────────────────────────────────────────────────────────────────┐│ ERIGON VS GETH COMPARISON │├─────────────────────────────────────────────────────────────────────────────┤│ ││ Feature │ Erigon (TurboGeth) │ Geth (Go Ethereum) ││ ────────────────────┼─────────────────────┼────────────────────────────── ││ Sync Speed │ Faster (3-5 days) │ Slower (1-2 weeks) ││ Storage │ ~900GB (pruned) │ ~1.2TB (pruned) ││ RPC Performance │ Higher throughput │ Lower throughput ││ Database │ MDBX (custom) │ LevelDB ││ Snap Sync │ Optimized │ Standard ││ Archive Mode │ ~6TB │ ~12TB ││ Active Development │ Erigon Team │ Ethereum Foundation ││ │└─────────────────────────────────────────────────────────────────────────────┘9.2 Installing Erigon
Section titled “9.2 Installing Erigon”Prerequisites
Section titled “Prerequisites”| Requirement | Minimum | Recommended |
|---|---|---|
| CPU | 8 cores | 16+ cores |
| RAM | 16 GB | 32 GB |
| Storage | 1 TB NVMe SSD | 2 TB NVMe SSD |
| OS | Ubuntu 20.04+ | Ubuntu 22.04 LTS |
Installation Methods
Section titled “Installation Methods”Method 1: Download Binary
Section titled “Method 1: Download Binary”# Download latest Erigoncd /tmpwget https://github.com/ledgerwatch/erigon/releases/download/v2.56.0/erigon_2.56.0_linux_amd64.tar.gztar -xzf erigon_2.56.0_linux_amd64.tar.gzsudo mv erigon /usr/local/bin/rm -rf erigon_2.56.0_linux_amd64.tar.gz
# Verify installationerigon --versionMethod 2: Build from Source
Section titled “Method 2: Build from Source”# Install dependenciessudo apt-get install build-essential git
# Clone repositorygit clone https://github.com/ledgerwatch/erigon.gitcd erigon
# Buildmake erigon
# Installsudo cp build/bin/erigon /usr/local/bin/9.3 Running Erigon
Section titled “9.3 Running Erigon”Basic Commands
Section titled “Basic Commands”# Start Erigon with defaultserigon
# Start with custom settingserigon \ --chain mainnet \ --syncmode snap \ --http \ --http.addr 0.0.0.0 \ --http.port 8545 \ --http.api eth,net,web3,erigon,debug,trace \ --ws \ --ws.port 8546 \ --datadir /data/erigon \ --port 30303 \ --maxpeers 100Key Flags
Section titled “Key Flags”| Flag | Description | Example |
|---|---|---|
--chain | Blockchain network | mainnet, sepolia |
--syncmode | Sync mode | snap, full, light |
--http | Enable HTTP | |
--http.api | Enabled APIs | eth,net,web3,erigon |
--datadir | Data directory | /data/erigon |
--http.vhosts | Allowed hosts | localhost,* |
9.4 Erigon Features
Section titled “9.4 Erigon Features”Optimized Architecture
Section titled “Optimized Architecture”┌─────────────────────────────────────────────────────────────────────────────┐│ ERIGON ARCHITECTURE │├─────────────────────────────────────────────────────────────────────────────┤│ ││ ┌──────────────────────────────────────────────────────────────────────┐ ││ │ ERIGON CORE │ ││ │ │ ││ │ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │ ││ │ │ MDBX DB │ │ State diffs │ │ Freezer │ │ ││ │ │ (Key-Value) │ │ (Snapshots) │ │ (Historical) │ │ ││ │ └────────────────┘ └────────────────┘ └────────────────┘ │ ││ │ │ ││ │ ┌────────────────┐ ┌────────────────┐ │ ││ │ │ RPC Daemon │ │ Downloader │ │ ││ │ │ (Parallel) │ │ (Segments) │ │ ││ │ └────────────────┘ └────────────────┘ │ ││ │ │ ││ └──────────────────────────────────────────────────────────────────────┘ ││ ││ Advantages: ││ - Parallel RPC handlers ││ - Compressed state snapshots ││ - Efficient storage with MDBX ││ - Historical data freezer (reduces storage) ││ │└─────────────────────────────────────────────────────────────────────────────┘Snapshots
Section titled “Snapshots”Erigon uses state snapshots to speed up sync:
# Enable snapshots (enabled by default)--snapshots true
# Snapshot generationerigon --snapshots=true --internalclFreezer (Historical Data)
Section titled “Freezer (Historical Data)”Erigon moves old data to “freezer”:
# Freezer directory (separate from main DB)--externalcl
# Automatically freezes historical blocks after some epochs9.5 Erigon RPC APIs
Section titled “9.5 Erigon RPC APIs”Available APIs
Section titled “Available APIs”| API | Description |
|---|---|
eth | Standard Ethereum JSON-RPC |
net | Network information |
web3 | Web3 utilities |
erigon | Erigon-specific APIs |
debug | Debugging & tracing |
trace | Transaction tracing |
Erigon-Specific Methods
Section titled “Erigon-Specific Methods”// erigon_getBlockByTimestamp{ "jsonrpc": "2.0", "method": "erigon_getBlockByTimestamp", "params": [1699999999, false], "id": 1}
// erigon_getLogsByHash{ "jsonrpc": "2.0", "method": "erigon_getLogsByHash", "params": ["0xabc123..."], "id": 1}
// erigon_forks{ "jsonrpc": "2.0", "method": "erigon_forks", "params": [], "id": 1}9.6 Configuration Example
Section titled “9.6 Configuration Example”Production Setup
Section titled “Production Setup”erigon \ --chain mainnet \ --syncmode snap \ --http \ --http.addr 0.0.0.0 \ --http.port 8545 \ --http.api eth,net,web3,erigon,debug,trace \ --http.vhosts "*" \ --http.corsdomain "*" \ --ws \ --ws.addr 0.0.0.0 \ --ws.port 8546 \ --ws.api eth,net,web3,erigon,debug,trace \ --ws.origins "*" \ --datadir /data/erigon \ --port 30303 \ --maxpeers 100 \ --metrics \ --metrics.addr 0.0.0.0 \ --metrics.port 6060 \ --pprof \ --pprof.addr 0.0.0.0 \ --pprof.port 6061 \ --torrent.port 42000 \ --prune htc \ --prune.rct 1000 \ --prune.ctb 90000Pruning Options
Section titled “Pruning Options”# Prune everything (h=history, t=receipts, c=call traces)--prune htc
# Keep last 90,000 blocks of history--prune htc --prune.h.older 900009.7 Systemd Service
Section titled “9.7 Systemd Service”[Unit]Description=Erigon Ethereum NodeAfter=network.target
[Service]Type=simpleUser=ethereumGroup=ethereumRestart=alwaysRestartSec=10ExecStart=/usr/local/bin/erigon \ --chain mainnet \ --syncmode snap \ --http \ --http.addr 127.0.0.1 \ --http.port 8545 \ --http.api eth,net,web3,erigon,debug,trace \ --ws \ --ws.addr 127.0.0.1 \ --ws.port 8546 \ --ws.api eth,net,web3,erigon,debug,trace \ --datadir /data/erigon \ --port 30303 \ --maxpeers 100 \ --metrics \ --metrics.port 6060 \ --pprof
NoNewPrivileges=truePrivateTmp=trueProtectSystem=strictProtectHome=trueReadWritePaths=/data/erigon
[Install]WantedBy=multi-user.target9.8 Checking Sync Status
Section titled “9.8 Checking Sync Status”# Attach to Erigon RPCcurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
# Check block numbercurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# Erigon-specific statuscurl -X POST http://localhost:8545 \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"erigon_nodeInfo","params":[],"id":1}'9.9 Other Alternative Clients
Section titled “9.9 Other Alternative Clients”Nethermind
Section titled “Nethermind”# Install Netherminddotnet tool install -g nethermindnethermind --config mainnet
# Or download binarywget https://github.com/NethermindEth/nethermind/releases/download/1.25.0/nethermind-linux-x64-1.25.0.tar.gzBesu (Hyperledger)
Section titled “Besu (Hyperledger)”# Install Besuwget https://github.com/hyperledger/besu/releases/download/23.10.1/besu-23.10.1.tar.gztar -xzf besu-23.10.1.tar.gz
# Run./besu --network=mainnet --rpc-http-enabled --rpc-http-port=8545Reth (Rust)
Section titled “Reth (Rust)”# Install Rethcargo install --git https://github.com/paradigmxyz/reth.git reth --locked
# Runreth node --chain mainnet --http --http.port 85459.10 Interview Questions
Section titled “9.10 Interview Questions”| Question | Answer |
|---|---|
| What is Erigon? | High-performance Ethereum client (formerly TurboGeth) |
| How is Erigon faster? | Optimized DB (MDBX), snapshots, parallel RPC |
| Storage difference? | Erigon uses less storage (~900GB vs 1.2TB) |
| Can Erigon replace Geth? | Yes, it’s API compatible |
Summary
Section titled “Summary”- Erigon is a fast, efficient Ethereum client
- Uses MDBX database and snapshots
- API-compatible with Geth
- Excellent for high-throughput RPC services
Next Chapter
Section titled “Next Chapter”In Chapter 10: Besu - Enterprise Ethereum Client, we’ll explore Besu for enterprise use cases.
Last Updated: 2026-02-20