Node CLI Cheatsheet

  • Network Type: Testnet
  • Chain-id: structstestnet-102
  • Current Node version: v0.7.0-beta
  • CLI Cheatsheet

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

    Usefull Command

    structsd status 2>&1 | jq .sync_info

    Wallet Management

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

    structsd keys add wallet

    Recover Wallet

    structsd keys add wallet --recover

    List Wallet

    structsd keys list

    Delete Wallet

    structsd keys delete wallet

    Check Wallet Balance

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

    Validator Management

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

    Create Validator (Staking)

    • Check Your Pubkey
    structsd comet show-validator
    • Make File validator.json
    nano $HOME/validator.json
    {
      "pubkey": {"#pubkey"},
      "amount": "100000000ualpha",
      "moniker": "",
      "identity": "",
      "website": "",
      "security": "",
      "details": "",
      "commission-rate": "0.05",
      "commission-max-rate": "0.2",
      "commission-max-change-rate": "0.2",
      "min-self-delegation": "1"
    }
    structsd tx staking create-validator $HOME/validator.json \
        --from=wallet \
        --chain-id=structstestnet-102 \
        --gas=auto

    Unjail Validator

    structsd tx slashing unjail --from Wallet --chain-id structstestnet-102 --gas=auto

    Check Jailed Reason

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

    Token Management

    Withdraw Rewards

    structsd tx distribution withdraw-all-rewards --from Wallet --chain-id structstestnet-102 --gas=auto

    Withdraw Rewards with Comission

    structsd tx distribution withdraw-rewards $(structsd keys show wallet --bech val -a) --commission --from wallet --chain-id structstestnet-102 --gas=auto

    Delegate Token to your own validator

    structsd tx staking delegate $(structsd keys show wallet --bech val -a) 100alpha --from wallet --chain-id structstestnet-102 --gas=auto

    Delegate Token to other validator

    structsd staking redelegate $(structsd keys show wallet --bech val -a) <TO_VALOPER_ADDRESS> 10alpha --from wallet --chain-id structstestnet-102 --gas=auto

    Unbond Token from your validator

    structsd tx staking unbond $(structsd keys show wallet --bech val -a) 100alpha --from wallet --chain-id structstestnet-102 --gas=auto

    Send Token to another wallet

    structsd tx bank send wallet <TO_WALLET_ADDRESS> 100alpha --from wallet --chain-id structstestnet-102 --gas=auto

    Other

    Set Your own Custom Ports

    PORT=132
    sed -i -e "s%:26657%:${PORT}57%" $HOME/.structs/config/client.toml
    sed -i -e "s%:26658%:${PORT}58%; s%:26657%:${PORT}57%; s%:6060%:${PORT}60%; s%:26656%:${PORT}56%; s%:26660%:${PORT}61%" $HOME/.structs/config/config.toml
    sed -i -e "s%:1317%:${PORT}17%; s%:9090%:${PORT}90%" $HOME/.structs/config/app.toml
    sed -i -e "s|chain-id = \".*\"|chain-id = \"structstestnet-102\"|g" $HOME/.structs/config/client.toml

    Enable Indexing usually enabled by default

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

    Disable Indexing

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

    Reset Chain Data

    structsd tendermint unsafe-reset-all --home $HOME/.structs --keep-addr-book

    Delete Node

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

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