Node CLI Cheatsheet

  • Network Type: Testnet
  • Chain-id: prysm-devnet-1
  • Current Node version: v0.1.0-devnet
  • 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

    prysmd keys add wallet

    Recover Wallet

    prysmd keys add wallet --recover

    List Wallet

    prysmd keys list

    Delete Wallet

    prysmd keys delete wallet

    Check Wallet Balance

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

    Validator Management

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

    Create Validator (Staking)

    prysmd comet show-validator
    nano /root/.prysm/validator.json
    {
      "pubkey": ,
      "amount": "2000000uprysm",
      "moniker": "",
      "identity": "",
      "website": "",
      "security": "",
      "details": "r",
      "commission-rate": "0.05",
      "commission-max-rate": "0.2",
      "commission-max-change-rate": "0.05",
      "min-self-delegation": "1"
    }
    prysmd tx staking create-validator $HOME/.prysm/validator.json \
        --from=wallet \
        --chain-id=prysm-devnet-1

    Edit Validator

    prysmd tx staking edit-validator \
    --new-moniker="" \
    --identity="" \
    --details="" \
    --website="" \
    --chain-id=prysm-devnet-1 \
    --from=wallet

    Unjail Validator

    prysmd  tx slashing unjail --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Check Jailed Reason

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

    Token Management

    Withdraw Rewards

    prysmd tx distribution withdraw-all-rewards --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Withdraw Rewards with Comission

    prysmd tx distribution withdraw-rewards $(prysmd keys show wallet --bech val -a) --commission --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Delegate Token to your own validator

    prysmd tx staking delegate $(prysmd keys show wallet --bech val -a) 1000000uprysm --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Delegate Token to other validator

    prysmd tx staking redelegate $(prysmd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 1000000uprysm --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Unbond Token from your validator

    prysmd tx staking unbond $(prysmd keys show wallet --bech val -a) 1000000uprysm --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Send Token to another wallet

    prysmd tx bank send wallet <TO_WALLET_ADDRESS> 1000000uprysm --from wallet ---chain-id prysm-devnet-1 --gas auto -y

    Governance

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

    prysmd tx gov vote 1 yes --from wallet --chain-id prysm-devnet-1 --gas auto -y

    Other

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

    • PORT=29
    sed -i.bak -e  "s%^node = \"tcp://localhost:26657\"%node = \"tcp://localhost:29657\"%" $HOME/.prysm/config/client.toml
    sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:29658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:29657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:29060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:29656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":29660\"%" $HOME/.prysm/config/config.toml
    sed -i.bak -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://localhost:29317\"%; s%^address = \"localhost:9090\"%address = \"localhost:29090\"%" $HOME/.prysm/config/app.toml

    Enable Indexing usually enabled by default

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

    Disable Indexing

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

    Reset Chain Data

    prysmd tendermint unsafe-reset-all --home $HOME/.prysm --keep-addr-book

    Delete Node

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

    sudo systemctl stop prysmd
    sudo systemctl disable prysmd
    sudo rm /etc/systemd/system/prysmd.service
    sudo systemctl daemon-reload
    rm -f $(which prysmd)
    rm -rf .prysm
    rm -rf prysm