|
| 1 | +# Linearize |
| 2 | +Construct a linear, no-fork, best version of the Komodo (or smartchain) blockchain. |
| 3 | + |
| 4 | +## Step 1: Download hash list |
| 5 | + |
| 6 | + $ ./linearize-hashes.py linearize.cfg > hashlist.txt |
| 7 | + |
| 8 | +Required configuration file settings for linearize-hashes: |
| 9 | +* RPC: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified) |
| 10 | +* RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified) |
| 11 | + |
| 12 | +Optional config file setting for linearize-hashes: |
| 13 | +* RPC: `host` (Default: `127.0.0.1`) |
| 14 | +* RPC: `port` (Default: `7771`) |
| 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. |
| 21 | + |
| 22 | +The `linearize-hashes` script requires a connection, local or remote, to a |
| 23 | +JSON-RPC server. Running `komodod` or `komodo-qt -server` will be sufficient. |
| 24 | + |
| 25 | +## Step 2: Copy local block data |
| 26 | + |
| 27 | + $ ./linearize-data.py linearize.cfg |
| 28 | + |
| 29 | +Required configuration file settings: |
| 30 | +* `output_file`: The file that will contain the final blockchain. |
| 31 | + or |
| 32 | +* `output`: Output directory for linearized `blocks/blkNNNNN.dat` output. |
| 33 | + |
| 34 | +Optional config file setting for linearize-data: |
| 35 | +* `debug_output`: Some printouts may not always be desired. If true, such output |
| 36 | +will be printed. |
| 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`: komodod blocks/ directory containing blkNNNNN.dat |
| 42 | +* `hashlist`: text file containing list of block hashes created by |
| 43 | +linearize-hashes.py. |
| 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 sought 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`). |
0 commit comments