Celestia Consensus Node Cheatsheet
Set variables
Define a custom port prefix for your node or leave it default:
export PORT_PREF=266
Set your wallet name:
export WALLET=
Set your validator moniker:
export MONIKER=
Set your node folder name or leave it default:
export FOLDER=".celestia-app"
Node Info
Define a custom port prefix for your node or leave it default:
export PORT_PREF=266
Get full info about node:
celestia-appd status -n tcp://localhost:${PORT_PREF}57 | jq
Check the current status of your node:
celestia-appd 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 $(celestia-appd 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:
celestia-appd keys add $WALLET
Restore an existing wallet from seed:
celestia-appd keys add $WALLET --recover
List all wallets:
celestia-appd keys list
Delete a wallet:
celestia-appd keys delete $WALLET
Check wallet balance:
celestia-appd q bank balances $(celestia-appd keys show $WALLET -a)
View account key:
celestia-appd keys show $WALLET --bech acc
View validator key (valoper):
celestia-appd keys show $WALLET --bech val
View public validator key:
celestia-appd tendermint show-validator
Validator Support Commands
Set your validator moniker:
export MONIKER=
Check your validator info:
celestia-appd query staking validator $(celestia-appd keys show $WALLET --bech val -a)
Search validator by moniker in the validators list:
celestia-appd query staking validators --node "tcp://localhost:${PORT_PREF}57" -o json | jq --arg moniker "$MONIKER" '.validators[] | select(.description.moniker == $moniker)'
View chain staking parameters:
celestia-appd q staking params
View slashing parameters:
celestia-appd q slashing params
Check validator slashing status:
celestia-appd q slashing signing-info $(celestia-appd keys show $WALLET --bech cons -a)
View active validators:
celestia-appd q staking validators -o json | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '.tokens + " - " + .description.moniker' | sort -gr | nl
View inactive validators:
celestia-appd q staking validators -o json | jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' | jq -r '.tokens + " - " + .description.moniker' | sort -gr | nl
Unjail a validator:
celestia-appd tx slashing unjail --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -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:26657/status | jq -r .result.validator_info.address[:12])
Transactions
Withdraw rewards and commission:
celestia-appd tx distribution withdraw-rewards $(celestia-appd keys show $WALLET --bech val -a) --commission -y --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -y
Delegate 1 coin to yourself:
celestia-appd tx staking delegate $(celestia-appd keys show $WALLET --bech val -a) 1000000utia --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -y
Delegate 1 coin to another validator:
celestia-appd tx staking delegate <VALOPER_ADDRESS> 1000000utia --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -y
Undelegate 1 coin:
celestia-appd tx staking unbond <VALOPER_ADDRESS> 1000000utia --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -y
Transfer funds to another wallet:
celestia-appd tx bank send $WALLET <RECIVER_ADDRESS> 1000000utia --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -y
Governance
List proposals:
celestia-appd q gov proposals
Check votes:
celestia-appd q gov proposal --voter $(celestia-appd keys show $WALLET --bech acc -a)
Vote YES on proposal #1:
celestia-appd tx gov vote 1 yes --from $WALLET --gas auto --gas-adjustment 1.5 --gas-prices 0.03utia -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)"'