Snapshot Guide

We support snapshot for berachain mainnet

Check your client version

beacond: v1.1.3

Restore snapshot

Shut down your node - it should not be writing any new data (which could render your snapshot restore corrupt).
Verify that the process isn't running:
ps aux|grep beacond
Plain Text
복사
Out of an abdundance of caution, make sure your private key ($BEACOND_HOME/data/priv_validator_key.json) is backed up before proceeding.
Reset the beacond database:
$ beacond comet unsafe-reset-all I[2024-09-04|17:00:57.137] Removed all blockchain history dir=/root/.beacond/data I[2024-09-04|17:00:57.137] Reset private validator file to genesis state keyFile=/root/.beacond/config/priv_validator_key.json stateFile=/root/.beacond/data/priv_validator_state.json
Plain Text
복사
Download snapshot
wget -O snapshot.tar.lz4 https://api-dev.hypurrcorea.despreadlabs.io/vp/snapshot/bera/mainnet/cl/full
HTML
복사
Restore your archive and replace the data directory:
cd $BEACOND_HOME/ rm -rf data lz4 -dc < snapshot.tar.lz4 | tar xvf - ls -l data
Plain Text
복사

Optimizations

Verify the age of the snapshot before attempting to restore - eg. if you restore a day old snapshot, the node will still spend a fair amount of time in catching up to the current moment.
Download snapshots for a location that's geographically close to your node and if possible on the same network. Our snapshot region is AWS ap-northeast-2
Use multi-connection downloads to speed up the process. For instance, aria2c is a tool that can be used to set up programatic download operations.

Watch Out!

Some users have reported that it is safer to copy priv_validator_state.json before restoring snapshots, as they've observed the node state to become inconsistent later on.
If your snapshot restore has gone awry, you may encounter this message in the logs after the node starts up.
ERROR startup failure error="genesis doc hash in db does not match loaded genesis doc
Run beacond comet unsafe-reset-all and try restoring again.
Do not include your private key or jwt.hex with the snapshot - these are secrets to be safely guarded, and not shared with others.
priv_validator_state.json - Indicates chain state. Looks like so:
{ "height": "111", "round": 11, "step": 111, "signature": "xxxxxxxx", "signbytes": "xxxxxxxxxxx" }
Plain Text
복사
priv_validator_key.json - Your (safely guarded) key pair used for signing transactions. Looks like so:
{ "address": "xxxxxxxxxxxxxxxx", "pub_key": { "type": "cometbft/PubKeyBls12_381", "value": "xxxxxxxxxxxxxxxx" }, "priv_key": { "type": "cometbft/PrivKeyBls12_381", "value": "xxxxxxxxxxxxxxxxxxxxx" } }
Plain Text
복사
jwt.hex is used for auth between the beacon and execution client, can be changed peridically for better security (ensure that both your beacond and execution config reflects this). Please note that the JWT must start with 0x.