Skip to content

Backup Node

0G banner”

Part 1: Backing Up the Node

  1. Stop node:
    Terminal window
    sudo systemctl stop 0gd.service
  2. Backup the wallet private key by exporting the Ethereum key
    Terminal window
    0gchaind keys unsafe-export-eth-key "wallet"
  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
    Terminal window
    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:
    Terminal window
    # Steps to install a new node
    # Wait until the node is fully synced
  2. 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
  3. Restart the node
    Terminal window
    sudo systemctl start 0gd
  4. Check the node and validator status to ensure everything is functioning normally.