Kichain Node Snapshot

Chain ID: kichain-2 | Current Node Version: 5.0.2

Latest
Block Height
Size
Timestamp
Download
20716694 2 GB 1 hour ago kichain_20716694.tar.lz4
20701234 2 GB 1 day ago kichain_20701234.tar.lz4

Our Kichain Snapshot Server Setup

We take one node snapshot every day. We then delete all the previous snapshots to free up the space on the file server.

The snapshot is designed for node opeartors to run an efficient node on Kichain chain. To make the snapshot as small as possible while still viable as a validator, we use the following setting to save on the disk space. It might be helpful for you to sync with our snapshot periodically because Tendermint chain storage grows over time regardless of the pruning. Since we periodically state-sync our snapshot nodes, you might notice that sometimes the size of our snapshot is surprisingly small.

app.toml

# Prune Type
pruning = "custom"

# Prune Strategy
pruning-keep-recent = "100"
pruning-keep-every = "0"
pruning-interval = "10"

config.toml

indexer = "null"

How To Process Kichain Snapshot

Install lz4 if needed

sudo apt update
sudo apt install snapd -y
sudo snap install lz4

Download the snapshot

wget -O kichain_20716694.tar.lz4 https://snapshots.polkachu.com/snapshots/kichain/kichain_20716694.tar.lz4 --inet4-only

Stop your node

sudo service kichain stop

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.

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-sign. When in doubt, reach out to the project team.

# Back up priv_validator_state.json if needed
cp ~/.kid/data/priv_validator_state.json  ~/.kid/priv_validator_state.json

# On some tendermint chains
kid unsafe-reset-all

# On other tendermint chains
kid tendermint unsafe-reset-all --home $HOME/.kid --keep-addr-book

Since Kichain 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 ~/.kid/wasm

Decompress the snapshot to your database location. You database location will be something to the effect of ~/.kid depending on your node implemention.

lz4 -c -d kichain_20716694.tar.lz4  | tar -x -C $HOME/.kid

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.

# Replace with the backed-up priv_validator_state.json
cp ~/.kid/priv_validator_state.json  ~/.kid/data/priv_validator_state.json

Now double-check the ~/.kid/wasm folder to ensure that it is not empty. If it is empty, it means that our snapshot script has a bug. Please contact us via Discord Server.

If everything is good, now restart your node

sudo service kichain start

Remove downloaded snapshot to free up space

rm -v kichain_20716694.tar.lz4

Make sure that your node is running

sudo service kichain status
sudo journalctl -u kichain -f

ADVANCED ROUTE: The above solution requires you to download the compressed file, uncompressed it and then delete the original file. This requires extra storage space on your server. You can run the following combo command to stream the snapshot into your database location. For advanced users only:

curl -o - -L https://snapshots.polkachu.com/snapshots/kichain/kichain_20716694.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.kid

ALTERNATIVE ROUTE: We also have Kichain state-sync service to help you bootstrap a node.