Run an archive node
An archive node quickly answers questions about any past slot for explorers, indexers, and research. You don’t need one to stake. It needs far more disk space than a staking node; see Disk space for what a regular node uses.
The node starts from a checkpoint, so it follows the chain within minutes. In the background, it then downloads every block back to genesis and rebuilds every historical state.
Before you begin
- A connected execution client, with the folder layout from Connect your execution client.
-
- A beacon node data directory that’s empty. Archive mode needs a database; it can’t convert an existing one.
- A checkpoint sync provider: your own synced beacon node, or a public endpoint from the community checkpoint sync endpoints list.
Set it up
-
Start the beacon node. From the
consensusfolder, with an empty data directory:./prysm.sh beacon-chain \--mainnet \--datadir=$HOME/ethereum/data/mainnet/beacon \--execution-endpoint=http://localhost:8551 \--jwt-secret=$HOME/ethereum/data/jwt.hex \--checkpoint-sync-url=https://sync-mainnet.beaconcha.in \--enable-archive.\prysm.bat beacon-chain `--mainnet `--datadir=$HOME\ethereum\data\mainnet\beacon `--execution-endpoint=http://localhost:8551 `--jwt-secret=$HOME\ethereum\data\jwt.hex `--checkpoint-sync-url=https://sync-mainnet.beaconcha.in `--enable-archive./prysm.sh beacon-chain \--mainnet \--datadir=$HOME/ethereum/data/mainnet/beacon \--execution-endpoint=$HOME/ethereum/data/mainnet/execution/geth.ipc \--checkpoint-sync-url=https://sync-mainnet.beaconcha.in \--enable-archive.\prysm.bat beacon-chain `--mainnet `--datadir=$HOME\ethereum\data\mainnet\beacon `--execution-endpoint=\\.\pipe\geth.ipc `--checkpoint-sync-url=https://sync-mainnet.beaconcha.in `--enable-archive--enable-archiveis what makes it an archive node. It also turns on--enable-state-diff, which stores historical states compactly, and--enable-backfill, which downloads the blocks older than the checkpoint. Don't add--beacon-db-pruning: it deletes the history the archive is built from, and Prysm refuses to start with both. -
Watch the logs. The node downloads the checkpoint, catches up with the chain, then downloads older blocks back to genesis:
INFO backfill: Backfill in progress batchesRemaining=… completion=…% lowestBackfilledSlot=… targetSlot=…Once it has every block, it rebuilds the historical states, oldest first:
INFO archive: Archive state regeneration in progress completion=…% originSlot=0 regeneratedThroughSlot=… targetSlot=…- On mainnet, both phases take days. The node follows the chain the whole time, and a restart resumes where it left off. When it’s done, Prysm logs:
INFO archive: Archive state regeneration finished; all historical states are available regeneratedThroughSlot=…
Check that it works
Ask for the state root of an old slot, such as slot 1000:
curl -s http://localhost:3500/eth/v1/beacon/states/1000/root
curl.exe -s http://localhost:3500/eth/v1/beacon/states/1000/root
Once regeneration finishes, it returns a root for any slot back to genesis. Compare it with the same query on another archive node or a block explorer.
Good to know
- Don't need history back to genesis? Start the archive at a later state with
--archive-origin-state=<PATH>: an SSZ-encoded beacon state at the first slot of an epoch, from a source you trust. The node keeps nothing older than it. You can't change it later without deleting the database. - How fine-grained the history is depends on
--state-diff-exponents, which is fixed when the database is created. The default stores a state at every epoch boundary; larger exponents use less disk and make queries between those points slower.
For the remaining storage flags, see the beacon-chain reference.