-
Notifications
You must be signed in to change notification settings - Fork 474
Add config instruction for archival node #742
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 all commits
514b30d
4ef9467
c15cbae
40be8f1
db635bd
c6114d6
de985d0
bf5ccd1
71a8abc
3f9a963
960e1b5
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 |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| id: run-archival-node | ||
| title: Run an Archival Node | ||
| sidebar_label: Run an Archival Node | ||
| description: Run an Archival Node | ||
| --- | ||
|
|
||
| Running an archival node is the same as a [validator node](/docs/develop/node/validator/running-a-node) as both types of node use the same `nearcore` release. The key difference for running an archival node is a modification to the `config.json` by changing `archive` to `true`. | ||
|
|
||
| The `config.json` should contain the following fields. Currently, NEAR testnet and mainnet have only 1 (indexed [0]) shard and that shard is tracked. In the future, there will be the possibility to track different or multiple shards. | ||
|
|
||
| ``` | ||
| { | ||
| ... | ||
| "archive": true, | ||
| "tracked_shards": [0], | ||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| Please make sure that the node is stopped while changing the `config.json`. | ||
|
|
||
| Once the config has been changed, you can restart the node and the node will start syncing new archival data. In the case where you want the full archival history, you can delete the data dir and start the node from scratch syncing full history or use one of the latest backups containing the data directory snapshot which can be copied under the near home dir (default: ~/.near/data). | ||
|
|
||
| All archival data backups can be downloaded from the public S3 bucket, which contains latest daily snapshots: | ||
|
|
||
| | Network | URL | | ||
| | ------- | ------------------------------------------------------------------------------------------- | | ||
| | Mainnet | https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/mainnet/archive/data.tar | | ||
| | Testnet | https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/testnet/archive/data.tar | | ||
|
|
||
| --- | ||
|
|
||
| ## Steps to Run an Archival Node | ||
|
|
||
| Make sure [`nearup`](https://github.com/near/nearup) is installed. You can install `nearup` by following the instructions at https://github.com/near/nearup. | ||
|
Contributor
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. We should add instructions on how to run an archival node without nearup as well.
Contributor
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. Should we also add the tracked shards in the documentation for the archival nodes? Here is seems we only mention the archive: true flag?
Contributor
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.
Contributor
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. @janewang feel free to ping me in chat or even schedule a meeting on running a neard standalone. I would really like to help on this, also provide maybe a guide on how to run it with systemd as well, as this is the best way to do it and that is how we manage all our current nodes on testnet and mainnet.
Contributor
Author
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. Thanks @chefsale. Would love to connect on neard and systemd. Thanks in advance on this! |
||
|
|
||
| First, retrieve a copy of the latest archival snapshot from S3: | ||
| ```bash | ||
| $ wget -b https://near-protocol-public.s3.ca-central-1.amazonaws.com/backups/{testnet|mainnet}/archive/data.tar | ||
| ``` | ||
| Then run: | ||
| ```bash | ||
| $ nearup run testnet | ||
| ``` | ||
| Wait until initialization finishes, use the following command to follow logs: | ||
| ```bash | ||
| $ nearup logs --follow | ||
| ``` | ||
| Then run: | ||
| ```bash | ||
| $ nearup stop | ||
| ``` | ||
| ```bash | ||
| $ tar -xvf data.tar -C ~/.near/testnet/data | ||
| ``` | ||
| Finally, run the following command and the node should start syncing headers at ~97%: | ||
| ```bash | ||
| $ nearup run testnet | ||
| ``` | ||
|
|
||
| >Got a question? | ||
| <a href="https://stackoverflow.com/questions/tagged/nearprotocol"> | ||
| <h8>Ask it on StackOverflow!</h8></a> | ||
Uh oh!
There was an error while loading. Please reload this page.