Bootstrap full node from a snapshot
Goal
This article will guide you to bootstrap Hathor full node from a snapshot.
Snapshot is a file that reflects the state of the ledger at a particular moment in time, and can be used to recreate this state.
For more, see Snapshot at encyclopedia.Requirement
Step-by-step
- Obtain the snapshot.
- Apply the snapshot.
Step 1: obtain the snapshot
-
Start a shell session.
-
Change the working directory to where the application (Hathor core) is located — namely, source code and database, or just database.
-
Remove the
data
directory if it exists. -
Download the latest snapshot of the network you want to connect the full node:
- Testnet
- Mainnet
wget $(curl https://hathor-public-files.s3.amazonaws.com/temp/testnet-data-latest)
wget $(curl https://hathor-public-files.s3.amazonaws.com/temp/mainnet-data-latest)
- Extract the snapshot from the tar archive:
- Testnet
- Mainnet
tar xzf testnet-*.tar.gz
tar xzf mainnet-*.tar.gz
At this point, you should end up with the data
directory — containing the blockchain — at the (current) working directory.
Step 2: apply the snapshot
To apply the snapshot, just start Hathor core as usual. This procedure will vary depending on how you installed it:
Task completed
Your full node will bootstrap, loading the blockchain state portrayed by the snapshot, and then begin to sync with its peers from that point — i.e., the point when Hathor Labs took the snapshot of the blockchain state.
Note that in this guide, we used the latest available snapshot, assuming your goal is to expedite the synchronization of your full node with Hathor Network — which is the most common use case for bootstrapping a node from a snapshot.
If you need to bootstrap from a snapshot for a different reason, replace the URL in the substep 4 of step 1 with the one that points to the snapshot of the specific checkpoint you require.
What's next?
-
Hathor full node configuration: to customize or refine the installation setup.
-
Hathor full node pathway: to know how to operate this application.