Bitcoin CLI tooltips and hacks (@BitcoinToolTips) header
Bitcoin CLI tooltips and hacks (@BitcoinToolTips) profile picture

Bitcoin tooltips and hacks

Joined January 2021
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'
1
1
2
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 🥳
1
4
1
22
Bitcoin CLI tooltips and hacks retweeted
bitcoin-cli getblock $(bitcoin-cli getblockhash 0) 0 | xxd -r -p | xxd
This quoted post is unavailable.
1
9
Bitcoin CLI tooltips and hacks retweeted
$ bitcoin-cli getblockchaininfo | jq .softforks.taproot.bip9.status "active"
7
1
30
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
2
2
1
9
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
1
2
1
7
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
1
2
# 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
1
1
7
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.
Estimation of next difficulty adjust, am I doing this correctly? Start: 687456 (mediantime 1623613511) Now: 688792 (mediantime 1624626380) 1336 blocks, average ~758 sec/block. Ratio: 600 / 758 = 0.79 Change estimate: -21%? Or is this oversimplified? (Ignoring first block bug)
1
1
7
# % 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
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)
1
1
1
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
1
1
7
Bitcoin CLI tooltips and hacks retweeted
d=1; for ((i=0; i < $(bitcoin-cli getblockchaininfo | jq .blocks); i += 2016)) do n=$(bitcoin-cli getblock $(bitcoin-cli getblockhash $i) | jq .difficulty); c=$(echo "($n/$d * 100) - 100" | bc -l); echo $i: $c; d=$n; done
1
3
2
13
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)
3
1
10
Bitcoin CLI tooltips and hacks retweeted
$ bitcoin-cli getblockchaininfo | jq .softforks.taproot.bip9.statistics.count 69 Nice.
1
13
Bitcoin CLI tooltips and hacks retweeted
More stupid bitcoin-cli and bash fun. Should be easy enough to change colours.
1
1
4
Bitcoin CLI tooltips and hacks retweeted
With Bitcoin Core 0.21.1: $ bitcoin-cli getblockchaininfo | jq '.softforks.taproot.bip9.statistics | .count / .elapsed * 100' > 2.2556390977443606