0

I am trying to scan all the bitcoin data on my workstation with java to get some high level statistic data.

I parsed all the transactions with bitcoinJ, but I encountered a problem, the Transaction input only has transaction hash and index, which means I need to maintain all the unspent uxtos.

This task seems challenge to me, I have tested the SQLite and memory, Both solution can not work properly, SQLite is too slow, memory can not hold the huge data set at all.

Is there any one has some experience on this topic.

Carpemer
  • 301
  • 2
  • 11
  • For what it's worth, Bitcoin Core uses leveldb for this job. I think there is a Java port of it, but don't know if it's the best option. – meshcollider Jan 05 '22 at 19:57
  • You'll likely need to have txindex=1 set in your bitcoin.conf first. Only they it will store all the transactions of all the block, else it'll just store the headers. After that, you can write a Java program that loops all the blocks from 0, use JSON-RPC API of Bitcoin-cli getblock, from that get all the txHashes, then use them and loop again with gettransaction JSON-RPC to get details. For DB, try Mongo. – Gladiator9120 Nov 18 '22 at 13:03

0 Answers0