-
-
Save lucasmoten/fcf6c06ad06ac70cb30a955f232dbc16 to your computer and use it in GitHub Desktop.
Print a taproot signalling block diagram
This file contains 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
#!/bin/bash | |
BLOCKCHAININFO=`bitcoin-cli getblockchaininfo` | |
TAPROOT=`echo $BLOCKCHAININFO | jq .softforks.taproot.bip8` | |
SINCE=`echo $TAPROOT | jq .since` | |
ELAPSED=`echo $TAPROOT | jq .statistics.elapsed` | |
color_green='\033[0;32m' | |
color_red='\033[0;31m' | |
for BLOCK in $(seq $SINCE $((SINCE + ELAPSED - 1))); do | |
HASH=`bitcoin-cli getblockhash $BLOCK` | |
HEADER=`bitcoin-cli getblockheader $HASH` | |
VERSION=`echo $HEADER | jq .version` | |
SIGNAL=$(((VERSION & 4) == 4)) | |
case $SIGNAL in | |
(1) printf "${color_green}T";; | |
(0) printf "${color_red}_";; | |
esac | |
if (( ($BLOCK + 1) % 72 == 0 )); then printf "\n"; fi | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment