Backup Node
Part 1: Backing Up the Node
-
Stop node:
Terminal window sudo systemctl stop 0gd.service -
Backup the wallet private key by exporting the Ethereum key
Terminal window 0gchaind keys unsafe-export-eth-key "wallet" -
Backup the validator key
- File location: /root/.0gchain/config/priv_validator_key.json
- Copy this file to your local machine.
- Store it carefully; this is the most crucial key for your validator.
-
If you’ve never backed up before, backup the entire
config folder
Terminal window cp -r /root/.0gchain/config /path/to/backup/location
Part 2: Restoring the Node and Wallet
-
Install a new node and sync the blockchain:
Terminal window # Steps to install a new node# Wait until the node is fully synced -
Perform the restoration
- Stop the new node:
Terminal window sudo systemctl stop 0gd- Copy and replace the previously backed up
priv_validator_key.json
file into the/root/.0gchain/config/
directory of the new node. - Restore the wallet:
- From Private key:
Terminal window 0gchaind keys unsafe-import-eth-key "wallet_name" "privatekey"- From mnemonic phrase:
Terminal window 0gchaind keys add "wallet" --eth --recover
-
Restart the node
Terminal window sudo systemctl start 0gd -
Check the node and validator status to ensure everything is functioning normally.