Update Commands
Update Commands with Your Variables
Update Commands
ADD NEW KEY
0gchaind keys add wallet --eth --home $HOME/.0gchain
RECOVER EXISTING KEY
0gchaind keys add wallet --recover --eth --home $HOME/.0gchain
LIST ALL KEYS
0gchaind keys list --home $HOME/.0gchain
DELETE KEY
0gchaind keys delete wallet --home $HOME/.0gchain
EXPORT KEY TO A FILE
0gchaind keys export wallet --home $HOME/.0gchain
IMPORT KEY FROM A FILE
0gchaind keys import wallet wallet.backup --home $HOME/.0gchain
QUERY WALLET BALANCE
0gchaind q bank balances --home $HOME/.0gchain $(0gchaind keys show wallet -a --home $HOME/.0gchain)
QUERY EVM WALLET ADDRESS
0gchaind debug addr --home $HOME/.0gchain $(0gchaind keys show wallet -a --home $HOME/.0gchain) | grep 'Address (hex):' | awk -F ': ' '{print "0x" $2}'
EXTRACT EVM WALLET'S PRIVATE KEY
CREATE NEW VALIDATOR
0gchaind tx staking create-validator --home $HOME/.0gchain \
--pubkey=$(0gchaind tendermint show-validator --home $HOME/.0gchain) \
--amount=1000000ua0gi \
--moniker="Node_0G_brand" \
--details="0G_nodebrand_to_the_MOON" \
--website="https://t.me/nodebrand" \
--chain-id=zgtendermint_16600-2 \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.05 \
--min-self-delegation=1 \
--from=wallet \
--gas-adjustment=1.4 \
--gas=auto \
-y
EDIT EXISTING VALIDATOR
0gchaind tx staking edit-validator --home $HOME/.0gchain \
--new-moniker "Node-0G-brand to the Moon" \
--identity "KEYBASE_ID" \
--details "Node-0G-brand to the Moon" \
--website "https://t.me/nodebrand" \
--chain-id zgtendermint_16600-2 \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
-y
DELEGATE TOKENS
0gchaind tx staking delegate --home $HOME/.0gchain $(0gchaind keys show wallet --bech val -a --home $HOME/.0gchain) 1000000ua0gi \
--chain-id zgtendermint_16600-2 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
-y
UNJAIL VALIDATOR
0gchaind tx slashing unjail --home $HOME/.0gchain \
--from wallet \
--chain-id zgtendermint_16600-2 \
--gas-adjustment 1.4 \
--gas auto \
-y
JAIL REASON
0gchaind query slashing signing-info --home $HOME/.0gchain $(0gchaind tendermint show-validator --home $HOME/.0gchain)
LIST ALL ACTIVE VALIDATORS
0gchaind q staking validators --home $HOME/.0gchain -oj --limit=1000 \
| jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' \
| jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' \
| sort -gr \
| nl
LIST ALL INACTIVE VALIDATORS
0gchaind q staking validators --home $HOME/.0gchain -oj --limit=1000 \
| jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' \
| jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' \
| sort -gr \
| nl
VIEW VALIDATOR DETAILS
0gchaind q staking validator --home $HOME/.0gchain $(0gchaind keys show wallet --bech val -a --home $HOME/.0gchain)
DOWNLOAD SNAPSHOT
sudo systemctl stop ogd
cp $HOME/.0gchain/data/priv_validator_state.json $HOME/.0gchain/priv_validator_state.json.backup
sudo rm -rf $HOME/.0gchain/data
curl https://snapshots-testnet.nodejumper.io/0g-testnet/0g-testnet_latest.tar.lz4 | sudo lz4 -dc - | sudo tar -xf - -C $HOME/.0gchain
mv $HOME/.0gchain/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json
sudo systemctl restart ogd && sudo journalctl -u ogd -f -o cat
UPDATE PEERS
sudo wget -O $HOME/.0gchain/0g_peers.sh https://0g.service.nodebrand.xyz/0G/0g_peers.sh
sudo chmod +x $HOME/.0gchain/0g_peers.sh
$HOME/.0gchain/0g_peers.sh
UPDATE ADDRESS BOOK
sudo wget -O $HOME/.0gchain/config/addrbook.json https://0g.service.nodebrand.xyz/0G/addrbook.json
CHECK YOUR LOG SYNC
sudo wget -O $HOME/.0gchain/0g_block_check.sh https://0g.service.nodebrand.xyz/0G/0g_block_check.sh
sudo chmod +x $HOME/.0gchain/0g_block_check.sh
$HOME/.0gchain/0g_block_check.sh
START SERVICE
sudo systemctl start ogd.service
STOP SERVICE
sudo systemctl stop ogd.service
CHECK NODE LOGS
sudo journalctl -fu ogd.service -o cat