While there are not currently snapshots available for the node db, you can move your casper-node to another machine (physical or cloud-based like AWS). There are two primary methods of moving your node to a new machine:
- Stop the node.
- Copy all data.
- Change the mountpoint.
- Start the node.
- Create another node in parallel.
- Once it is up to date, stop the nodes.
- Swap the associated keys.
- Restart the new node.
Note: Use the following command to copy your node's data:
rsync -av --inplace --sparse /var/lib/casper/ /new_mount
Method Two is the safer option, limiting downtime and enabling a smooth transition from old to new nodes, as the node stays in sync with the tip of the chain, vs having to pause to download any blocks generated after the node was stopped.
Create two nodes and key sets. We will call these
Copy both keys to /etc/casper/validator_keys/ under val or backup directories.
│ ├── public_key.pem
│ ├── public_key_hex
│ └── secret_key.pem
| ├── public_key.pem
| ├── public_key_hex
| └── secret_key.pem
This allows going into
backup and doing a
sudo -u casper cp * ../ to "enable" that node to be that key.
Sync both nodes to tip. Keep actively validating node running with the original/validator keyset.
Swapping the nodes
On the current validator (future backup):
sudo systemctl stop casper-node-launcher cd /etc/casper/validator_keys/backup sudo -u casper cp * ../
On the current backup (future validator):
sudo systemctl stop casper-node-launcher cd /etc/casper/validator_keys/val sudo -u casper cp * ../ sudo systemctl start casper-node-launcher
Back on the old validator (new backup):
sudo systemctl start casper-node-launcher
Impact to Rewards
After swapping, the new validator node shows no round length until an Era transition occurs. It is not ejected, but it does not continue to receive rewards until the next era. So if there is a choice for when to do this, you want to time it to just before the era ends.
You will lose all rewards from the point of the switch till the end of that Era. Rewards are then normal in the next Era onwards.