2014-08-24 03:46:12 +02:00
|
|
|
# Linearize
|
2016-12-21 04:25:24 +01:00
|
|
|
Construct a linear, no-fork, best version of the Bitcoin blockchain.
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
## Step 1: Download hash list
|
|
|
|
|
2015-07-10 18:21:21 +02:00
|
|
|
$ ./linearize-hashes.py linearize.cfg > hashlist.txt
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
Required configuration file settings for linearize-hashes:
|
2016-12-21 04:25:24 +01:00
|
|
|
* RPC: `rpcuser`, `rpcpassword`
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
Optional config file setting for linearize-hashes:
|
2016-12-21 04:25:24 +01:00
|
|
|
* RPC: `host`, `port` (Default: `127.0.0.1:8332`)
|
|
|
|
* Blockchain: `min_height`, `max_height`
|
|
|
|
* `rev_hash_bytes`: If true, the written block hash list will be
|
|
|
|
byte-reversed. (In other words, the hash returned by getblockhash will have its
|
|
|
|
bytes reversed.) False by default. Intended for generation of
|
|
|
|
standalone hash lists but safe to use with linearize-data.py, which will output
|
|
|
|
the same data no matter which byte format is chosen.
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
## Step 2: Copy local block data
|
|
|
|
|
2015-07-10 18:21:21 +02:00
|
|
|
$ ./linearize-data.py linearize.cfg
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
Required configuration file settings:
|
2016-12-21 04:25:24 +01:00
|
|
|
* `output_file`: The file that will contain the final blockchain.
|
2014-08-24 03:46:12 +02:00
|
|
|
or
|
2016-12-21 04:25:24 +01:00
|
|
|
* `output`: Output directory for linearized blocks/blkNNNNN.dat output.
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
Optional config file setting for linearize-data:
|
2016-12-21 04:25:24 +01:00
|
|
|
* `file_timestamp`: Set each file's last-modified time to that of the most
|
|
|
|
recent block in that file.
|
|
|
|
* `genesis`: The hash of the genesis block in the blockchain.
|
|
|
|
* `input: bitcoind blocks/ directory containing blkNNNNN.dat
|
|
|
|
* `hashlist`: text file containing list of block hashes created by
|
|
|
|
linearize-hashes.py.
|
|
|
|
* `max_out_sz`: Maximum size for files created by the `output_file` option.
|
|
|
|
(Default: `1000*1000*1000 bytes`)
|
|
|
|
* `netmagic`: Network magic number.
|
|
|
|
* `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py
|
|
|
|
will be byte-reversed when read by linearize-data.py. See the linearize-hashes
|
|
|
|
entry for more information.
|
|
|
|
* `split_timestamp`: Split blockchain files when a new month is first seen, in
|
|
|
|
addition to reaching a maximum file size (`max_out_sz`).
|