Node CLI Cheatsheet

  • Network Type: Mainnet
  • Chain-id: bitcanna-1
  • Current Node version: v2.0.3
  • 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

    bcnad keys add <wallet>

    Recover Wallet

    bcnad keys add <wallet> --recover

    List Wallet

    bcnad keys list

    Delete Wallet

    bcnad keys delete <wallet>

    Check Wallet Balance

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

    Validator Management


    Create Validator (Staking)

    bcnad tx staking create-validator \
    --amount=1000000ubcna \
    --pubkey=$(bcnad tendermint show-validator) \
    --moniker="YOUR_MONIKER_NAME" \
    --identity="YOUR_KEYBASE_ID" \
    --details="YOUR_DETAILS" \
    --website="YOUR_WEBSITE_URL" \
    --chain-id=bitcanna-1 \
    --commission-rate=0.05 \
    --commission-max-rate=0.20 \
    --commission-max-change-rate=0.01 \
    --min-self-delegation=1 \
    --from=wallet \
    --gas-adjustment=1.4 \
    --gas=auto \
    --gas-prices=0ubcna \

    Edit Validator

    bcnad tx staking edit-validator \
    --moniker="<MONIKER>" \
    --identity="YOUR_KEYBASE_ID" \
    --details="YOUR_DETAILS" \
    --chain-id bitcanna-1 \
    --commission-rate=0.05 \
    --from=<wallet> \
    --gas-adjustment 1.5 \
    --gas="auto" \
    --gas-prices 0.1ubcna \

    Unjail Validator

    bcnad tx slashing unjail --from <wallet> --chain-id --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y

    Check Jailed Reason

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

    Token Management

    Withdraw Rewards

    bcnad tx distribution withdraw-all-rewards --from wallet --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y

    Withdraw Rewards with Comission

    bcnad tx distribution withdraw-rewards $(bcnad keys show wallet --bech val -a) --commission --from wallet --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y

    Delegate Token to your own validator

    bcnad tx staking delegate $(bcnad keys show wallet --bech val -a) 1000000ubcna --from wallet --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y

    Delegate Token to other validator

    bcnad tx staking redelegate $(bcnad keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000ubcna --from wallet --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y

    Unbond Token from your validator

    bcnad tx staking unbond $(bcnad keys show wallet --bech val -a) 1000000ubcna --from wallet --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y

    Send Token to another wallet

    bcnad tx bank send wallet <TO_WALLET_ADDRESS> 1000000ubcna --from wallet --chain-id bitcanna-1


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

    bcnad tx gov vote 1 yes --from wallet --chain-id bitcanna-1 --gas-adjustment 1.5 --gas="auto" --gas-prices 0.1ubcna -y


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

    sed -i.bak -e "s%^proxy_app = \"tcp://\"%proxy_app = \"tcp://${CUSTOM_PORT}658\"%; s%^laddr = \"tcp://\"%laddr = \"tcp://${CUSTOM_PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${CUSTOM_PORT}060\"%; s%^laddr = \"tcp://\"%laddr = \"tcp://${CUSTOM_PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${CUSTOM_PORT}660\"%" $HOME/.bcna/config/config.toml
    sed -i.bak -e "s%^address = \"tcp://\"%address = \"tcp://${CUSTOM_PORT}317\"%; s%^address = \":8080\"%address = \":${CUSTOM_PORT}080\"%; s%^address = \"\"%address = \"${CUSTOM_PORT}090\"%; s%^address = \"\"%address = \"${CUSTOM_PORT}091\"%; s%^address = \"\"%address = \"${CUSTOM_PORT}545\"%; s%^ws-address = \"\"%ws-address = \"${CUSTOM_PORT}546\"%" $HOME/.bcna/config/app.toml

    Enable Indexing usually enabled by default

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

    Disable Indexing

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

    Reset Chain Data

    bcnad tendermint unsafe-reset-all --home $HOME/.bcna --keep-addr-book

    Delete Node

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

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