Snapshot
We take one node snapshot every day. We then delete all the previous snapshots to free up the space on the file server. Since we periodically state-sync our snapshot nodes, you might notice that sometimes the size of our snapshot is surprisingly small.
Installation
sudo systemctl stop orai
sudo apt update
sudo apt install snapd -y
sudo snap install lz4
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-sign. When in doubt, reach out to the project team.
cp $HOME/.oraid/data/priv_validator_state.json $HOME/.oraid/priv_validator_state.json.backup
Reset your 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 have a backup of it already in a safe location.
oraid tendermint unsafe-reset-all --home $HOME/.oraid --keep-addr-book
Since Oraichain has enabled wasm and its wasm folder is outside the data folder, our snapshot also includes a wasm folder. Notice that we have taken out the cache sub-folder from the snapshot to ensure the wasm folder is compatible for all CPUs.
To sure that you have a clean start, please delete your wasm folder manually because unsafe-reset-all does not reset the wasm folder.
rm -r ~/.oraid/wasm
curl -L https://snap.blockval.io/oraichain/oraichain_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.oraid
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.
mv $HOME/.oraid/priv_validator_state.json.backup $HOME/.oraid/data/priv_validator_state.json
sudo systemctl start orai
sudo service orai status
sudo journalctl -u orai -f