How do I restore a node from a snapshot?
Restoring a node from a snapshot allows the node avoid resyncing from genesis by resyncing from the last known validated block saved in the snapshot.
Assuming you have access to a previously saved snapshot, the steps are as follows:
Install lz4
Download the snapshot
Assuming the snapshot is available at some online location, use wget
to retrieve the snapshot file.
Alternatively, copy the file to the local node server using whatever other preferred means.
Stop the node
Reset the node
This will erase your node database. If you are already running validator, be sure you backed up your priv_validator_key.json
prior to running the the command. The command does not wipe the file. However, you should keep a backup of this file in a safe location.
WARNING: If you use this snapshot on a validator node during a chain halt, make sure you back up
priv_validator_state.json
and then replace it after the snapshot is extracted but before you start the node process. This is very important in order to avoid double-signing.
backup
reset
Extract the snapshot
IMPORTANT: If you run a validator node and the chain is in halt, it is time to replace the
priv_validator_state.json
file that you have backed up.
Start the node
Verify the node is running
If everything is good you can delete the snapshot file to free up space.
Last updated