-
Notifications
You must be signed in to change notification settings - Fork 41
docs: add snapshot instructions #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,9 @@ The chain identifier of our production network is fetchhub-4. | |
| REST Endpoint | <https://rest-fetchhub.fetch.ai:443> | | ||
| Block Explorer | [https://explore-fetchhub.fetch.ai](https://explore-fetchhub.fetch.ai) | | ||
| Token Faucet | N/A | | ||
| Genesis | `curl https://raw.githubusercontent.com/fetchai/genesis-fetchhub/fetchhub-4/fetchhub-4/data/genesis_migrated_5300200.json --output ~/.fetchd/config/genesis.json` | | ||
| Genesis | `curl https://raw.githubusercontent.com/fetchai/genesis-fetchhub/fetchhub-4/fetchhub-4/data/genesis_migrated_5300200.json --output ~/.fetchd/config/genesis.json` | | ||
| Seed Node(s) | 17693da418c15c95d629994a320e2c4f51a8069b@connect-fetchhub.fetch.ai:36456,a575c681c2861fe945f77cb3aba0357da294f1f2@connect-fetchhub.fetch.ai:36457,d7cda986c9f59ab9e05058a803c3d0300d15d8da@connect-fetchhub.fetch.ai:36458 | | ||
| Snapshots | <https://storage.googleapis.com/fetch-ai-mainnet-snapshots/fetchhub-4-pruned.tgz> <br /> <https://storage.googleapis.com/fetch-ai-mainnet-snapshots/fetchhub-4-full.tgz> <br /> <https://storage.googleapis.com/fetch-ai-mainnet-snapshots/fetchhub-4-archive.tgz> | | ||
|
||
## Mainnet Archives | ||
|
||
|
@@ -99,17 +100,19 @@ This network is running the same software as our mainnet (`fetchhub-3`), and is | |
|
||
This network is used for testing the future upgrade to mainnet. | ||
|
||
| Parameter | Value | | ||
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Chain ID | dorado-1 | | ||
| Denomination | atestfet | | ||
| Decimals | 18 (1testfet = 1000000000000000000atestfet) | | ||
| Min Gas Prices | 1000000000atestfet | | ||
| Version | [v0.10.x (fetchd >= v0.10.x)](https://github.com/fetchai/fetchd/releases/tag/v0.10.0) | | ||
| RPC Endpoint | <https://rpc-dorado.fetch.ai:443> | | ||
| GRPC Endpoint | <https://grpc-dorado.fetch.ai:443> | | ||
| REST Endpoint | <https://rest-dorado.fetch.ai:443> | | ||
| Block Explorer | [https://explore-dorado.fetch.ai/](https://explore-dorado.fetch.ai/) | | ||
| Ledger Explorer | [https://browse-dorado.fetch.ai/](https://browse-dorado.fetch.ai/) | | ||
| Token Faucet | Use block explorer | | ||
| Seed Node(s) | [email protected]:36556,[email protected]:36557,[email protected]:36558 | | ||
| Parameter | Value | | ||
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| Chain ID | dorado-1 | | ||
| Denomination | atestfet | | ||
| Decimals | 18 (1testfet = 1000000000000000000atestfet) | | ||
| Min Gas Prices | 1000000000atestfet | | ||
| Version | [v0.10.x (fetchd >= v0.10.3)](https://github.com/fetchai/fetchd/releases/tag/v0.10.0) | | ||
| RPC Endpoint | <https://rpc-dorado.fetch.ai:443> | | ||
| GRPC Endpoint | <https://grpc-dorado.fetch.ai:443> | | ||
| REST Endpoint | <https://rest-dorado.fetch.ai:443> | | ||
| Block Explorer | [https://explore-dorado.fetch.ai/](https://explore-dorado.fetch.ai/) | | ||
| Ledger Explorer | [https://browse-dorado.fetch.ai/](https://browse-dorado.fetch.ai/) | | ||
| Token Faucet | Use block explorer | | ||
| Genesis | `curl https://storage.googleapis.com/fetch-ai-testnet-genesis/genesis-dorado-827201.json --output ~/.fetchd/config/genesis.json` | | ||
| Seed Node(s) | [email protected]:36556,[email protected]:36557,[email protected]:36558 | | ||
| Snapshots | <https://storage.googleapis.com/fetch-ai-testnet-snapshots/dorado-pruned.tgz> <br /> <https://storage.googleapis.com/fetch-ai-testnet-snapshots/dorado-full.tgz> <br /> <https://storage.googleapis.com/fetch-ai-testnet-snapshots/dorado-archive.tgz> | |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Chain State Snapshots | ||
|
||
As blockchains get longer, the process of syncing from the genesis block begins to take many hours, or even days to complete. | ||
In circumstances where a faster sync is required, various snapshots of the fetchd chain state data are available for download, to more quickly bootstrap a node. | ||
|
||
Snapshots are available for both mainnet and the most recent testnet. The URLs can be obtained from the [network page](../networks/). | ||
We aim to update snapshots on a daily basis. | ||
|
||
The example below uses the pruned mainnet snapshot, but can be adapted as required for full or archive nodes. | ||
|
||
## Using a snapshot | ||
|
||
### Stop your node | ||
|
||
If you are already running fetchd, it is important that you stop it before proceeding. Instructions for this are highly installation dependent and beyond the scope of this document, but could be as simple as a Ctrl-C. | ||
If you have not already initialised your node, follow the instructions for [joining a testnet](../joining-a-testnet/) (modifying for mainnet as appropriate), then return to this page before starting fetchd. | ||
|
||
### Reset your node | ||
|
||
WARNING: This will irreversibly erase your node's state database. Ensure you take whatever backups you deem appropriate before proceeding. | ||
|
||
If using fetchd <= 0.10.3 | ||
`fetchd unsafe-reset-all` | ||
|
||
If using fetchd >= 0.10.4 | ||
`fetchd tendermint reset-state` | ||
|
||
### Download and install the snapshot | ||
|
||
Many options here! The example below assumes a bash-like environment, uses a single connection for downloading, confirms the md5sum of the downloaded data against that of the original, and does not land the original compressed data to disk. This is a good starting point, but depending on your local environment you may wish to make adaptations that eg sacrifice disk space and extra md5sum complexity for the benefit of parallel downloads with aria2. Entirely up to you! | ||
|
||
```bash | ||
# (optional) show the timestamp of the latest available snapshot | ||
echo "Latest available snapshot timestamp : $(curl -s -I https://storage.googleapis.com/fetch-ai-mainnet-snapshots/fetchhub-4-pruned.tgz | grep last-modified | cut -f3- -d' ')" | ||
|
||
# download, decompress and extract state database | ||
curl -v https://storage.googleapis.com/fetch-ai-mainnet-snapshots/fetchhub-4-pruned.tgz -o- 2>headers.out | tee >(md5sum > md5sum.out) | gunzip -c | tar -xvf - --directory=~/.fetchd | ||
|
||
# (optional, but recommended) compare source md5 checksum provided in the headers by google, with the one calculated locally | ||
[[ $(awk -F\" '/etag:/{ print $2 }' headers.out) == $(awk '{ print $1 }' md5sum.out) ]] && echo "OK - md5sum match" || echo "ERROR - md5sum MISMATCH" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's some cool stuff here! To double-check, is using the Also wondered if md5 was enough here given how easy is to tamper with it nowadays. But I guess it's ok, the consensus is supposed to deal with the extra validation that this state is pristine There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well spotted, thanks! I will fix... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As for md5 collisions... something they do (in a slightly different context) on Osmosis is to publish their hashes on the blockchain itself. I'll have a think about whether I can push a memo with the (assumed immutable) GCS There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# (optional) show the creation date of the downloaded snapshot | ||
echo "Downloaded snapshot timestamp: $(grep last-modified headers.out | cut -f3- -d' ')" | ||
``` | ||
|
||
### Restart your node | ||
|
||
Again, this entirely depends on your local installation, but a simple example for mainnet might be... | ||
|
||
```bash | ||
fetchd start --p2p.seeds 17693da418c15c95d629994a320e2c4f51a8069b@connect-fetchhub.fetch.ai:36456,a575c681c2861fe945f77cb3aba0357da294f1f2@connect-fetchhub.fetch.ai:36457,d7cda986c9f59ab9e05058a803c3d0300d15d8da@connect-fetchhub.fetch.ai:36458`. | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.