<p>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.</p>

CC BY-SA 3.0
2017-12-23T21:23:17.310Z
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.txt`in it but I keep getting an Invalid Syntax-Error. Maybe I'm not on the right track at all?
dragonskater45
CC BY-SA 3.0
2018-02-22T10:27:10.547Z
@dragonskater45 You must be fairly close to the answer to what you are trying to do. According to the comments on [this answer](https://bitcoin.stackexchange.com/a/42916/75001) in the question that you linked, it seems to work.
Willtech
CC BY-SA 3.0
2017-12-23T17:21:34.407Z
2017-12-23T17:21:34.407Z
Ava Chow
<p>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).</p>

<p>I found <a href="https://bitcoin.stackexchange.com/questions/10381/creating-my-own-bootstrap-dat" title="this">this</a> post. I followed the instructions in the second answer, running this <code>cat blk000*.dat &gt; bootstrap.dat</code> 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.</p>

<p>According to <a href="https://bitcointalk.org/index.php?topic=986676.0" rel="nofollow noreferrer" title="this">this</a> 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 <a href="https://github.com/bitcoin/bitcoin/tree/master/contrib/linearize" rel="nofollow noreferrer" title="this">Bitcoin uses a linearize.py-script</a> 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.</p>

<p>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!</p>

<litecoin><altcoin-development><stale-block><bootstrap.dat>
Remove Orphan blocks from "personal" blockchain
dragonskater45
# Remove Orphan blocks from "personal" blockchain

(Asked by: username_0 on 2017-12-23)

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](https://bitcoin.stackexchange.com/questions/10381/creating-my-own-bootstrap-dat "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](https://bitcointalk.org/index.php?topic=986676.0 "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](https://github.com/bitcoin/bitcoin/tree/master/contrib/linearize "this") 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!

**Tags:** litecoin, altcoin-development, stale-block, bootstrap.dat


---

## 1 answers

### Answer by username_1 on 2017-12-23. Score: 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.

> **Comments:**
> **username_0**: 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.txt`in it but I keep getting an Invalid Syntax-Error. Maybe I'm not on the right track at all?  
> **username_2**: @username_0 You must be fairly close to the answer to what you are trying to do. According to the comments on [this answer](https://bitcoin.stackexchange.com/a/42916/75001) in the question that you linked, it seems to work.  

---

