2014-08-24 03:46:12 +02:00
|
|
|
# Linearize
|
2017-01-05 11:19:11 +01:00
|
|
|
Construct a linear, no-fork, best version of the Dash blockchain. The scripts
|
|
|
|
run using Python 3 but are compatible with Python 2.
|
2014-08-24 03:46:12 +02:00
|
|
|
|
2015-09-09 04:09:12 +02:00
|
|
|
## Step 0: Install dash_hash
|
|
|
|
|
2015-09-12 16:25:31 +02:00
|
|
|
https://github.com/dashpay/dash_hash
|
2015-09-09 04:09:12 +02:00
|
|
|
|
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:
|
2017-01-05 11:19:11 +01:00
|
|
|
* RPC: `rpcuser`, `rpcpassword`
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
Optional config file setting for linearize-hashes:
|
2017-01-05 11:19:11 +01:00
|
|
|
* RPC: `host` (Default: `127.0.0.1`)
|
|
|
|
* RPC: `port` (Default: `9998`)
|
|
|
|
* 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.
|
|
|
|
|
|
|
|
The `linearize-hashes` script requires a connection, local or remote, to a
|
2018-01-18 18:40:06 +01:00
|
|
|
JSON-RPC server. Running `dashd` or `dash-qt -server` will be sufficient.
|
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:
|
2017-01-05 11:19:11 +01:00
|
|
|
* `output_file`: The file that will contain the final blockchain.
|
|
|
|
or
|
|
|
|
* `output`: Output directory for linearized `blocks/blkNNNNN.dat` output.
|
2014-08-24 03:46:12 +02:00
|
|
|
|
|
|
|
Optional config file setting for linearize-data:
|
2017-01-05 11:19:11 +01:00
|
|
|
* `file_timestamp`: Set each file's last-modified time to that of the most
|
|
|
|
recent block in that file.
|
2018-01-18 18:40:06 +01:00
|
|
|
* `genesis`: The hash of the genesis block in the blockchain. (default is '00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6', mainnet)
|
|
|
|
* `input`: dashd blocks/ directory containing blkNNNNN.dat
|
2017-01-05 11:19:11 +01:00
|
|
|
* `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`)
|
2018-01-18 18:40:06 +01:00
|
|
|
* `netmagic`: Network magic number. (default is 'bf0c6bbd', mainnet)
|
2017-01-05 11:19:11 +01:00
|
|
|
* `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`).
|