Node CLI Cheatsheet

  • Network Type: Mainnet
  • Chain-id: mainnet-3
  • Current Node version: v1.6.2
  • Planq CLI Cheatsheet

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

    Wallet Management

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

    decentrd keys add <wallet>

    Recover Wallet

    decentrd keys add <wallet> --recover

    List Wallet

    decentrd keys list

    Delete Wallet

    decentrd keys delete <wallet>

    Check Wallet Balance

    decentrd q bank balances $(decentrd keys show wallet -a)

    Validator Management

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

    Create Validator (Staking)

    decentrd tx staking create-validator -y \
      --chain-id mainnet-3 \
      --moniker <YOUR_MONIKER> \
      --pubkey "$(decentrd tendermint show-validator)" \
      --amount <AMMOUNT>udec \
      --identity "YOUR_KEYBASE_ID" \
      --website "YOUUR_WEBSITE_URL" \
      --details "YOUR_DETAILS" \
      --from wallet \
      --commission-rate=0.05 \
      --commission-max-rate=0.20 \
      --commission-max-change-rate=0.01 \
      --min-self-delegation 1 \
      --gas auto \
      --gas-adjustment="1.4" \
      --gas-prices 0udec

    Edit Validator

    decentrd tx staking edit-validator \
    --moniker="<MONIKER>" \
    --identity="YOUR_KEYBASE_ID" \
    --details="YOUR_DETAILS" \
    --website="YOUR_WEBSITE_URL"
    --chain-id mainnet-3 \
    --commission-rate=0.05 \
    --from=<wallet> \
    --gas-adjustment="1.4" \
    --gas auto \
    --gas-prices 0udec \
    -y

    Unjail Validator

    decentrd tx slashing unjail --from <wallet> --chain-id --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Check Jailed Reason

    decentrd query slashing signing-info $(decentrd tendermint show-validator)

    Token Management

    Withdraw Rewards

    decentrd tx distribution withdraw-all-rewards --from wallet --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Withdraw Rewards with Comission

    decentrd tx distribution withdraw-rewards $(decentrd keys show wallet --bech val -a) --commission --from wallet --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Delegate Token to your own validator

    decentrd tx staking delegate $(decentrd keys show wallet --bech val -a) 1000000udec --from wallet --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Delegate Token to other validator

    decentrd tx staking redelegate $(decentrd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000udec --from wallet --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Unbond Token from your validator

    decentrd tx staking unbond $(decentrd keys show wallet --bech val -a) 1000000udec --from wallet --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Send Token to another wallet

    decentrd tx bank send wallet <TO_WALLET_ADDRESS> 1000000udec --from wallet --chain-id mainnet-3

    Governance

    Vote You can change the value of yes to no,abstain,nowithveto

    decentrd tx gov vote 1 yes --from wallet --chain-id mainnet-3 --gas-adjustment="1.4" --gas auto --gas-prices 0udec -y

    Other

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

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

    Enable Indexing usually enabled by default

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

    Disable Indexing

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

    Reset Chain Data

    decentrd tendermint unsafe-reset-all --home $HOME/.decentr --keep-addr-book

    Delete Node

    WARNING! Use this command wisely Backup your key first it will remove Planq

    sudo systemctl stop decentrd && \
    sudo systemctl disable decentrd && \
    rm /etc/systemd/system/decentrd.service && \
    sudo systemctl daemon-reload && \
    cd $HOME && \
    rm -rf .decentr && \
    rm -rf $(which decentrd)