Skip to main content

CLI Cheatsheet

Chain ID: axone-dentrite-1 | Current Node Version: v10.0.0

This cheatsheet collects commonly used CLI commands for node operators to easily copy and paste. A few conventions we follow:

  • Capitalized words indicate placeholders
  • Always use our own [NODERS]TEAM RPC endpoints
  • Always specify --chain-id and --node flags even when they are unnecessary
  • Query CLI command always uses --output json flag and pipes result through jq

Wallet generate and recover

Add new key

axoned keys add KEY

Recover key (via existing mnemonic)

axoned keys add KEY --recover

List all keys

axoned keys list

Delete key

axoned keys delete KEY

Wallet

Wallet balance

axoned q bank balances $(axoned keys show KEY -a) --node https://axone-t-rpc.noders.services:443

Send

axoned tx bank send YOUR_KEY RECEIVER_ADDRESS 1000000uaxone \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Withdraw rewards from all validators

axoned tx distribution withdraw-all-rewards \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Withdraw Rewards including Commission

axoned tx distribution withdraw-rewards VALIDATOR_ADRESS \
--commission \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Delegate tokens to yourself

axoned tx staking delegate $(axoned keys show KEY --bech val -a) 1000000uaxone \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Delegate tokens to validator

axoned tx staking delegate VALIDATOR_ADDRESS 1000000uaxone \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Redelegate tokens to another validator

axoned tx staking redelegate $(axoned keys show KEY --bech val -a) VALIDATOR_ADDRESS 1000000uaxone \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Unbond tokens from your validator

axoned tx staking unbond $(axoned keys show KEY --bech val -a) uaxone \
--chain-id andromeda-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Governance

List of all proposals

axoned query gov proposals --node https://axone-t-rpc.noders.services:443

Check vote

axoned query gov proposal PROPOSAL_NUMBER \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--output json | jq

Vote

Vote options:

  • yes
  • no
  • no_with_veto
  • abstain
axoned tx gov vote PROPOSAL_NUMBER VOTE_OPTION \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Validator management

Create Validator

note

We use example filed values instead of capitalized dummy words for demo purpose in this command. Please make sure to adjust accordingly for your use.

axoned tx staking create-validator \
--amount 1000000uaxone \
--commission-max-change-rate "0.05" \
--commission-max-rate "0.10" \
--commission-rate "0.05" \
--min-self-delegation "1" \
--pubkey=$(axoned tendermint show-validator) \
--moniker '[NODERS]TEAM SERVICE' \
--website "https://noders.team" \
--identity "220491ADDD660741" \
--details "Trusted blockchain validator and web3 developer team" \
--security-contact="office@noders.team" \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Edit validator

axoned tx staking edit-validator \
--new-moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id axone-dentrite-1 \
--commission-rate 0.05 \
--from KEY \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \

Unjail

axoned tx slashing unjail \
--chain-id axone-dentrite-1 \
--node https://axone-t-rpc.noders.services:443 --fees 3000uaxone \
--from KEY

Jail reason

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

Validator details

axoned q staking validator $(axoned keys show KEY --bech val -a)

Maintenance

Get validator info

axoned status 2>&1 | jq .ValidatorInfo

Get sync info

axoned status 2>&1 | jq .SyncInfo

Get node peer

echo $(axoned tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat ~/.axoned/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Check if validator key is correct

[[ $(axoned q staking validator $(axoned keys show KEY --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(axoned status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"

Get live peers

curl -sS https://axone-t-rpc.noders.services:443/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'

Set minimum gas price

sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.001uaxone\"/" ~/.axoned/config/app.toml

###Enable prometheus

sed -i -e "s/prometheus = false/prometheus = true/" ~/.axoned/config/config.toml

Reset chain data

axoned tendermint unsafe-reset-all --keep-addr-book --home ~/.axoned

Service Management

Reload service configuration

sudo systemctl daemon-reload

Enable service

sudo systemctl enable axoned

Disable service

sudo systemctl disable axoned

Start service

sudo systemctl start axoned

Stop service

sudo systemctl stop axoned

Restart service

sudo systemctl restart axoned

Check service status

sudo systemctl status axoned

Check service logs

sudo journalctl -u axoned -f --no-hostname -o cat

Remove node

cd $HOME
sudo systemctl stop axoned
sudo systemctl disable axoned
sudo rm /etc/systemd/system/axone.service
sudo systemctl daemon-reload
rm -f $(which axoned)
rm -rf ~/.axoned
rm -rf $HOME/axone-protocol