Skip to content
All services

Mainnet

BitBadges

Chain ID
Version
Go

Run these after the install guide, which sets $WALLET, $MONIKER and the chain variables.

Keys and wallet

  1. Add a new key

    bitbadgeschaind keys add $WALLET
  2. Recover a key

    bitbadgeschaind keys add $WALLET --recover
  3. List keys

    bitbadgeschaind keys list
  4. Wallet balance

    bitbadgeschaind q bank balances $(bitbadgeschaind keys show $WALLET -a)

Validator

  1. Create a validator

    cat > $HOME/validator.json << EOF
    {
      "pubkey": $(bitbadgeschaind comet show-validator),
      "amount": "1000000000ubadge",
      "moniker": "$MONIKER",
      "identity": "",
      "website": "",
      "security": "",
      "details": "",
      "commission-rate": "0.05",
      "commission-max-rate": "0.20",
      "commission-max-change-rate": "0.05",
      "min-self-delegation": "1"
    }
    EOF
    bitbadgeschaind tx staking create-validator $HOME/validator.json --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  2. Edit the validator

    bitbadgeschaind tx staking edit-validator --new-moniker "$MONIKER" --identity "" --website "" --details "" --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  3. Unjail

    bitbadgeschaind tx slashing unjail --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  4. Validator details

    bitbadgeschaind q staking validator $(bitbadgeschaind keys show $WALLET --bech val -a)

Tokens

  1. Withdraw all rewards

    bitbadgeschaind tx distribution withdraw-all-rewards --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  2. Withdraw commission and rewards

    bitbadgeschaind tx distribution withdraw-rewards $(bitbadgeschaind keys show $WALLET --bech val -a) --commission --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  3. Delegate to yourself

    bitbadgeschaind tx staking delegate $(bitbadgeschaind keys show $WALLET --bech val -a) 1000000000ubadge --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  4. Redelegate

    bitbadgeschaind tx staking redelegate $(bitbadgeschaind keys show $WALLET --bech val -a) <TO_VALOPER> 1000000000ubadge --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  5. Unbond

    bitbadgeschaind tx staking unbond $(bitbadgeschaind keys show $WALLET --bech val -a) 1000000000ubadge --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
  6. Send tokens

    bitbadgeschaind tx bank send $WALLET <TO_ADDRESS> 1000000000ubadge --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y

Governance

  1. List proposals

    bitbadgeschaind q gov proposals
  2. View a proposal

    bitbadgeschaind q gov proposal <ID>
  3. Vote

    bitbadgeschaind tx gov vote <ID> yes --from $WALLET --chain-id $BADGE_CHAIN_ID --gas auto --gas-adjustment 1.5 --gas-prices 0.00025ubadge -y
    # yes | no | abstain | no_with_veto

Maintenance

  1. Node status

    bitbadgeschaind status 2>&1 | jq
  2. Node peer address

    echo $(bitbadgeschaind comet show-node-id)@$(wget -qO- eth0.me):$BADGE_PORT656
  3. Live peers

    curl -s localhost:$BADGE_PORT657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr | split(":") | last)"' | paste -sd,
  4. Check the validator key

    [[ $(bitbadgeschaind q staking validator $(bitbadgeschaind keys show $WALLET --bech val -a) -o json | jq -r .validator.consensus_pubkey.value) = $(bitbadgeschaind comet show-validator | jq -r .key) ]] && echo "match" || echo "MISMATCH"
  5. Reset chain data

    bitbadgeschaind comet unsafe-reset-all --keep-addr-book --home $HOME/.bitbadgeschain
  6. Remove the node

    sudo systemctl stop bitbadgeschaind
    sudo systemctl disable bitbadgeschaind
    sudo rm /etc/systemd/system/bitbadgeschaind.service
    sudo systemctl daemon-reload
    rm -rf $HOME/.bitbadgeschain $(which bitbadgeschaind)

Service

  1. Service status

    sudo systemctl status bitbadgeschaind
  2. Follow logs

    sudo journalctl -fu bitbadgeschaind -o cat
  3. Restart

    sudo systemctl restart bitbadgeschaind
  4. Stop

    sudo systemctl stop bitbadgeschaind
Original guide (GitBook)