-
Notifications
You must be signed in to change notification settings - Fork 233
RPC cookbook
curl -sd '{"jsonrpc":"2.0","method":"get_v1_node_peers","params":[["connected"]],"id":1}' -H 'Content-Type: application/json' localhost:9190 | jq -r '.result[] | .agent' | cut -d'/' -f1 | sort | uniq -c | sort -n
1 Lighthouse
4 nimbus
68 teku
87 Prysm
curl -sd '{"jsonrpc":"2.0","method":"peers","params":[],"id":1}' -H 'Content-Type: application/json' localhost:9190 | jq -r '.result.peers[].info | [.agentVersion,.addrs] | flatten | join(" ")' | grep '^\S\+ \S\+$' | grep -E '/127\.|/10\.|/0\.|/192\.168\.'
https://en.wikipedia.org/wiki/Reserved_IP_addresses
Prysm/v1.0.3/fc7c6776f66c675dfc0e26a9f16141720bf9f2df /ip4/192.168.219.106/tcp/13000
teku/teku/v20.11.1/linux-x86_64/-ubuntu-openjdk64bitservervm-java-11 /ip4/127.0.1.1/tcp/9000/p2p/16Uiu2HAmL2epufGxLKgymWvkaSvHsZrpQFwci2dzfEMW8T1c3tcF
Prysm/v1.0.2/b150acffca3d93e8cf1f404ff7e4602391017186 /ip4/10.0.2.100/tcp/13000
teku/teku/v20.11.1/linux-x86_64/-ubuntu-openjdk64bitservervm-java-11 /ip4/127.0.1.1/tcp/9000/p2p/16Uiu2HAm6fLmHr3MvUHVhRbew7qD7W34CMoCLowakRRAqLVSyhex
curl -sd '{"jsonrpc":"2.0","method":"get_v1_debug_beacon_states_stateId","params":["genesis"],"id":1}' -H 'Content-Type: application/json' localhost:9190 | jq -r '.result' | less
curl -sd '{"jsonrpc":"2.0","method":"peers","params":[],"id":1}' -H 'Content-Type: application/json' localhost:9190 | jq -r '.result' | less
curl -sd '{"jsonrpc":"2.0","method":"get_v1_debug_beacon_states_stateId","params":["head"],"id":1}' -H 'Content-Type: application/json' localhost:9190 | jq '.result | [[{"balance":.balances.data[]}], .validators.data] | transpose | map(add) | map({(.pubkey): .}) | add | del(.[].pubkey)'
Only works after a special define: make -j8 NIMFLAGS="-d:chronosFutureTracking" nimbus_beacon_node
curl -sd '{"jsonrpc":"2.0","method":"debug_getChronosFutures","params":[],"id":1}' -H 'Content-Type: application/json' localhost:9190 | jq '.result[]' | grep state | sort | uniq -c