Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
What I'm watching right now... #bitcoin
# Assumes you've set blockmaxweight=4000000 and blocksizemax=1000000 in bitcoin.conf
# Every 10 seconds, prints out: <blocknum>:<satoshis-in-fees-nextblock>(<fees-in-USD)=<percent-of-subsidy>,
# eg:
# 440303:123401888($911.692)=9%
# 440304:62908635($464.768)=5%
# 440305:63134415($466.436)=5%
# 440305:63317722($467.791)=5%
i=0
while sleep 10; do
if [ $(($i % 360)) = 0 ]; then
RATE=`wget -q -O- http://api.coindesk.com/v1/bpi/currentprice/USD.json | sed 's/.*"rate":"\([0-9.]*\)".*/\1/'`
fi
bitcoin-cli getblocktemplate | awk '/"fee"/ { FEES += $2 } /"height"/ { HEIGHT = $2 } END { print HEIGHT ":" FEES "($" FEES * '$RATE' / 100000000 ")=" int(FEES * 100 / 1250000000) "%" }'
i=$(($i + 1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment