Skip to content

Instantly share code, notes, and snippets.

@pox
Last active May 2, 2021 16:08
Show Gist options
  • Save pox/12f5c575e53ca81c1c0a5f75c4f49284 to your computer and use it in GitHub Desktop.
Save pox/12f5c575e53ca81c1c0a5f75c4f49284 to your computer and use it in GitHub Desktop.
Update BlockClock Mini with Taproot Activation Progress
#!/bin/bash -eu
set -o pipefail
# This script requires jq & curl (and bitcoin-cli of course).
# Set the correct hostname for your blockblock below:
export BLOCKCLOCK_HOSTNAME="192.168.1.175"
export SIGNALLING_PC="$(bitcoin-cli getblockchaininfo | jq -r '.softforks.taproot.bip9.statistics | 1000 * (.count / .elapsed) | round/10')"
export URL="http://$BLOCKCLOCK_HOSTNAME/api/show/number/$SIGNALLING_PC?sym=%25&br=Blocks%20Signalling%20Taproot"
curl "$URL"
# Add this line to your crontab (`crontab -e`) with the correct path to the above script to update every 10 minutes.
*/10 * * * * PATH=$PATH:/usr/bin:/usr/local/bin /home/bitcoin/blockclock_taproot.sh 2>&1 | logger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment