Author

Topic: Reading the Blockchain (Read 325 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
November 29, 2017, 03:31:23 PM
#4
Fair enough. But if I want to sift through the data using my own software, how would I go about that? Is it possible?
It certainly is possible. You would do that by reading through the block files byte by byte. Each block is preceded by the network magic bytes and then a compact size unsigned integer representing the number of bytes of the block. Then the block itself in the network serialization format.
newbie
Activity: 10
Merit: 0
November 29, 2017, 08:18:13 AM
#3
You can just use Bitcoin Core which is already able to read and parse the blocks to get them into an easier to understand format. You can use the getblock RPC command to get the details of each block.

Fair enough. But if I want to sift through the data using my own software, how would I go about that? Is it possible?
staff
Activity: 3458
Merit: 6793
Just writing some code
November 29, 2017, 02:01:21 AM
#2
You can just use Bitcoin Core which is already able to read and parse the blocks to get them into an easier to understand format. You can use the getblock RPC command to get the details of each block.
newbie
Activity: 10
Merit: 0
November 28, 2017, 07:02:46 AM
#1
I downloaded the blockchain and have all the .dat files.
Now: how do I explore the inner workings of each block? Is there a way to parse them to text/XML?
I know this is probably ridiculous because of it's length and size but theoretically it should be possible to scrape the Blockchain right?

EDIT: I found a fraction of the answer in this thread: https://bitcointalksearch.org/topic/how-to-read-block-file-40822
Jump to: