Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: coder0x15 on June 19, 2018, 12:19:18 PM



Title: A standalone blockchain parser. The simpliest parser that has been ever maded.
Post by: coder0x15 on June 19, 2018, 12:19:18 PM
I found this script somewhere in reddit.
It makes me busy and happy with my explorations of blockchain.
The script is f**n slow, but he track byte-to-byte structure of raw dumps of bitcoin blockchain.
It is a pseudocode script that can parse whole raw dumps of blockchain.
In now time it realised in Python, but structure of the code is great for rescripting it to at any other languages.
I think it will be usefull for BT users to check it.
May be you want to explore blockchain as pure as you need. So that is what you need.
Here it is -> https://github.com/ragestack/blockchain-parser (https://github.com/ragestack/blockchain-parser)


Title: Re: A standalone blockchain parser. The simpliest parser that has been ever maded.
Post by: hash-pool.eu on June 19, 2018, 12:57:04 PM
Sounds interesting but I don't understand what it is for. Could you more elaborate what the idea of this script is?

Can I parse the blk*.dat files with it? This would be quite interesting.


Title: Re: A standalone blockchain parser. The simpliest parser that has been ever maded.
Post by: coder0x15 on June 19, 2018, 01:01:29 PM
Can I parse the blk*.dat files with it?

Yes.


Title: Re: A standalone blockchain parser. The simpliest parser that has been ever maded.
Post by: butka on June 21, 2018, 04:55:52 PM
The script is f**n slow, but he track byte-to-byte structure of raw dumps of bitcoin blockchain.
It is a pseudocode script that can parse whole raw dumps of blockchain.
For users that are not familiar with the details of your python implementation (like me), I think it would be useful if you explained a little bit about how to use they script. Is it enough just to run the provided python code, like this:
Code:
python blockchain-parser.py
or you have to provide something as an input to the script?


Title: Re: A standalone blockchain parser. The simpliest parser that has been ever maded.
Post by: TryNinja on June 21, 2018, 05:03:41 PM
~
Open the file in your notepad and edit the var "dirA" and "dirB" to the directory where the blk*.dat files are stored and the directory where you want to save the parsing results (respectively).


Title: Re: A standalone blockchain parser. The simpliest parser that has been ever maded.
Post by: butka on June 21, 2018, 05:18:28 PM
~
Open the file in your notepad and edit the var "dirA" and "dirB" to the directory where the blk*.dat files are stored and the directory where you want to save the parsing results (respectively).
Thanks a lot. I was going to try the code but didn't know where to start. You saved me the trouble of figuring that out.