Cheatsheet

Set variables

Define a custom port prefix for your node.

export PORT_PREF=266

Set your wallet name:

export WALLET=

Set your validator moniker:

export MONIKER=

Set your node folder name:

export FOLDER=".exrpd"

Node Info

Define a custom port prefix for your node.

export PORT_PREF=266

Get full info about node:

exrpd status -n tcp://localhost:${PORT_PREF}57 | jq

Check the current status of your node:

exrpd status -n tcp://localhost:${PORT_PREF}57 | jq -r '.sync_info | {catching_up, latest_block_height, latest_block_time}'

Display your node ID in the format nodeID@ip:port :

echo $(exrpd tendermint show-node-id)'@'$(wget -qO- eth0.me)':'$(cat $HOME/$FOLDER/config/config.toml | sed -n '/Addr>

Display your node ID in the format nodeID@ip:port :

echo $(exrpd tendermint show-node-id)'@'$(wget -qO- eth0.me)':'$(cat $HOME/$FOLDER/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

Key Management

Set your wallet name:

export WALLET=

Add a new key/wallet:

exrpd keys add $WALLET

Restore an existing wallet from seed:

exrpd keys add $WALLET --recover

List all wallets:

exrpd keys list

Delete a wallet:

exrpd keys delete $WALLET

Check wallet balance:

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

View account key:

exrpd keys show $WALLET --bech acc

View validator key (valoper):

exrpd keys show $WALLET --bech val

View public validator key:

exrpd tendermint show-validator

Validator Support Commands

Set your validator moniker:

export MONIKER=

Check your validator info:

exrpd query staking validator $(exrpd keys show $WALLET --bech val -a)

Search validator by moniker in the validators list:

exrpd query staking validators --node "tcp://localhost:${PORT_PREF}57" -o json | jq --arg moniker "$MONIKER" '.validators[] | select(.description.moniker == $moniker)'

View chain staking parameters:

exrpd q staking params

View slashing parameters:

exrpd q slashing params

Check validator slashing status:

exrpd q slashing signing-info $(exrpd keys show $WALLET --bech cons -a)

View active validators:

exrpd q staking validators -o json  | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '.tokens + " - " + .description.moniker' | sort -gr | nl

View inactive validators:

exrpd q staking validators -o json | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '.tokens + " - " + .description.moniker' | sort -gr | nl

Unjail a validator:

exrpd tx slashing unjail --from $WALLET -gas auto --gas-adjustment 1.5  --gas-prices 0.03axrp -y

View prevotes and precommits:

curl -s localhost:$PORT/consensus_state | jq '.result.round_state.height_vote_set[0].prevotes_bit_array' && \
curl -s localhost:$PORT/consensus_state | jq '.result.round_state.height_vote_set[0].precommits_bit_array'

View prevote of your validator:

curl -s localhost:$PORT/consensus_state -s | grep $(curl -s localhost:$PORT/status | jq -r .result.validator_info.address[:12])

Transactions

Withdraw rewards and commission:

exrpd tx distribution withdraw-rewards $(exrpd keys show $WALLET --bech val -a) --commission -y --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03axrp -y

Delegate 1 coin to yourself:

exrpd tx staking delegate $(exrpd keys show $WALLET --bech val -a) 1000000axrp --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03axrp -y

Delegate 1 coin to another validator:

exrpd tx staking delegate <VALOPER_ADDRESS> 1000000axrp --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03axrp -y 

Undelegate 1 coin:

exrpd tx staking unbond <VALOPER_ADDRESS> 1000000axrp --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03axrp -y

Transfer funds to another wallet:

exrpd tx bank send $WALLET <RECIVER_ADDRESS> 1000000axrp --gas auto --gas-adjustment 1.5 --gas-prices 0.03axrp -y

Governance

List proposals:

exrpd q gov proposals

Check votes:

exrpd q gov proposal --voter $(exrpd keys show $WALLET --bech acc -a)

Vote YES on proposal #1:

exrpd tx gov vote 1 yes --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03axrp -y

RPC Status

View RPC port:

echo -e "\033[0;32m$(grep -A 3 "\[rpc\]" $HOME/$FOLDER/config/config.toml | egrep -o ":[0-9]+")\033[0m"

Set your RPC port:

PORT=

View number of connected peers:

curl -s http://localhost:$PORT/net_info | jq '.result.peers | length'

View peers monikers:

curl -s http://localhost:$PORT/net_info | jq '.result.peers[].node_info.moniker'

View peers list as node_id@ip:port:

curl -s http://localhost:$PORT/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr | capture("(?<port>\\d+)$").port)"'