Maintaining a backup node always sync for a collator is vital to make sure you always produce blocks and avoid being slashed. We highly recommend to have it on a different location and hosted on a different provider.
The collator session keys are stored into /var/lib/astar/chains/${NETWORK}/keystore.
You may need to install rsync package depending on your distro
sudo apt-get install rsync
Make sure you save the content of this directory in a backup directory on your local machine:
Move the new release binary and restart the service:
1
sudo mv ./astar-collator /usr/local/bin
2
sudo chmod +x /usr/local/bin/astar-collator
3
sudo systemctl restart ${NETWORK}.service
Copied!
Purge node
Do never purge chain data of an active collator, it not produce blocks anymore during all the sync process and harm the chain block production rate.
Instead, switch to your backup node and purge only once the backup is actively collating.
To start a node from scratch without any chain data, just wipe the chain data directory:
1
sudo systemctl stop ${NETWORK}.service
2
sudo rm -R /var/lib/astar/chains/${NETWORK}/db/*
3
sudo systemctl start ${NETWORK}.service
Copied!
Relay Chain snapshot
If you run your collator it not only needs to sync the mainnet chain but also the complete relay chain from Kusama / Polkadot. This can take up to 3-4 days. You can also use a snapshot of Kusama/Polkadot. You can download this here and will save a lot of time.
NOTE: know what you are doing when using snapshots!