Node CLI Cheatsheet

  • Network Type: Testnet
  • Chain-id: zgtendermint_16600-1
  • Current Node version: v0.1.0
  • CLI Cheatsheet

    • Always be careful with the capitalized words
    • Specify --chain-id

    Usefull Command

    0gchaind status 2>&1 | jq .sync_info

    Wallet Management

    Add Wallet Specify the value <wallet> with your own wallet name

    0gchaind keys add wallet --eth

    Recover Wallet

    0gchaind keys add wallet --eth --recover

    List Wallet

    0gchaind keys list

    Delete Wallet

    0gchaind keys delete wallet

    Check Wallet Balance

    0gchaind q bank balances $(0gchaind keys show wallet -a)

    Validator Management

    Please adjust <wallet> , MONIKER , YOUR_KEYBASE_ID , YOUR_DETAILS , YOUUR_WEBSITE_URL

    0gchaind tx staking create-validator \
     --amount=<staking_amount>ua0gi \
    --pubkey=$(0gchaind tendermint show-validator) \
    --moniker="" \
    --identity="" \
    --details="" \
    --website="" \
    --chain-id=zgtendermint_16600-1 \
    --commission-rate="0.10" \
    --commission-max-rate="0.20" \
    --commission-max-change-rate="0.02" \
    --min-self-delegation="1" \
    --from=wallet \
    --gas=auto \
    --gas-adjustment=1.4

    Unjail Validator

    0gchaind tx slashing unjail --from wallet --chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Check Jailed Reason

    0gchaind query slashing signing-info $(0gchaind tendermint show-validator)

    Token Management

    Withdraw Rewards

    0gchaind tx distribution withdraw-all-rewards --from wallet ---chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Withdraw Rewards with Comission

    0gchaind tx distribution withdraw-rewards $(0gchaind keys show wallet --bech val -a) --commission --from wallet --chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Delegate Token to your own validator

    0gchaind tx staking delegate $(0gchaind keys show wallet --bech val -a) 1000000amf --from wallet --chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Delegate Token to other validator

    0gchaind staking redelegate $(0gchaind keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000amf --from wallet --chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Unbond Token from your validator

    0gchaind tx staking unbond $(0gchaind keys show wallet --bech val -a) 1000000amf --from wallet --chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Send Token to another wallet

    0gchaind tx bank send wallet <TO_WALLET_ADDRESS> 1000000amf --from wallet --chain-id zgtendermint_16600-1 --gas-adjustment=1.4 --gas=auto -y

    Other

    Set Your own Custom Ports You can change value CUSTOM_PORT=20 To any other ports

    • PORT=45
    PORT=45
    0gchaind config node tcp://localhost:${PORT}657
    sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${PORT}660\"%" $HOME/.0gchain/config/config.toml
    sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${PORT}317\"%; s%^address = \":8080\"%address = \":${PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${PORT}091\"%; s%^address = \"127.0.0.1:8545\"%address = \"127.0.0.1:${PORT}545\"%; s%^ws-address = \"127.0.0.1:8546\"%ws-address = \"127.0.0.1:${PORT}546\"%" $HOME/.0gchain/config/app.toml

    Enable Indexing usually enabled by default

    sed -i 's|^indexer *=.*|indexer = "kv"|' $HOME/.0gchain/config/config.toml

    Disable Indexing

    sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.0gchain/config/config.toml

    Reset Chain Data

    0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book

    Delete Node

    WARNING! Use this command wisely Backup your key first it will remove Defund from your system

    sudo systemctl stop 0gchaind
    sudo systemctl disable junctiond
    sudo rm /etc/systemd/system/0gchaind.service
    sudo systemctl daemon-reload
    rm -f $(which 0gchaind)
    rm -rf .0gchain
    rm -rf 0gchain