# on receiving block 871303 here
$ date -u '+%Y-%m-%dT%H:%M:%SZ'
2024-11-21T06:41:43Z
# as written in the block header
2024-11-21T06:41:26Z

$ uptime   # since last reboot
 06:41:43 up 108 days, 23:59,  0 users,  load average: 0.37, 0.38, 0.34

$ battery.sh
95%, Power Supply Online

$ uname -smnr
Linux singer 6.6.37-0-lts x86_64

$ grep ^MemAvailable /proc/meminfo
MemAvailable:    1501364 kB

$ du -h -d1 .bitcoin/
2.2G	.bitcoin/testnet4
10.7G	.bitcoin/indexes
3.2G	.bitcoin/signet
33.6M	.bitcoin/wallets
97.7G	.bitcoin/blocks
11.9G	.bitcoin/chainstate
15.3G	.bitcoin/testnet3
141.1G	.bitcoin/

$ df -h .
Filesystem                Size      Used Available Use% Mounted on
/dev/sda3               911.4G    807.3G    103.1G  89% /

$ bitcoind --version
Bitcoin Core version v28.99.0-4835bba2cb13
Copyright (C) 2009-2024 The Bitcoin Core developers

Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.

This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/licenses/MIT>

$ BC=$(bitcoin-cli getblockcount); echo $BC
871303

$ BH=$(bitcoin-cli getblockhash 871303); echo $BH
000000000000000000017c688291f2467e5e07c14fb7f978392e441bd04de0e9

$ bitcoin-cli getblockheader $BH
{
  "hash": "0000000000000000000177e5df18154411cf2f9ea4fa4e3f7fbbed9b6fc75e0d",
  "confirmations": 1,
  "height": 855601,
  "version": 537083904,
  "versionHex": "20034000",
  "merkleroot": "1f3f3c3fc7b44de7c79df750712a334ea83dbb10dd47c57a789d6dd049b432c8",
  "time": 1722919934,
  "mediantime": 1722917249,
  "nonce": 2205577874,
  "bits": "17031abe",
  "difficulty": 90666502495565.78,
  "chainwork": "0000000000000000000000000000000000000000876c314d1b2244b4226cab8c",
  "nTx": 1,
  "previousblockhash": "00000000000000000001187df2cd86998c727058ce11aa92b2fc97abb7816728"
}

$ echo $BH | tr 0 . | fold -w 4 | paste -d " " - - - -
.... .... .... ....
...1 7c68 8291 f246
7e5e .7c1 4fb7 f978
392e 441b d.4d e.e9

$ : Following was the shortform
$ : from which shortkode came
$ last=${BH: -4}
$ a=$(echo $BH | cut -b-60 \
  | fold -w 4 \
  | grep -Ev '^(0000|[^0]{4})$')
$ R=$(echo $a $last | cut -b-20)
$ printf "%s sf: " $BC
$ { echo $R | grep "$last$" \
  || echo $R M; } | tr "0\n" ". "
  echo
871303 sf: ...1 .7c1 d.4d e.e9 

