Router CLI Cheatsheet
Chain ID:
router_9600-1
Current Node Version:
v1.6.0
Useful commands
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 throughjq
Wallet generate and recover
Add new key
routerd keys add KEY
Recover key (via existing mnemonic)
routerd keys add KEY --recover
List all keys
routerd keys list
Delete key
routerd keys delete KEY
Wallet
Wallet balance
routerd q bank balances $(routerd keys show KEY -a) --node https://router-rpc.noders.services:443
Send
routerd tx bank send YOUR_KEY RECEIVER_ADDRESS 1000000route \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Withdraw rewards from all validators
routerd tx distribution withdraw-all-rewards \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Withdraw Rewards including Commission
routerd tx distribution withdraw-rewards VALIDATOR_ADRESS \
--commission \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Delegate tokens to yourself
routerd tx staking delegate $(routerd keys show KEY --bech val -a) 1000000route \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Delegate tokens to validator
routerd tx staking delegate VALIDATOR_ADDRESS 1000000route \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Redelegate tokens to another validator
routerd tx staking redelegate $(routerd keys show KEY --bech val -a) VALIDATOR_ADDRESS 1000000route \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Unbond tokens from your validator
routerd tx staking unbond $(routerd keys show KEY --bech val -a) route \
--chain-id andromeda-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Governance
List of all proposals
routerd query gov proposals --node https://router-rpc.noders.services:443
Check vote
routerd query gov proposal PROPOSAL_NUMBER \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--output json | jq
Vote
Vote options:
- yes
- no
- no_with_veto
- abstain
routerd tx gov vote PROPOSAL_NUMBER VOTE_OPTION \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--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.
routerd tx staking create-validator \
--amount 1000000route \
--commission-max-change-rate "0.05" \
--commission-max-rate "0.10" \
--commission-rate "0.05" \
--min-self-delegation "1" \
--pubkey=$(routerd 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 router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Edit validator
routerd tx staking edit-validator \
--new-moniker "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--chain-id router_9600-1 \
--commission-rate 0.05 \
--from KEY \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
Unjail
routerd tx slashing unjail \
--chain-id router_9600-1 \
--node https://router-rpc.noders.services:443 --fees 100000000000000route \
--from KEY
Jail reason
routerd query slashing signing-info $(routerd tendermint show-validator)
Validator details
routerd q staking validator $(routerd keys show KEY --bech val -a)
Maintenance
Get validator info
routerd status 2>&1 | jq .ValidatorInfo
Get sync info
routerd status 2>&1 | jq .SyncInfo
Get node peer
echo $(routerd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat ~/.routerd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Check if validator key is correct
[[ $(routerd q staking validator $(routerd keys show KEY --bech val -a) -oj | jq -r .consensus_pubkey.key) = $(routerd 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://router-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.001route\"/" ~/.routerd/config/app.toml
###Enable prometheus
sed -i -e "s/prometheus = false/prometheus = true/" ~/.routerd/config/config.toml
Reset chain data
routerd tendermint unsafe-reset-all --keep-addr-book --home ~/.routerd
Service Management
Reload service configuration
sudo systemctl daemon-reload
Enable service
sudo systemctl enable routerd
Disable service
sudo systemctl disable routerd
Start service
sudo systemctl start routerd
Stop service
sudo systemctl stop routerd
Restart service
sudo systemctl restart routerd
Check service status
sudo systemctl status routerd
Check service logs
sudo journalctl -u routerd -f --no-hostname -o cat
Remove node
cd $HOME
sudo systemctl stop routerd
sudo systemctl disable routerd
sudo rm /etc/systemd/system/router.service
sudo systemctl daemon-reload
rm -f $(which routerd)
rm -rf ~/.routerd
rm -rf $HOME/router-protocol