Bitcoin CLI tooltips and hacks retweeted
bitcoin-cli getblock $(bitcoin-cli getblockhash 666666) 0 | xxd -r -p | fq -d bitcoin_block '.transactions[] | .outputs[] | select(.scriptpub[0].op == "return") | .scriptpub[1].arg'
Bitcoin CLI tooltips and hacks retweeted
$ bitcoin-cli getblock $(bitcoin-cli getblockhash 0) 2 | jq .tx[0].hex | xxd -r -p | strings | head -n 1
EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks
Happy Birthday #Bitcoin 🥳
Bitcoin CLI tooltips and hacks retweeted
bitcoin-cli getblock $(bitcoin-cli getblockhash 0) 0 | xxd -r -p | xxd
This quoted post is unavailable.
Bitcoin CLI tooltips and hacks retweeted
$ bitcoin-cli getblockchaininfo | jq .softforks.taproot.bip9.status
"active"
Bitcoin CLI tooltips and hacks retweeted
Replying to @pwuille
$ date -d "+$(bitcoin-cli getblockchaininfo | jq '.softforks.taproot.bip9.min_activation_height - .blocks')0 minutes" -uR
Wed, 17 Nov 2021 13:31:05 +0000
Bitcoin CLI tooltips and hacks retweeted
Finding missed opportunities in lnd.log:
zgrep "insufficient bandwidth to route htlc" ~/.lnd/logs/bitcoin/mainnet/lnd.log* | grep "ChannelLink" | cut -d' ' -f5,11 | awk 'BEGIN { FS=OFS=SUBSEP=" "}{arr[$1]+=$2 }END {for (i in arr) print i,arr[i]}' | sort -n -t' ' -k2 -r
Bitcoin CLI tooltips and hacks retweeted
Replying to @zndtoshi
if you’re on linux, use it with “watch” for the live experience
watch -t bitcoin-cli -netinfo 4
and for more info, run
bitcoin-cli -netinfo help
# aggragate mempool fees
bitcoin-cli getrawmempool true | fx "Object.keys(this).map(
(e,i,a)=>this[e].fee)
.reduce((a, v)=> a+v)"
Bitcoin CLI tooltips and hacks retweeted
list of all the config options
./src/bitcoind -help or ./src/bitcoind -?
list of all the RPCs
./src/bitcoin-cli help
detailed help for an RPC
./src/bitcoin-cli help (rpc call name)
./src/bitcoin-cli help getaddressinfo
Bitcoin CLI tooltips and hacks retweeted
Bashified the coarse difficulty adjustment estimation.
I'm still not sure if this is a reasonable correct way of estimating an upcoming difficulty adjustment.
# % sync'd
prog() {
local w=80 p=$1; shift
printf -v dots "%*s" "$(( $p*$w/100 ))" ""; dots=${dots// /.}
printf "\r\e[K|%-*s| %3d %% %s" "$w" "$dots" "$p" "$*"
}
while : ; do
prog $(bitcoin-cli getblockchaininfo | jq '.verificationprogress * 100|floor')
sleep 10
done ; echo
Bitcoin CLI tooltips and hacks retweeted
Replying to @ajtowns @murchandamus
Oh, commands to get this data:
$ ./bitcoin-cli getpeerinfo | grep subver | sort | uniq -c | sort -n
$ tail -n5000000 ~/.bitcoin/debug.log | sed -n 's/.*receive version message: //p;' | sed 's/ version [0-9]*, blocks=.*//' | sort | uniq -c | sort -n
(2nd requires -debug=net)
Bitcoin CLI tooltips and hacks retweeted
admin@mynode:~$ bitcoin-cli getnetworkinfo
{
"version": 210100,
"subversion": "/Satoshi:0.21.1/"
Upgrade your #bitcoin node
Pass it on.
Bitcoin CLI tooltips and hacks retweeted
Replying to @JohnOnChain
bitcoin-cli getpeerinfo | jq -r .[].subver | sort
Bitcoin CLI tooltips and hacks retweeted
echo $(bitcoin-cli decoderawtransaction $(bitcoin-cli getrawtransaction $(bitcoin-cli getblock $(bitcoin-cli getblockhash 681629) | jq -r '.tx[0]')) | jq -r '.vin[0].coinbase' | xxd -r -p)
Bitcoin CLI tooltips and hacks retweeted
$ bitcoin-cli getblockchaininfo | jq .softforks.taproot.bip9.statistics.count
69
Nice.

















