ChainTools
Search
K
Comment on page

Handy commands

Global consensus state

curl http://localhost:26657/consensus_state | jq '.result.round_state.height_vote_set[0].prevotes_bit_array'

Check to see if chain is sync

curl -s http://localhost:26657/status | jq '.result.sync_info.catching_up'

Set pruning on node

sed -i 's/^pruning = .*/pruning = "custom"/; s/^pruning-keep-recent = .*/pruning-keep-recent = "100"/; s/^pruning-keep-every = .*/pruning-keep-every = "0"/; s/^pruning-interval = .*/pruning-interval = "10"/' /home/juno/.juno/config/app.toml

Validator pre-voting status

curl -s http://localhost:26657/dump_consensus_state | jq '.result.round_state.votes[0].prevotes' | grep $(curl -s http://localhost:26657/status | jq -r '.result.validator_info.address[:12]')

Validator list

gaiad q staking validators --node http://localhost:26657 -o json --limit=1000 | jq '.validators[]' | jq -r '.tokens + " - " + .status + " - " + .description.moniker + " - " + .operator_address' | sort -gr | nl

Number of connected peers

curl -s http://127.0.0.1:26677/metrics | grep '^tendermint_p2p_peers'

Number of peers

curl -s 127.0.0.1:26657/net_info | grep n_peers

Validator voting power

curl -s localhost:26657/status | jq .result.validator_info.voting_power

Peer list

curl -s http://127.0.0.1:26657/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr | split(":")[2])"' | paste -sd,

Check Chain ID via REST API

curl --location --request GET 'https://NODE_IP/node_info' -s | jq '.node_info.network' | tr -d '"'

Download Genesis from RPC

curl https://NODE_IP/genesis | jq '.result.genesis' > genesis.json

Storage

du /home/folder/