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=".lumera"

Node Info

Define a custom port prefix for your node.

export PORT_PREF=266

Get full info about node:

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

Check the current status of your node:

lumerad 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 $(lumerad 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 $(lumerad 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:

lumerad keys add $WALLET

Restore an existing wallet from seed:

lumerad keys add $WALLET --recover

List all wallets:

lumerad keys list

Delete a wallet:

lumerad keys delete $WALLET

Check wallet balance:

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

View account key:

lumerad keys show $WALLET --bech acc

View validator key (valoper):

lumerad keys show $WALLET --bech val

View public validator key:

lumerad tendermint show-validator

Validator Support Commands

Set your validator moniker:

export MONIKER=

Check your validator info:

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

Search validator by moniker in the validators list:

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

View chain staking parameters:

lumerad q staking params

View slashing parameters:

lumerad q slashing params

Check validator slashing status:

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

View active validators:

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

View inactive validators:

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

Unjail a validator:

lumerad tx slashing unjail --from $WALLET -gas auto --gas-adjustment 1.5  --gas-prices 0.03ulume -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:

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

Delegate 1 coin to yourself:

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

Delegate 1 coin to another validator:

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

Undelegate 1 coin:

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

Transfer funds to another wallet:

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

Governance

List proposals:

lumerad q gov proposals

Check votes:

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

Vote YES on proposal #1:

lumerad tx gov vote 1 yes --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03ulume -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)"'