Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- rpcuser=kek
- rpcpass=kek
- currentblock=$(btcctl --rpcuser=${rpcuser} --rpcpass=${rpcpass} getblockcount)
- peerinfo=$(btcctl --rpcuser=${rpcuser} --rpcpass=${rpcpass} getpeerinfo)
- node=$(echo ${peerinfo} | jq ".[] | select(.syncnode == true)")
- highestblock=$(echo ${node} | jq ".startingheight")
- lastrecv=$(echo ${node} | jq ".lastrecv")
- currentdate=$(date +%s)
- echo "${currentblock} / ${highestblock} offset: $(($currentdate-$lastrecv))"
Add Comment
Please, Sign In to add comment