# Bootstrap Extraction Script

## Understanding the Lynx Bootstrap Extraction Script

When you first set up a Lynx node, synchronizing with the blockchain can take considerable time. This bootstrap extraction script provides a solution by automating the download and installation of pre-validated blockchain data, significantly reducing the time needed to get your node running.

### The Purpose of Bootstrapping

Blockchain synchronization typically requires downloading and validating every transaction since the network's inception. This process can take several hours depending on your system and network connection. The bootstrap process offers a shortcut by providing a verified snapshot of the blockchain up to a recent point, leaving your node to sync only the most recent blocks.

### Execution of the Script

To download and install a complete bootstrap to a Lynx node, download and execute this script:

```bash
wget -O - https://raw.githubusercontent.com/getlynx/LynxBootstrap/master/extract.sh | bash
```

### Understanding How the Script Works

The script follows a careful, methodical process to ensure your blockchain data is downloaded and verified correctly:

#### Initial Setup Phase

The script begins by checking your system's readiness. It verifies the Lynx installation, ensures all required directories exist, and confirms it has the necessary permissions to operate. This prevents potential issues before any downloads begin.

#### Cleanup Operations

Before downloading new bootstrap data, the script removes any remnants of previous bootstrap attempts. This prevents conflicts and ensures you're starting with a clean slate. The cleanup process is also intelligent enough to handle files in different locations and with various naming patterns.

#### Download and Verification Process

The script downloads bootstrap data in chunks, making the process more manageable and resilient. If the script fails halfway, you can run the script again and it will pick up where it left off. Each chunk goes through a rigorous verification process:

* The script first downloads a manifest file containing checksums
* For each chunk, it verifies the SHA256 checksum matches the manifest
* If verification fails, the script automatically attempts to redownload the chunk
* Only after all chunks are verified does the script proceed to installation

#### Installation and Integration

The final phase combines the verified chunks and integrates them with your Lynx installation. The script:

* Combines all chunks into a single bootstrap file
* Extracts the data to your Lynx directory
* Performs a final cleanup to remove temporary files

### Understanding Your Directory Structure

The script works with Lynx's standard directory structure:

```
$HOME/
└── .[daemon]/
    ├── blocks/      # Contains the actual blockchain data
    ├── chainstate/  # Contains the current state of the blockchain
    └── lynx.conf    # Your Lynx configuration file
```

The bootstrap.dat file will be placed in the $HOME/.lynx/ directory. [The final step is to restart your Lynx daemon and instruct it to use the bootstrap.dat file.](https://docs.getlynx.io/lynx-administration/bootstraps#technical-implementation-and-usage-guide)

### Contributing

Contributions are welcome! Please [feel free to submit a Pull Request.](https://github.com/getlynx/LynxBootstrap/pulls)

### Support

If you encounter any issues or need assistance, please:

1. Check the Common Issues section above
2. Create an issue in the GitHub repository
3. Visit the [Lynx Documentation](https://docs.getlynx.io) for more information
4. [Visit us on Discord](https://discord.gg/6jUaNeV2Uy)

### Acknowledgments

* Bitcoin Core's linearize scripts (which were adapted for Lynx)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getlynx.io/lynx-administration/bootstraps/bootstrap-extraction-script.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
