This blog will discuss the method of getting general information and statistics of confirmed transactions via Python-Bitcoinlib v0.9.0.
The first example is going to get the number of transactions in a specific block. For example, we are going to get the number of transactions in the block of 500000.
First, we get the block 500000’s header.
Second, we get the number of transactions of the block.
Third, the source code is named “num_txs.py”
$ python num_txs.py
Block header: CBlock(536870912, lx(0000000000000000007962066dcd6675830883516bcf40047d42740a85eb2919