Skip to content

Instantly share code, notes, and snippets.

@FaceTheWolf
Created February 16, 2021 14:08
Show Gist options
  • Save FaceTheWolf/58dd23e606c4f1b56c457a3248f73c30 to your computer and use it in GitHub Desktop.
Save FaceTheWolf/58dd23e606c4f1b56c457a3248f73c30 to your computer and use it in GitHub Desktop.
Ethermine stats getter
#!/usr/bin/env bash
miner="df2c6f7afc1a58783e15f2ae0118ff039d8a4755"
stats="$(curl -s https://api.ethermine.org/miner/${miner}/currentStats)"
# Using jq to parse json response
# https://github.com/stedolan/jq
printf %.4f $(echo "$float/1.18" | echo $stats | /usr/local/bin/jq ".data.unpaid"/1000000000000000000)
printf "ETH + "
printf %.2f $(echo "$float/1.18" | echo $stats | /usr/local/bin/jq ".data.usdPerMin"*60)
printf "$/h ("
printf $(echo $stats | /usr/local/bin/jq ".data.activeWorkers")
printf ")"
@FaceTheWolf
Copy link
Author

Example output

0.1234ETH + 0.42$/h (5)

That is 0.1234ETH unpaid, at 0.42 USD pr. hour from 5 workers.

See https://ethermine.org/api/miner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment