Page cover

Backup and Restore Validator Node

DISCLAIMER: This guide is for informational purposes only. Use at your own risk. Always verify steps with official documentation and ensure you fully understand each action before proceeding.

Part 1: Backing Up the Node

  1. Stop the node:

    sudo systemctl stop 0gd
  2. Backup the wallet private key by exporting the Ethereum key:

    0gchaind keys unsafe-export-eth-key "wallet"

    Note: Write down this private key and store it securely.

  3. 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.

  4. If you've never backed up before, backup the entire config folder:

    cp -r /root/.0gchain/config /path/to/backup/location

Part 2: Restoring the Node and Wallet

  1. Install a new node and sync the blockchain:

    # Steps to install a new node
    # Wait until the node is fully synced
  2. Perform the restoration:

    a. Stop the new node:

    sudo systemctl stop 0gd

    b. WARNING: Ensure you've stopped the node on the old VPS. Never run 2 nodes with the same priv_validator_key.json. This will lead to double signing and potential slashing.

    c. Copy and replace the previously backed up priv_validator_key.json file into the /root/.0gchain/config/ directory of the new node.

    d. Restore the wallet:

    • From Private key:

      0gchaind keys unsafe-import-eth-key "wallet_name" "privatekey"
    • Or from mnemonic phrase:

      0gchaind keys add "wallet" --eth --recover
  3. Restart the node:

    sudo systemctl start 0gd
  4. Check the node and validator status to ensure everything is functioning normally.

circle-exclamation

Important Notes:

  • Always backup important data before making any significant changes.

  • Ensure you store keys and backups in a secure location, preferably offline.

  • Never share your private key or mnemonic phrase with anyone.

  • Always double-check before performing operations related to your validator to avoid the risk of slashing.

Last updated