The Best Way Using RPC calls to confirm beacon and shard heights from mainnet

Looking over some older posts, I am wondering about the best source/way to pull in the current beacon and shard block heights (to compare with my internal vnode data).

You can use this: https://github.com/incognitochain/incognito-chain/tree/production/rpcserver to query each vNode’s RPC port.

i use this script to compare my local node with official fullnode:

$ cat lgetblockinfo.sh 

echo "local ------------------------------------------------"
curl -s --header "Content-Type: application/json" \
  --request POST \
--data '{"id":1,"jsonrpc":"1.0","method":"getblockchaininfo","params":[]}' \
http://127.0.0.1:9334 | grep "Height"

echo "mainnet-fullnode -------------------------------------"
curl -s --header "Content-Type: application/json" \
  --request POST \
--compressed --data '{"id":1,"jsonrpc":"1.0","method":"getblockchaininfo","params":[]}' \
https://mainnet.incognito.org/fullnode | grep "Height"


output from beacon to shard 1 - 7:

$ bash lgetblockinfo.sh 
local ------------------------------------------------
				"Height": 3228621,
				"Height": 3199613,
				"Height": 3204549,
				"Height": 3201947,
				"Height": 2610012,
				"Height": 3202334,
				"Height": 3201756,
				"Height": 2674703,
				"Height": 3198043,
mainnet-fullnode -------------------------------------
				"Height": 3228622,
				"Height": 3199613,
				"Height": 3204549,
				"Height": 3201947,
				"Height": 3181728,
				"Height": 3202334,
				"Height": 3201756,
				"Height": 3204124,
				"Height": 3198043,

1 Like

Thanks.