Skip to content

Instantly share code, notes, and snippets.

@spuder
Created Aug 24, 2021
Embed
What would you like to do?
Helium Miner status
export ANIMAL=angry-purple-tiger #replace with your miner
hotspot=$(curl -s https://api.helium.io/v1/hotspots/name/${ANIMAL})
# TODO: error if result != 1
miner_height=$(echo $hotspot | jq -r '.data[].status.height')
chain_height=$(echo $hotspot | jq -r '.data[].block')
percentage=$(bc <<<"scale=6; $miner_height / $chain_height")
echo "=== ${ANIMAL} ==="
echo miner_height = ${miner_height}
echo chain_height = ${chain_height}
echo lag = $((${chain_height}-${miner_height}))
echo percentage = ${percentage}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment