Created
May 3, 2021 17:15
-
-
Save narcelio/34ed527bb429e3740e4d77b4ec902708 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# based on https://gist.github.com/mutatrum/264cfa84af5fc3dc0b107bcb3ba10893 | |
BLOCKCHAININFO=`bitcoin-cli getblockchaininfo` | |
TAPROOT=`echo $BLOCKCHAININFO | jq .softforks.taproot.bip9` | |
SINCE=`echo $TAPROOT | jq .since` | |
ELAPSED=`echo $TAPROOT | jq .statistics.elapsed` | |
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 & 3758096388) == 536870916)) | |
case $SIGNAL in | |
(1) echo -n "$(tput setaf 2)■";; | |
(0) echo -n "$(tput setaf 1)■";; | |
esac | |
done | |
echo -e "\e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment