Bitcoin Forum
June 27, 2024, 11:43:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Reading the Blockchain  (Read 317 times)
Kwothe117 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
November 28, 2017, 11:02:46 AM
Last edit: November 28, 2017, 11:33:39 AM by Kwothe117
 #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://bitcointalk.org/index.php?topic=40822.0
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
November 29, 2017, 06: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.

Kwothe117 (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
November 29, 2017, 12:18:13 PM
 #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?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
November 29, 2017, 07: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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!