Dev Chain

How to run a local Erigon development chain for testing and development.

A dev chain is a local, private network useful for smart contract development, testing RPC calls, and experimenting with Erigon configuration without connecting to a public network.

Quick Start

./erigon \
  --datadir=dev \
  --chain=dev \
  --mine \
  --http.api=eth,erigon,web3,net,debug,trace,txpool,parity,admin \
  --http.corsdomain="*"

Key flags:

Flag
Purpose

--chain=dev

Run a local dev chain

--datadir=dev

Store chain data in the dev/ folder

--mine

Enable block production

--dev.period <seconds>

Block interval in seconds. Must be > 0 to mine empty blocks (default: 0, mines only when there are transactions)

--miner.etherbase <address>

Coinbase address that receives block rewards. Defaults to a pre-funded dev account if not set.

--miner.gaslimit <value>

Gas limit target for mined blocks (default: 30000000).

--miner.extradata <hex>

Extra data field appended to mined blocks (up to 32 bytes).

Running Multiple Nodes

To connect two local nodes, save the enode:// address printed at startup of node 1 and pass it to node 2 via --staticpeers.

Full Tutorial

For a complete step-by-step walkthrough including RPC daemon setup and multi-node configuration, see DEV_CHAIN.mdarrow-up-right in the repository.

Last updated

Was this helpful?