logo

Parameters

Binary
Chain ID
Staking Denom
Key name
Gas prices, ua0gi
0gchaind
zgtendermint_16600-2
ua0gi
wallet
0.0025

Key

Add New Key
bash
0gchaind keys add wallet
Recover Existing Key
bash
0gchaind keys add wallet --recover
List All Keys
bash
0gchaind keys list
Delete Key
bash
0gchaind keys delete wallet
Export Key (save to wallet.backup)
bash
0gchaind keys export wallet
Import Key
bash
0gchaind keys import wallet wallet.backup
Query Wallet Balance
bash
0gchaind q bank balances $(0gchaind keys show wallet -a)

Validator

Moniker
Identity
Details
Moniker
FFB0AA51A2DF5955
I'm sexy and I know itπŸ˜‰
γ…€
γ…€
γ…€
Commission rate
Commission max rate
Commission max change rate
0.10
0.20
0.01
Create New Validator
bash
0gchaind tx staking create-validator \ --amount=1000000ua0gi \ --pubkey=$(0gchaind tendermint show-validator) \ --moniker="Moniker" \ --identity=FFB0AA51A2DF5955 \ --details="I'm sexy and I know itπŸ˜‰" \ --chain-id=zgtendermint_16600-2 \ --commission-rate=0.10 \ --commission-max-rate=0.20 \ --commission-max-change-rate=0.01 \ --min-self-delegation=1 \ --from=wallet \ --gas-prices=0.0025ua0gi \ --gas-adjustment=1.5 \ --gas=auto \ -y
Edit Existing Validator
bash
0gchaind tx staking edit-validator \ --new-moniker="Moniker" \ --identity=FFB0AA51A2DF5955 \ --details="I'm sexy and I know itπŸ˜‰" \ --chain-id=zgtendermint_16600-2 \ --commission-rate=0.1 \ --from=wallet \ --gas-prices=0.0025ua0gi \ --gas-adjustment=1.5 \ --gas=auto \ -y
Unjail Validator
bash
0gchaind tx slashing unjail --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Signing Info
bash
0gchaind query slashing signing-info $(0gchaind tendermint show-validator)
List All Active Validators
bash
0gchaind q staking validators -oj --limit=3000 | 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
bash
0gchaind q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED" or .status=="BOND_STATUS_UNBONDING")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl
View Validator Details
bash
0gchaind q staking validator $(0gchaind keys show wallet --bech val -a)

Tokens

Withdraw Rewards From All Validators
bash
0gchaind tx distribution withdraw-all-rewards --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Withdraw Commission And Rewards From Your Validator
bash
0gchaind tx distribution withdraw-rewards $(0gchaind keys show wallet --bech val -a) --commission --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Delegate to yourself
bash
0gchaind tx staking delegate $(0gchaind keys show wallet --bech val -a) 1000000ua0gi --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Delegate
bash
0gchaind tx staking delegate YOUR_TO_VALOPER_ADDRESS 1000000ua0gi --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Redelegate
bash
0gchaind tx staking redelegate $(0gchaind keys show wallet --bech val -a) YOUR_TO_VALOPER_ADDRESS 1000000ua0gi --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Unbond
bash
0gchaind tx staking unbond $(0gchaind keys show wallet --bech val -a) 1000000ua0gi --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Send
bash
0gchaind tx bank send wallet YOUR_TO_WALLET_ADDRESS 1000000ua0gi --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y

Governance

Create New Text Proposal
bash
0gchaind tx gov submit-proposal \ --title="Title" \ --description="Description" \ --deposit=1000000ua0gi \ --type="Text" \ --from=wallet \ --gas-prices=0.0025ua0gi \ --gas-adjustment=1.5 \ --gas=auto \ -y
List All Proposals
bash
0gchaind query gov proposals
Proposal id
View Proposal By ID
bash
0gchaind query gov proposal 1
Vote YES
bash
0gchaind tx gov vote 1 yes --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Vote NO
bash
0gchaind tx gov vote 1 no --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Vote NO_WITH_VETO
bash
0gchaind tx gov vote 1 no_with_veto --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Vote ABSTAIN
bash
0gchaind tx gov vote 1 abstain --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y

Query

Query Transaction
Transaction Id = YOUR_TX_ID
bash
0gchaind query tx YOUR_TX_ID0gchaind query tx YOUR_TX_ID

Utility

Change Default Ports
Default
1
2
3
4
5
γ…€
γ…€
γ…€
γ…€
γ…€
γ…€
gRPC
gRPC(web)
proxy_app
laddr(rpc)
pprof_laddr
laddr(p2p)
9090
9091
26658
26657
26656
6060
γ…€
γ…€
γ…€
γ…€
γ…€
γ…€
prometheus
api
26660
1317
bash
sed -i.bak -e "s%:26658%:26658%; s%:26657%:26657%; s%:6060%:6060%; s%:26656%:26656%; s%:26660%:26660%" $HOME/.0gchain/config/config.toml && sed -i.bak -e "s%:9090%:9090%; s%:9091%:9091%; s%:1317%:1317%; s%:8545%:8545%; s%:8546%:8546%; s%:6065%:6065%" $HOME/.0gchain/config/app.toml && sed -i.bak -e "s%:26657%:26657%" $HOME/.0gchain/config/client.toml
Update Indexer
Default
Null
bash
# Default sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.0gchain/config/config.toml # Null sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.0gchain/config/config.toml
Update Pruning
bash
sed -i.bak -e 's|^pruning *=.*|pruning = "custom"|; s|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|; s|^pruning-keep-every *=.*|pruning-keep-every = "0"|; s|^pruning-interval *=.*|pruning-interval = "17"|' $HOME/.0gchain/config/app.toml
Get Validator Info
bash
0gchaind status 2>&1 | jq -r '.ValidatorInfo // .validator_info'
Get Denom Info
bash
0gchaind q bank denom-metadata -oj | jq
Get Sync Status
bash
0gchaind status 2>&1 | jq -r '.SyncInfo.catching_up // .sync_info.catching_up'
Get Latest Height
bash
0gchaind status 2>&1 | jq -r '.SyncInfo.latest_block_height // .sync_info.latest_block_height'
Get Peer
bash
echo $(0gchaind tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.0gchain/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Reset Node
bash
0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book
Remove Node
bash
sudo systemctl stop 0gchaind && sudo systemctl disable 0gchaind && sudo rm /etc/systemd/system/0gchaind.service && sudo systemctl daemon-reload && rm -rf $HOME/.0gchain && rm -rf 0g-chain && sudo rm -rf $(which 0gchaind)
Get IP Address
bash
wget -qO- eth0.me
Hostname
Update Hostname = 0g-testnet-node
bash
sudo hostnamectl set-hostname 0g-testnet-node

Service Management

Reload Services
bash
sudo systemctl daemon-reload
Enable Service
bash
sudo systemctl enable 0gchaind
Disable Service
bash
sudo systemctl disable 0gchaind
Run Service
bash
sudo systemctl start 0gchaind
Stop Service
bash
sudo systemctl stop 0gchaind
Restart Service
bash
sudo systemctl restart 0gchaind
Check Service Status
bash
sudo systemctl status 0gchaind
Check Service Logs
bash
sudo journalctl -u 0gchaind -f --no-hostname -o cat