Run an Archival Node (with nearup)
We encourage you to set up your node with Neard instead of Nearup as Nearup is not used on Mainnet. Please head to Run a Node for instructions on how to setup an archival node with Neard.
Running an archival node is very similar to running a validator node as both types of node use the same
nearcorerelease. The main difference for running an archival node is a modification to the
true. See below for more details.
- Nearup: Make sure
nearupis installed. You can install
nearupby following the instructions at https://github.com/near-guildnet/nearup.
Steps to Run an Archival Node using
First, retrieve a copy of the latest archival snapshot from S3:
$ aws s3 --no-sign-request cp s3://near-protocol-public/backups/testnet/archive/latest .
$ LATEST=$(cat latest)
$ aws s3 --no-sign-request cp --no-sign-request --recursive s3://near-protocol-public/backups/testnet/archive/$LATEST ~/.near/data
Running an archival node is the same as a validator node as both types of node use the same
nearcore release. The main difference for running an archival node is a modification to the
config.json by changing
config.json should contain the following fields. Currently, NEAR testnet and mainnet have only 1 (indexed ) shard and that shard is tracked. In the future, there will be the possibility to track different or multiple shards.
Please make sure that the node is stopped while changing the
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).
$ nearup run testnet
Wait until initialization finishes, use the following command to follow logs:
$ nearup logs --follow
$ nearup stop
Finally, run the following command and the node should start syncing headers at ~97%:
$ nearup run testnet
Got a question?
Ask it on StackOverflow!