Add attribute [[noreturn]] (C++11) to functions that will not return
[bitcoinplatinum.git] / contrib / linearize / README.md
blobf2a2ab2768af4af6fe9f83d175864b327b093be7
1 # Linearize
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: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified)
11 * RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified)
13 Optional config file setting for linearize-hashes:
14 * RPC: `host`  (Default: `127.0.0.1`)
15 * RPC: `port`  (Default: `8332`)
16 * Blockchain: `min_height`, `max_height`
17 * `rev_hash_bytes`: If true, the written block hash list will be
18 byte-reversed. (In other words, the hash returned by getblockhash will have its
19 bytes reversed.) False by default. Intended for generation of
20 standalone hash lists but safe to use with linearize-data.py, which will output
21 the same data no matter which byte format is chosen.
23 The `linearize-hashes` script requires a connection, local or remote, to a
24 JSON-RPC server. Running `bitcoind` or `bitcoin-qt -server` will be sufficient.
26 ## Step 2: Copy local block data
28     $ ./linearize-data.py linearize.cfg
30 Required configuration file settings:
31 * `output_file`: The file that will contain the final blockchain.
32       or
33 * `output`: Output directory for linearized `blocks/blkNNNNN.dat` output.
35 Optional config file setting for linearize-data:
36 * `debug_output`: Some printouts may not always be desired. If true, such output
37 will be printed.
38 * `file_timestamp`: Set each file's last-accessed and last-modified times,
39 respectively, to the current time and to the timestamp of the most recent block
40 written to the script's blockchain.
41 * `genesis`: The hash of the genesis block in the blockchain.
42 * `input`: bitcoind blocks/ directory containing blkNNNNN.dat
43 * `hashlist`: text file containing list of block hashes created by
44 linearize-hashes.py.
45 * `max_out_sz`: Maximum size for files created by the `output_file` option.
46 (Default: `1000*1000*1000 bytes`)
47 * `netmagic`: Network magic number.
48 * `out_of_order_cache_sz`: If out-of-order blocks are being read, the block can
49 be written to a cache so that the blockchain doesn't have to be seeked again.
50 This option specifies the cache size. (Default: `100*1000*1000 bytes`)
51 * `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py
52 will be byte-reversed when read by linearize-data.py. See the linearize-hashes
53 entry for more information.
54 * `split_timestamp`: Split blockchain files when a new month is first seen, in
55 addition to reaching a maximum file size (`max_out_sz`).