Stable Node Cheatsheet
Set variables
Define a custom port prefix for your node or leave it default:
Set your wallet name:
export WALLET=
Set your validator moniker:
export MONIKER=
Set your node folder name or leave it default:
export FOLDER=".stable"
View RPC port:
echo -e "\033[0;32m$(grep -A 3 "\[rpc\]" $HOME/$FOLDER/config/config.toml | egrep -o ":[0-9]+")\033[0m"
Define a custom port for your node or leave it default:
export PORT=26657
Node Info
Get full info about node:
stabled status -n tcp://localhost:${PORT} | jq
Check the current status of your node:
stabled status -n tcp://localhost:${PORT} | jq -r '.sync_info | {catching_up, latest_block_height, latest_block_time}'
Display your node ID in the format nodeID@ip:port :
echo $(stabled 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:
stabled keys add $WALLET
Restore an existing wallet from seed:
stabled keys add $WALLET --recover
List all wallets:
stabled keys list
Delete a wallet:
stabled keys delete $WALLET
View account key:
stabled keys show $WALLET --bech acc
View validator key (valoper):
stabled keys show $WALLET --bech val
View public validator key:
stabled tendermint show-validator
Validator Support Commands
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])
RPC Status
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)"'