Last active
November 24, 2016 04:11
-
-
Save rustyrussell/25815d53f9174b248c46351e11b2e6f5 to your computer and use it in GitHub Desktop.
What I'm watching right now... #bitcoin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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