Skip to content

Backup

0G Labs testnet

Terminal window
sudo systemctl stop 0gd.service

Export your Ethereum wallet private key:

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

The validator key is located here:

/root/.0gchain/config/priv_validator_key.json

Copy this file to your local machine. This is your most important key as a validator. Losing it means losing control of your validator.

If you’ve never made a backup before, it’s recommended to back up the entire config folder:

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

Install a Fresh Node and Sync the Blockchain

Section titled “Install a Fresh Node and Sync the Blockchain”

Follow the instructions to install a new node and wait until the blockchain is fully synced.

💡 Tip: Refer to the official 0G documentation or installation guide to set up the new node.

Terminal window
sudo systemctl stop 0gd

⚠️ Important Warning

Make sure the old VPS node is stopped. Never run two nodes using the same priv_validator_key.json, as this will cause double signing and could result in slashing.

Copy and replace the previously backed up priv_validator_key.json into:

/root/.0gchain/config/
Terminal window
0gchaind keys unsafe-import-eth-key "wallet_name" "privatekey"
Terminal window
0gchaind keys add "wallet" --eth --recover
Terminal window
sudo systemctl start 0gd

Make sure everything is operating correctly by checking your node and validator status:

Terminal window
0gchaind status

Or check validator info:

Terminal window
0gchaind q staking validator $(0gchaind keys show wallet --bech val -a)

⚠️ Caution
  • Always back up critical data before any major actions.
  • Store your keys and backups in a secure, preferably offline, location (e.g. hardware wallet, encrypted USB, or offline password manager).
  • Never share your private key or mnemonic phrase with anyone. Beware of phishing sites or impersonators.
  • Double-check every operation involving your validator to avoid risks like slashing. Ensure the chain ID, gas fees, and validator address are correct.