neobytes/contrib/linearize
Wladimir J. van der Laan 882e2cdb9f Merge #9373: Linearize script update (hash byte reversal and Python 3 support)
3c8f63b Make linearize scripts Python 3-compatible. (Doug)
d5aa198 Allow linearization scripts to support hash byte reversal (Doug)
2018-01-18 07:33:44 +01:00
..
example-linearize-testnet.cfg change default datadir to DashCore(Win,Mac)/.dashcore(Linux) as discussed in #898 2016-07-06 23:26:21 +03:00
example-linearize.cfg Merge #9373: Linearize script update (hash byte reversal and Python 3 support) 2018-01-18 07:33:44 +01:00
linearize-data.py Merge #9373: Linearize script update (hash byte reversal and Python 3 support) 2018-01-18 07:33:44 +01:00
linearize-hashes.py Merge #9373: Linearize script update (hash byte reversal and Python 3 support) 2018-01-18 07:33:44 +01:00
README.md Merge #9373: Linearize script update (hash byte reversal and Python 3 support) 2018-01-18 07:33:44 +01:00

Linearize

Construct a linear, no-fork, best version of the Dash blockchain. The scripts run using Python 3 but are compatible with Python 2.

Step 0: Install dash_hash

https://github.com/dashpay/dash_hash

Step 1: Download hash list

$ ./linearize-hashes.py linearize.cfg > hashlist.txt

Required configuration file settings for linearize-hashes:

  • RPC: rpcuser, rpcpassword

Optional config file setting for linearize-hashes:

  • 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 JSON-RPC server. Running bitcoind or bitcoin-qt -server will be sufficient.

Step 2: Copy local block data

$ ./linearize-data.py linearize.cfg

Required configuration file settings:

  • output_file: The file that will contain the final blockchain. or
  • output: Output directory for linearized blocks/blkNNNNN.dat output.

Optional config file setting for linearize-data:

  • file_timestamp: Set each file's last-modified time to that of the most recent block in that file.
  • genesis: The hash of the genesis block in the blockchain. (default is '00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c', testnet)
  • input: bitcoind blocks/ directory containing blkNNNNN.dat
  • 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)
  • netmagic: Network magic number. (default is 'cee2caff', testnet)
  • 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).