$ : Following is the shortkode
$ last=${BH#${BH%????}}
$ nz=$(echo $BH | fold -w 4 \
  | grep -cE '^[^0]{4}$')
$ z=$(echo $BH | fold -w 4 \
  | grep -c '^0000$')
$ printf "%s sk: " $BC
$ printf "%s %x" $last \
  $(((${nz}<<4)+${z})) \
  | tr "0\n" ". "; echo
871303 sk: e.e9 84

$ niceblack.sh $BH $BC
         _    _         _   
        | |__| |___  __| |__
        | '_ \ / _ \/ _| / /
        |_.__/_\___/\__|_\_\

       ___ ____ _ ____ __ ____
      ( _ )__  / |__ //  \__ /
      / _ \ / /| ||_ \ () |_ \
      \___//_/ |_|___/\__/___/

  ,---   .123 4567 89ab cdef   ---,
  | ..   .... .... .... ....   .f |
  | 1.   ...1 7c68 8291 f246   1f |
  | 2.   7e5e .7c1 4fb7 f978   2f |
  | 3.   392e 441b d.4d e.e9   3f |
  '===   ==== ==== ==== ====   ==='
   sk:   e.e9 84

$ bitcoin-cli getmempoolinfo
{
  "loaded": true,
  "size": 73965,
  "bytes": 44454473,
  "usage": 244458176,
  "total_fee": 0.64054514,
  "maxmempool": 300000000,
  "mempoolminfee": 0.00001000,
  "minrelaytxfee": 0.00001000,
  "incrementalrelayfee": 0.00001000,
  "unbroadcastcount": 0,
  "fullrbf": true
}

## Current epoch estimation is +1.64%
## 391 of 2016, i.e. 19%, 1625 to go
## Current and previous two in numbers:
$ bitcoin-cli getnetworkhashps 2016
7.439608515604278e+20
$ bitcoin-cli getnetworkhashps 2016 870911
7.319322521948825e+20
$ bitcoin-cli getnetworkhashps 2016 868895
7.275582664903283e+20

$ bitcoin-cli gettxoutsetinfo muhash
{
  "height": 871303,
  "bestblock": "000000000000000000017c688291f2467e5e07c14fb7f978392e441bd04de0e9",
  "txouts": 186367924,
  "bogosize": 14437708408,
  "muhash": "91073d1f92b771807a8e7135473d65ada670e640c9f68a6d0bd02365126a97c1",
  "total_amount": 19785105.48822506,
  "total_unspendable_amount": 219.51177494,
  "block_info": {
    "prevout_spent": 3829.98269827,
    "coinbase": 3.23310485,
    "new_outputs_ex_coinbase": 3829.87459341,
    "unspendable": 0.00000001,
    "unspendables": {
      "genesis_block": 0.00000000,
      "bip30": 0.00000000,
      "scripts": 0.00000001,
      "unclaimed_rewards": 0.00000000
    }
  }
}

$ bitcoin-cli getblockstats 871303
{
  "avgfee": 2776,
  "avgfeerate": 10,
  "avgtxsize": 367,
  "blockhash": "000000000000000000017c688291f2467e5e07c14fb7f978392e441bd04de0e9",
  "feerate_percentiles": [
    3,
    4,
    5,
    8,
    26
  ],
  "height": 871303,
  "ins": 7788,
  "maxfee": 687767,
  "maxfeerate": 469,
  "maxtxsize": 67915,
  "medianfee": 559,
  "mediantime": 1732169911,
  "mediantxsize": 192,
  "minfee": 186,
  "minfeerate": 1,
  "mintxsize": 150,
  "outs": 8552,
  "subsidy": 312500000,
  "swtotal_size": 1180681,
  "swtotal_weight": 2983018,
  "swtxs": 3751,
  "time": 1732171286,
  "total_out": 382987459342,
  "total_size": 1432916,
  "total_weight": 3991958,
  "totalfee": 10810485,
  "txs": 3895,
  "utxo_increase": 764,
  "utxo_size_inc": 30072,
  "utxo_increase_actual": -1507,
  "utxo_size_inc_actual": -108314
}

$ bitcoin-cli getnettotals
{
  "totalbytesrecv": 6733638914,
  "totalbytessent": 5715831477,
  "timemillis": 1732171304144,
  "uploadtarget": {
    "timeframe": 86400,
    "target": 0,
    "target_reached": false,
    "serve_historical_blocks": true,
    "bytes_left_in_cycle": 0,
    "time_left_in_cycle": 0
  }
}

$ bitcoin-cli -netinfo
Bitcoin Core client v28.99.0-4835bba2cb13 - server 70016/Satoshi:28.99.0/

         ipv4     npr   total   block  manual
in         50       1      51
out        11       0      11       2       1
total      61       1      62

Local addresses: n/a


$ bitcoin-cli -addrinfo
{
  "addresses_known": {
    "ipv4": 52427,
    "ipv6": 0,
    "onion": 13508,
    "i2p": 0,
    "cjdns": 0,
    "total": 65935
  }
}

$ halving.sh 871303
=====================================
  Bitcoin Block Halving prediction
=====================================

bc=871303
gbt=1231006505
bbt=1732171286

This is average time to mine a block
(1732171286-1231006505)/871303
bts=575.1893495266864377989771

Now let's multiply that by 1050000
which is the block number of next
halving and get the prediction:
Wed Feb 23 21:58:17 UTC 2028

-------------------------------------
Next palindrome will be 872278
predicted to happen at this time:
Wed Nov 27 18:28:15 UTC 2024

-------------------------------------
Current mining epoch number is 432.
The next fortnight happens in block
872928 and probably around this time:
Mon Dec  2 02:19:28 UTC 2024

### v2_peerinfo are in v2_peerinfo-bitcoin.txt
$ bitcoin-cli getpeerinfo | grep -w 'v2' | uniq -c
     17     "transport_protocol_type": "v2",

$ bitcoin-cli getpeerinfo \
    | jq -r '.[]
      | select ( .transport_protocol_type == "v2" )
      | .addr + " " + .session_id' \
    | while read addr sid
      do
        a=$(echo ${addr%\]*} | tr -d '\[' | md5sum | cut -b-16);
        printf "%s\n\t%s\n" "$a" "$sid"
      done

