Useful Commands/
testnet/
0g

testnet
Rpc status: Active

Service operations

#check logs
sudo journalctl -u 0gchaind -f

#start service
sudo systemctl start 0gchaind

#stop service
sudo systemctl stop 0gchaind

#restart service
sudo systemctl restart 0gchaind

#service status
sudo systemctl status 0gchaind

#enable service
sudo systemctl enable 0gchaind

#disable service
sudo systemctl disable 0gchaind

#reload all service files
sudo systemctl daemon-reload

#get node info
0gchaind status 2>&1 | jq -r

#get node id
0gchaind tendermint show-node-id

Key management

#add new wallet
0gchaind keys add <wallet-name>

#restore existing wallet
0gchaind keys add <wallet-name> --recover

#delete wallet
0gchaind keys delete <wallet-name>

#list all wallets
0gchaind keys list

#check balance
0gchaind q bank balances <wallet-address>

Tokens operations

#withdraw all rewards
0gchaind tx distribution withdraw-all-rewards --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#withdraw rewards from specific validator
0gchaind tx distribution withdraw-rewards <validator-valoper-address> --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#delegate
0gchaind tx staking delegate <validator-valoper-address> ${10**network.other.denom_exponent}ua0gi --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#redelegate
0gchaind tx staking redelegate <from-validator-valoper-address> <to-validator-valoper-address> ${10**network.other.denom_exponent}ua0gi --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#unbond
0gchaind tx staking unbond <validator-valoper-address> ${10**network.other.denom_exponent}ua0gi --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#transfer
0gchaind tx bank send <wallet-name> <wallet-address> ${10**network.other.denom_exponent}ua0gi --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

Governance operations

#vote "yes"
0gchaind tx gov vote <proposal-id> yes --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#vote "no"
0gchaind tx gov vote <proposal-id> no --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#vote "no with veto"
0gchaind tx gov vote <proposal-id> no_with_veto --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#vote "abstain"
0gchaind tx gov vote <proposal-id> abstain --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y

#view all proposals
0gchaind query gov proposals

#view proposal by ID
0gchaind query gov proposal <proposal-id>

Validator operations

#create validator
0gchaind tx staking create-validator \
--amount 1000000ua0gi \
--moniker "" \
--identity "" \
--details "" \
--website "" \
--security-contact "" \
--pubkey $(0gchaind tendermint show-validator) \
--commission-rate 0.05 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--chain-id zgtendermint_16600-2 \
--from <wallet-name> \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 0.025ua0gi \
--node "https://rpc.0g.testnet.dteam.tech:443" \
-y

#edit validator
0gchaind tx staking edit-validator \
--new-moniker "" \
--identity "" \
--details "" \
--website "" \
--security-contact "" \
--commission-rate 0.05 \
--chain-id zgtendermint_16600-2 \
--from <wallet-name> \
--gas auto \
--gas-adjustment 1.5 \
--gas-prices 0.025ua0gi \
--node "https://rpc.0g.testnet.dteam.tech:443" \
-y

#unjail validator
0gchaind tx slashing unjail --from <wallet-name> --chain-id zgtendermint_16600-2 --gas auto --gas-adjustment 1.5 --gas-prices 0.025ua0gi --node "https://rpc.0g.testnet.dteam.tech:443" -y