Parameters
Binary | Chain ID | Staking Denom | Key name | Gas prices, ua0gi |
0gchaind | zgtendermint_16600-2 | ua0gi | wallet | 0.0025 |
Key
Add New Key
bash0gchaind keys add wallet
Recover Existing Key
bash0gchaind keys add wallet --recover
List All Keys
bash0gchaind keys list
Delete Key
bash0gchaind keys delete wallet
Export Key (save to wallet.backup)
bash0gchaind keys export wallet
Import Key
bash0gchaind keys import wallet wallet.backup
Query Wallet Balance
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind tx slashing unjail --from wallet --chain-id zgtendermint_16600-2 --gas-prices 0.0025ua0gi --gas-adjustment 1.5 --gas auto -y
Signing Info
bash0gchaind query slashing signing-info $(0gchaind tendermint show-validator)
List All Active Validators
bash0gchaind 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
bash0gchaind 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
bash0gchaind q staking validator $(0gchaind keys show wallet --bech val -a)
Tokens
Withdraw Rewards From All Validators
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind query gov proposals
Proposal id
View Proposal By ID
bash0gchaind query gov proposal 1
Vote YES
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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
bash0gchaind 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_IDbash0gchaind 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 |
bashsed -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
bashsed -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
bash0gchaind status 2>&1 | jq -r '.ValidatorInfo // .validator_info'
Get Denom Info
bash0gchaind q bank denom-metadata -oj | jq
Get Sync Status
bash0gchaind status 2>&1 | jq -r '.SyncInfo.catching_up // .sync_info.catching_up'
Get Latest Height
bash0gchaind status 2>&1 | jq -r '.SyncInfo.latest_block_height // .sync_info.latest_block_height'
Get Peer
bashecho $(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
bash0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book
Remove Node
bashsudo 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
bashwget -qO- eth0.me
Hostname
Update Hostname =
0g-testnet-nodebashsudo hostnamectl set-hostname 0g-testnet-node
Service Management
Reload Services
bashsudo systemctl daemon-reload
Enable Service
bashsudo systemctl enable 0gchaind
Disable Service
bashsudo systemctl disable 0gchaind
Run Service
bashsudo systemctl start 0gchaind
Stop Service
bashsudo systemctl stop 0gchaind
Restart Service
bashsudo systemctl restart 0gchaind
Check Service Status
bashsudo systemctl status 0gchaind
Check Service Logs
bashsudo journalctl -u 0gchaind -f --no-hostname -o cat