Skip to main content

CLI Cheatsheet

Chain ID: entrypoint-pubtest-2 | Current Node Version: v1.3.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

entrypointd keys add KEY

Recover key (via existing mnemonic)

entrypointd keys add KEY --recover

List all keys

entrypointd keys list

Delete key

entrypointd keys delete KEY

Wallet

Wallet balance

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

Send

entrypointd tx bank send YOUR_KEY RECEIVER_ADDRESS 1000000uentry \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Withdraw rewards from all validators

entrypointd tx distribution withdraw-all-rewards \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Withdraw Rewards including Commission

entrypointd tx distribution withdraw-rewards VALIDATOR_ADRESS \
--commission \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Delegate tokens to yourself

entrypointd tx staking delegate $(entrypointd keys show KEY --bech val -a) 1000000uentry \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Delegate tokens to validator

entrypointd tx staking delegate VALIDATOR_ADDRESS 1000000uentry \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Redelegate tokens to another validator

entrypointd tx staking redelegate $(entrypointd keys show KEY --bech val -a) VALIDATOR_ADDRESS 1000000uentry \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Unbond tokens from your validator

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

Governance

List of all proposals

entrypointd query gov proposals --node https://entrypoint-t-rpc.noders.services:443

Check vote

entrypointd query gov proposal PROPOSAL_NUMBER \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--output json | jq

Vote

Vote options:

  • yes
  • no
  • no_with_veto
  • abstain
entrypointd tx gov vote PROPOSAL_NUMBER VOTE_OPTION \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--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.

entrypointd tx staking create-validator \
--amount 1000000uentry \
--commission-max-change-rate "0.05" \
--commission-max-rate "0.10" \
--commission-rate "0.05" \
--min-self-delegation "1" \
--pubkey=$(entrypointd 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 entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Edit validator

entrypointd tx staking edit-validator \
--new-moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id entrypoint-pubtest-2 \
--commission-rate 0.05 \
--from KEY \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \

Unjail

entrypointd tx slashing unjail \
--chain-id entrypoint-pubtest-2 \
--node https://entrypoint-t-rpc.noders.services:443 --fees 3000uentry \
--from KEY

Jail reason

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

Validator details

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

Maintenance

Get validator info

entrypointd status 2>&1 | jq .ValidatorInfo

Get sync info

entrypointd status 2>&1 | jq .SyncInfo

Get node peer

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

Check if validator key is correct

[[ $(entrypointd q staking validator $(entrypointd keys show KEY --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(entrypointd 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://entrypoint-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.001uentry\"/" ~/.entrypoint/config/app.toml

###Enable prometheus

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

Reset chain data

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

Service Management

Reload service configuration

sudo systemctl daemon-reload

Enable service

sudo systemctl enable entrypointd

Disable service

sudo systemctl disable entrypointd

Start service

sudo systemctl start entrypointd

Stop service

sudo systemctl stop entrypointd

Restart service

sudo systemctl restart entrypointd

Check service status

sudo systemctl status entrypointd

Check service logs

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

Remove node

cd $HOME
sudo systemctl stop entrypointd
sudo systemctl disable entrypointd
sudo rm /etc/systemd/system/entrypoint.service
sudo systemctl daemon-reload
rm -f $(which entrypointd)
rm -rf ~/.entrypoint
rm -rf $HOME/entrypoint-zone