2 Construct a linear, no-fork, best version of the Bitcoin blockchain. The scripts
3 run using Python 3 but are compatible with Python 2.
5 ## Step 1: Download hash list
7 $ ./linearize-hashes.py linearize.cfg > hashlist.txt
9 Required configuration file settings for linearize-hashes:
10 * RPC: `rpcuser`, `rpcpassword`
12 Optional config file setting for linearize-hashes:
13 * RPC: `host` (Default: `127.0.0.1`)
14 * RPC: `port` (Default: `8332`)
15 * Blockchain: `min_height`, `max_height`
16 * `rev_hash_bytes`: If true, the written block hash list will be
17 byte-reversed. (In other words, the hash returned by getblockhash will have its
18 bytes reversed.) False by default. Intended for generation of
19 standalone hash lists but safe to use with linearize-data.py, which will output
20 the same data no matter which byte format is chosen.
22 The `linearize-hashes` script requires a connection, local or remote, to a
23 JSON-RPC server. Running `bitcoind` or `bitcoin-qt -server` will be sufficient.
25 ## Step 2: Copy local block data
27 $ ./linearize-data.py linearize.cfg
29 Required configuration file settings:
30 * `output_file`: The file that will contain the final blockchain.
32 * `output`: Output directory for linearized `blocks/blkNNNNN.dat` output.
34 Optional config file setting for linearize-data:
35 * `debug_output`: Some printouts may not always be desired. If true, such output
37 * `file_timestamp`: Set each file's last-accessed and last-modified times,
38 respectively, to the current time and to the timestamp of the most recent block
39 written to the script's blockchain.
40 * `genesis`: The hash of the genesis block in the blockchain.
41 * `input`: bitcoind blocks/ directory containing blkNNNNN.dat
42 * `hashlist`: text file containing list of block hashes created by
44 * `max_out_sz`: Maximum size for files created by the `output_file` option.
45 (Default: `1000*1000*1000 bytes`)
46 * `netmagic`: Network magic number.
47 * `out_of_order_cache_sz`: If out-of-order blocks are being read, the block can
48 be written to a cache so that the blockchain doesn't have to be seeked again.
49 This option specifies the cache size. (Default: `100*1000*1000 bytes`)
50 * `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py
51 will be byte-reversed when read by linearize-data.py. See the linearize-hashes
52 entry for more information.
53 * `split_timestamp`: Split blockchain files when a new month is first seen, in
54 addition to reaching a maximum file size (`max_out_sz`).