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