HYDRA Documentation
  • Introduction to Hydra Chain
  • HydraGon
    • Migrate to HydraGon
    • Staking Calculator
  • Legacy Hydra
  • FAQ
  • Hydra web wallet
    • Create New Wallet
      • Key File Option
      • Mnemonic Words Option
    • Access Your Wallet
      • From Mnemonic Words
      • From Private Key
      • From Key File
    • Send and Receive Assets
      • Receive Assets
      • Send Assets
    • Add HRC20 Token
    • Setup Offline Wallet
  • Hydra web browser extension
    • How to integrate with dApps
  • Hydra for Beginners
  • Ledger Nano Guide
  • Hydra Bridge
  • HydraDEX
    • Adding and Removing Liquidity
    • Liquidity Mining on HydraDEX
  • Useful Links (Legacy)
  • Essentials
    • UTXOs Accounting
    • Test & Main Networks
    • Desktop wallet basic usage
    • Wallet Encrypt, Backup and Restore
    • Hydra Core Wallet Commands
    • Adding Nodes
    • Encrypt and Unlock Hydra Wallet
    • Wallet Recovery With Salvagewallet
    • bech32 support
    • Repositories
    • Hydra Exchange Usage Guide
    • How to Add Options
    • How to Use bootstrap.dat
    • Command Lines (RPC API)
    • Guidance of Hydra Deployment and RPC Settings
    • How to Build Hydra on Raspbian
  • HRC20 Tokens
    • HRC20 Token
    • HRC20 Raw Transactions
    • HRC20 With Hydrachainjs
    • HRC20 DApp
  • HRC721 Tokens
    • HRC721 Token - How to deploy
  • How Transactions Work
  • Hydra Economy (Legacy)
    • The Flexible Supply Mechanism
    • Legacy Staking Calculator
  • Installation Guides
  • Guide for Linux
  • Guide for Raspberry Pi
  • Guide for MacOS
  • Staking HYDRA Coins
    • Setting up Staking
    • Staking with Windows VPS on AWS
    • Staking with Linux on DigitalOcean VPS
    • How to Stake Hydra on Linux
    • Stake With Linux VPS
    • How to Stake on FreeBSD
    • Hydra node health check
    • Superstaking
    • Delegating to Superstaker
    • Delegating via Mobile App or Web Browser
    • Lydra Basics
    • Understanding LYDRA — Key Concepts and Dynamics
  • Hydra Chain Core Team
  • KYC/AML Policy
  • Privacy Policy
  • API Documentation
    • Explorer API (in work)
      • General Blockchain Info
      • Fetching Transaction History for HYDRA and HRC20 tokens
      • Block Info
      • Transaction Info
    • Hydra DEX API
  • Community Tools
    • Github repository
    • Docker image for Hydra Node
    • Hydradex.org Custom Lists
  • Security Audits Hydra Bridge
Powered by GitBook
On this page
  • What is bootstrap.dat?
  • How to generate bootstrap.dat?
  • Step 1: Download script files
  • Step 2: Download hash list
  • Step 3: Copy local block data
  • How to use bootstrap.dat

Was this helpful?

  1. Essentials

How to Use bootstrap.dat

What is bootstrap.dat?

bootstrap.dat is a file that contains the copy of blockchain from genesis block to a certain point of time. This compressed bootstrap.dat file is used to speed up the initial blockchain download times. Your wallet client downloads and verifies each block from the P2P network. This is usually slow and especially if you are using wallet for the first time, then syncing process can take quite a long time.

Instead of using peer to peer communication your wallet client can read blockchain data from this compressed bootstrap file which contains the copy of blockchain data until a certain block height. Once the wallet client completes reading data from bootstrap file, it will then use the P2P connection to download the remaining blocks. This method is faster and moreover it consumes less bandwidth compared to standard synchronization process. However still bootstrap method takes some time as your wallet client needs to validate each individual blocks.

How to generate bootstrap.dat?

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

Step 1: Download script files

Clone the Hydra official repo and enter contrib/linearize directory

git clone https://github.com/LockTrip/Blockchain/tree/
cd hydra/contrib/linearize

Step 2: 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: 3889)

  • 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 hydhydrad or hydra-qt -server will be sufficient.

Step 3: 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.

  • input: hydrad 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.

  • 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).

How to use bootstrap.dat

  1. Download bootstrap.dat file from https:.../bootstrap.dat.

  2. Move bootstrap.dat into hydra data directory, the default datadir paths are different paths for different OS:

    • Linux: ~/.hydra

    • OSX: ~/Library/Application Support/Hydra

    • Windows: %APPDATA%\Hydra

      (Please paste this path to your windows explorer, the path will be resolved automatically)

  3. Restart wallet and wait for reindexing.

PreviousHow to Add OptionsNextCommand Lines (RPC API)

Last updated 4 years ago

Was this helpful?