github.com/dashpay/godash@v0.0.0-20160726055534-e038a21e0e3d/docs/using_bootstrap_dat.md (about)

     1  ### Table of Contents
     2  1. [What is bootstrap.dat?](#What)<br />
     3  2. [What are the pros and cons of using bootstrap.dat?](#ProsCons)
     4  3. [Where do I get bootstrap.dat?](#Obtaining)
     5  4. [How do I know I can trust the bootstrap.dat I downloaded?](#Trust)
     6  5. [How do I use bootstrap.dat with btcd?](#Importing)
     7  
     8  <a name="What" />
     9  ### 1. What is bootstrap.dat?
    10  
    11  It is a flat, binary file containing bitcoin blockchain data starting from the
    12  genesis block and continuing through a relatively recent block height depending
    13  on the last time it was updated.
    14  
    15  See [this](https://bitcointalk.org/index.php?topic=145386.0) thread on
    16  bitcointalk for more details.
    17  
    18  **NOTE:** Using bootstrap.dat is entirely optional.  Btcd will download the
    19  block chain from other peers through the Bitcoin protocol with no extra
    20  configuration needed.
    21  
    22  <a name="ProsCons" />
    23  ### 2. What are the pros and cons of using bootstrap.dat?
    24  
    25  Pros:
    26  - Typically accelerates the initial process of bringing up a new node as it
    27    downloads from public P2P nodes and generally is able to achieve faster
    28    download speeds
    29  - It is particularly beneficial when bringing up multiple nodes as you only need
    30    to download the data once
    31  
    32  Cons:
    33  - Requires you to setup and configure a torrent client if you don't already have
    34    one available
    35  - Requires roughly twice as much disk space since you'll need the flat file as
    36    well as the imported database
    37  
    38  <a name="Obtaining" />
    39  ### 3. Where do I get bootstrap.dat?
    40  
    41  The bootstrap.dat file is made available via a torrent.  See
    42  [this](https://bitcointalk.org/index.php?topic=145386.0) thread on bitcointalk
    43  for the torrent download details.
    44  
    45  <a name="Trust" />
    46  ### 4. How do I know I can trust the bootstrap.dat I downloaded?
    47  
    48  You don't need to trust the file as the `addblock` utility verifies every block
    49  using the same rules that are used when downloading the block chain normally
    50  through the Bitcoin protocol.  Additionally, the chain rules contain hard-coded
    51  checkpoints for the known-good block chain at periodic intervals.  This ensures
    52  that not only is it a valid chain, but it is the same chain that everyone else
    53  is using.
    54  
    55  <a name="Importing" />
    56  ### 5. How do I use bootstrap.dat with btcd?
    57  
    58  btcd comes with a separate utility named `addblock` which can be used to import
    59  `bootstrap.dat`.  This approach is used since the import is a one-time operation
    60  and we prefer to keep the daemon itself as lightweight as possible.
    61  
    62  1. Stop btcd if it is already running.  This is required since addblock needs to
    63     access the database used by btcd and it will be locked if btcd is using it.
    64  2. Note the path to the downloaded bootstrap.dat file.
    65  3. Run the addblock utility with the `-i` argument pointing to the location of
    66     boostrap.dat:<br /><br />
    67  **Windows:**
    68  ```bat
    69  C:\> "%PROGRAMFILES%\Btcd Suite\Btcd\addblock" -i C:\Path\To\bootstrap.dat
    70  ```
    71  **Linux/Unix/BSD/POSIX:**
    72  ```bash
    73  $ $GOPATH/bin/addblock -i /path/to/bootstrap.dat
    74  ```