bitcoinjs / fast-dat-parser

Superfast blockchain parser for stats
MIT License
74 stars 26 forks source link

How to read parsed data? #25

Closed behrouz-psh closed 5 years ago

behrouz-psh commented 5 years ago

Hello,

Thank you for this really fast block parser May I ask you if this work fine for rev.dat files too? instead of `cat ~/.bitcoin/blocks/blk.dat | ./parser -j4 -t1 -wchain.dat > ~/.bitcoin/scripts.dat doing this (removing blk) cat ~/.bitcoin/blocks/*.dat | ./parser -j4 -t1 -wchain.dat > ~/.bitcoin/scripts.dat`

After I parsed all blocks how to read the data from scripts.dat file?

behrouz-psh commented 5 years ago

I found the answer to my first question here https://bitcoin.stackexchange.com/questions/32716/what-exactly-are-the-rev00000-dat-files I have scripts.dat file right now and it's a very big file May I ask you how to read the scripts.dat file to extract information?

dcousens commented 5 years ago

May I ask you if this work fine for rev*.dat files too?

I don't actually know to be honest. I presume their format is different?

After I parsed all blocks how to read the data from scripts.dat file?

See

1 - Outputs every script prefixed with a uint16_t length

This is a binary format, it mean there is a uint16_t (2 byte) length, and then a variable length array of data, on repeat. This may or may not be trivial to parse, depending on your experience with raw formats.