Skip to content

Instantly share code, notes, and snippets.

View elmostake's full-sized avatar

Elmo's Stake Pool elmostake

View GitHub Profile
@elmostake
elmostake / delta2.sh
Last active December 24, 2019 15:08
Function for getting the delta between your lastBlockCount and the one from the Shelley Explorer (add to .bash_profile)
# Note that it seems like the explorer is load balanced across multiple nodes, as sometimes a call will show that
# you are ahead by a few blocks, but an immediate subsequent call will show you are in sync.
# Add this to your .bash_profile
function delta2() {
# Kudos to @pheelLikeWater for original version of this!
lastBlockHash=`stats | head -n 6 | tail -n 1 | awk '{print $2}'`
lastBlockCount=`stats | head -n 7 | tail -n 1 | awk '{print $2}' | tr -d \"`
shelleyExplorerJson=`curl -X POST -H "Content-Type: application/json" --data '{"query":" query { allBlocks (last: 1) { pageInfo { hasNextPage hasPreviousPage startCursor endCursor } totalCount edges { node { id date { slot epoch { id firstBlock { id } lastBlock { id } totalBlocks } } transactions { totalCount edges { node { id block { id date { slot epoch { id firstBlock { id } lastBlock { id }