0

I have seen no concrete answer to this question anywhere. I assume it is possible to get the total number of successful transactions on the bitcoin network using bitcoin-cli command because most explorers provide this information. How can i get this information from a fully synced node?

3

I'm reasonably sure this is not exposed by the RPC API.

You could parse debug.log and look for lines like:

2019-08-20T12:17:58Z UpdateTip: new best=0000000000000000000e6c402b311740e21f79a42ed84ecf69a3ae4fe88ce882 height=590956 version=0x20000000 log2_work=90.9855 tx=446914655 date='2019-08-20T12:17:55Z' progress=1.000000 cache=277.1MiB(321228txo)

Where tx=num gives the total transaction count. I reckon that most explorers maintain a separate database of the transactions, and simply run a query against that instead of pulling data like this from a node or log.

3

Another possibility is to use the getblockstats command to get the number of transactions (not including the coinbase transaction) for a specific block (by height/hash). E.g.

$ getblockstats 500000 '["txs"]'

{
  "txs": 2701
}

Then, iterate through all of the blocks to get the total for all blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.