1

Alright, so I've been trying to learn a little more about the blockchain and blockchain-development lately. For every other altcoin, I've noticed that there's such a thing as a bootstrap.dat-file which, as I understood it, essentially is a file containing the "correct" blockchain which simply get imported to the computer in order to speed up the synchronisation of the blockchain of a certain coin. I would like to learn how to create one of these bootstrap.dat-files by myself (or at least learn the theory behind it).

I found this post. I followed the instructions in the second answer, running this cat blk000*.dat > bootstrap.dat code in Terminal which did create a bootstrap-file. I imported this to my second computer, started the client (Fastcoin 0.8.7.2) and while this worked I was unable to restart the client as it almost immediately freezes while it keeps reading data from the disk. I have to force quit the client to get out of this. I emailed the support and while I wait for their answer I figured I'd try to make some research by myself.

According to this thread on Bitcointalk, a valid bootstrap.dat-file does not contain orphan blocks (which I know mine does) and have the blocks in the correct order (which I'm not sure how to check). I read that Bitcoin uses a linearize.py-script to resolve these issues, but as I understood it it doesn't use the data on disk to do this but rather from a server which is not what I'm trying to do.

Since the code in my third paragraph actually did create a bootstrap-file, I figure I might be on to something that way. But how do I avoid the orphan-blocks/sort them out as well as getting the "valid" blocks in the correct order? All help will be greatly appreciated!

1 Answer 1

0

It is basically impossible to do what you want without verifying the blocks yourself and constructing the chain status yourself. The easiest way to do this is to run the client that downloaded those block files in the first place as it will know the chain status to be able to construct the main blockchain. This piece of software has the server that the linearize script interacts with. So just run that with the linearize script and it will construct you proper bootstrap.dat file.

2
  • Thank you for your answer, I really appreciate it. I think what you're saying make sense but I'm not sure how I would go about to do it. Maybe that's more of a Python-related question, but how would I get started? I downloaded the Python 3.6.4 IDLE and try to run the $ ./linearize-hashes.py linearize.cfg > hashlist.txtin it but I keep getting an Invalid Syntax-Error. Maybe I'm not on the right track at all? Dec 23, 2017 at 21:23
  • @dragonskater45 You must be fairly close to the answer to what you are trying to do. According to the comments on this answer in the question that you linked, it seems to work.
    – Willtech
    Feb 22, 2018 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.