dash/contrib/linearize
MarcoFalke c4fee672a4 Merge #15351: Update linearize-hashes.py
7fdb92e53b Update linearize-hashes.py (OverlordQ)

Pull request description:

  Fix class case issue.

Tree-SHA512: 42d26e38b75b6b419ae4a9ca5c110d4ced0f7c5db997a64c8ab5dfc25dc228008349b6423c20ef4e396a773ff31f1f3f0092331c5e89748216e253e4d8337e9a
2021-08-18 22:24:36 -03:00
..
example-linearize-testnet.cfg Some Dashification (#3513) 2020-06-11 11:39:04 +03:00
example-linearize.cfg Dashification 2021-07-14 18:46:13 -05:00
linearize-data.py Merge #14947: scripts: Remove Python 2 import workarounds 2021-08-03 18:39:42 -03:00
linearize-hashes.py Merge #15351: Update linearize-hashes.py 2021-08-18 22:24:36 -03:00
README.md Merge #10956: Fix typos 2020-01-01 21:31:39 -06: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: datadir (Required if rpcuser and rpcpassword are not specified)
  • RPC: rpcuser, rpcpassword (Required if datadir is not specified)

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 dashd or dash-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:

  • debug_output: Some printouts may not always be desired. If true, such output will be printed.
  • file_timestamp: Set each file's last-accessed and last-modified times, respectively, to the current time and to the timestamp of the most recent block written to the script's blockchain.
  • genesis: The hash of the genesis block in the blockchain. (default is '00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6', mainnet)
  • input: dashd 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 'bf0c6bbd', mainnet)
  • out_of_order_cache_sz: If out-of-order blocks are being read, the block can be written to a cache so that the blockchain doesn't have to be sought again. This option specifies the cache size. (Default: 100*1000*1000 bytes)
  • 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).