Skip to content

Latest commit

 

History

History
96 lines (75 loc) · 4.1 KB

migrate_validator.md

File metadata and controls

96 lines (75 loc) · 4.1 KB

Join our telegram Join our discord Visit our website

Deploy your VPS using our referral link to get 20€ bonus

Deploy your VPS using our referral link to get 100$ free bonus for 60 days

Deploy your VPS using our referral link to get 100$ free bonus

Migrate your validator to another machine

1. Run a new full node on a new machine

To setup full node you can follow my guide Cardchain node setup for testnet

2. Confirm that you have the recovery seed phrase information for the active key running on the old machine

To backup your key

Cardchain keys export mykey

This prints the private key that you can then paste into the file mykey.backup

To get list of keys

Cardchain keys list

3. Recover the active key of the old machine on the new machine

This can be done with the mnemonics

Cardchain keys add mykey --recover

Or with the backup file mykey.backup from the previous step

Cardchain keys import mykey mykey.backup

4. Wait for the new full node on the new machine to finish catching-up

To check synchronization status

Cardchain status 2>&1 | jq .SyncInfo

catching_up should be equal to false

5. After the new node has caught-up, stop the validator node

To prevent double signing, you should stop the validator node before stopping the new full node to ensure the new node is at a greater block height than the validator node If the new node is behind the old validator node, then you may double-sign blocks

Stop and disable service on old machine

sudo systemctl stop Cardchain
sudo systemctl disable Cardchain

The validator should start missing blocks at this point

6. Stop service on new machine

sudo systemctl stop Cardchain

7. Move the validator's private key from the old machine to the new machine

Private key is located in: ~/.Cardchain/config/priv_validator_key.json

After being copied, the key priv_validator_key.json should then be removed from the old node's config directory to prevent double-signing if the node were to start back up

sudo mv ~/.Cardchain/config/priv_validator_key.json ~/.Cardchain/bak_priv_validator_key.json

8. Start service on a new validator node

sudo systemctl start Cardchain

The new node should start signing blocks once caught-up

9. Make sure your validator is not jailed

To unjail your validator

Cardchain tx slashing unjail --chain-id $CARDCHAIN_CHAIN_ID --from mykey --gas=auto -y

10. After you ensure your validator is producing blocks and is healthy you can shut down old validator server