7d3488815f08fe4d
	39453aa00021616620c8ee27de86d60609c8339f3f58322e5e916b6437265513
a01dd372a17e22af
	16a015a29130f71f66db488b6fe22b484d62b6e82ccd2966f03454689e977301
ea0d828b6840a58c
	12625926b6bc11d3c6e0230fab63fe0a5ed919c06671e7c43dc6f84aff881f60
27fb0220961d2c4c
	4d0027e3aaccf06009cd7ee59b217ffb874e5cee9d163208e51880358374c62b
f714d09729ce6b20
	13e415aedbaeff87198224ffe912331a8ca3b12d487699e97dc3a84da0db8e07
24ff0ef028fe6f5e
	520bd3cc9e951559f67e04d5cb2b908dddcad9de0657becdd0477561443a6460
cd89474ec9938594
	9d81c6a5bddf6c37b62fa3a629f572edad9618b831d2a5e4fc441f385ddeda43
b641a2d54785a0c9
	0bb487291d4450cfa62dfc9e9c5a979962548f08c68d4742b52db1a81a1497ef
a859e666d7a90948
	78d81141ca0e62a3b4d5fee62a21db8871387dd67637d8c9b418191cebd5b46b
fe7bcb6ba8e81065
	f86c93f8473cdaea2da41d2142baa8ba00aceaa5ce855edb3e93f9df022209c2
0028055375a445b6
	134846c7c2ae3c35bb96703ed4f3cc12b3b90583b2a56dff3ac50aecc88d845b
9f002a5fccae1c49
	8e9a135893a6785d2027c4c928589624052dbe0130f6ee626119a3c9c6dfdc9d
76fdeb26c1421dba
	bd6451a919a69aeee5e4f9b5e10a36d347928a304b162be4d2ea5af51aa43c13
f7184249d883a245
	01a3faa09207dbf5c5c4f2cc4d5a09d0625bf996999fbb0f22e7840c7282594b
ecdacfe7ae939546
	3da135bec2299c809a54622510e520b91ff36119acdc5b232fd605e4842ef26e
128530b89e23d131
	89ebf5098b63871b7ac59841c1f2d6b2263ce255a473e7551d6878497e221e56
f4595521a24bc96b
	9ca580ca927e77a5e696ce161a31e4c0a86e164f6a6ab7802e197d29d0a77c42