- Docs
- Run a node
- Sync from snapshot
Sync from snapshot
A snapshot is a compressed archive of the state of a blockchain node at a specific block height. Syncing a node with a snapshot speeds up the process of catching up with the network, as the node starts from the snapshot's block height instead of from the genesis block.
In order to sync your node through a snapshot, you will need to:
- Download the pre-built binary
- Download the snapshot (from a trusted source).
- Download the genesis file
- Configure your node
- Start archwayd
Download the pre-built binary
Make sure to follow the instructions to download the pre-built archwayd binary.
Once downloaded, grant the permissions to the binary, for example with:
chmod +x archwayd_linux_amd64You can also create a symbolic link named archwayd that points to archwayd_linux_amd64 using the ln command:
ln -s ./archwayd_linux_amd64 archwaydDownload the snapshot
You can download the latest snapshot from:
Also, you can use the snapshot maintained by the community. Please make sure to be aware of the possible risks of using unofficial snapshots solutions.
Once you downloaded the snapshot, you need to decompress it. You can use tools such as lz4. To install lz4, launch:
sudo apt-get install snapd lz4 -yIf the snapshot you downloaded is called mainnet-archive-20230918.tar.lz4, you can decompress it with lz4 and move it in the ./archway/data folder.
For example, if you have the snapshot in the downloads folder, you can use the following command:
lz4 -d ~/downloads/mainnet-archive-20230918.tar.lz4 -o ~/.archway/data/mainnet-archive-20230918.tarThe above command decompress the snapshot in the data folder.
Download the genesis file
You can download the genesis file from Github Github, for example by launching:
wget https://github.com/archway-network/networks/blob/main/archway-1/genesis/genesis.json.gzYou can now decompress the genesis file with gzip Move the genesis file to the ./archway/config folder, for example with:
gzip -dk genesis.json.gzAnd then move the genesis.json file into the ./archway/config folder, with:
mv genesis.json.gz /home/user/.archway/config/genesis.jsonConfigure the node
In the ~/.archway/config folder there you can find both the app.toml and config.toml.
In the app.toml, make sure to set the minimum-gas-prices, for example:
minimum-gas-prices = "0.1arch"This is the minimum gas prices that the validator is willing to accept for processing a transaction.
Also, make sure to check the p2p section in the config.toml.
You can find information about the p2p seeds in the chain.json file in Github.
Start archwayd
You can now initialize the node and choose a name for it (moniker) with:
archwayd init <node_name> --chain-id archway-1Info
Before going any further, it is recommended to set up Cosmovisor and run archwayd as a cosmovisor service.
You can start the node with:
Binary
Docker
archwayd start \ --p2p.seeds [email protected]:26656but it is highly recommended to start archwayd as a service and use cosmovisor.
Start archwayd as a service
You can start the node as a service by creating a service file:
sudo nano /etc/systemd/system/archwayd.service[Unit]Description=Archway NodeAfter=network.target[Service]User=$USERType=simpleExecStart=$(which archwayd) startRestart=on-failureLimitNOFILE=65535[Install]WantedBy=multi-user.targetStart the service by: Reloading the daemon:
sudo systemctl daemon-reloadEnable archwayd:
sudo systemctl enable archwaydStart archwayd as a service:
sudo systemctl restart archwaydKeep track of the logs:
sudo journalctl -u archwayd -f -o catStart archwayd docker as a service
A service file can be used to allow the automatic restart of the service, and it helps to enhance the reliability of your node.
You can create a service file with:
nano /etc/systemd/system/archwayd.serviceAnd add the following content to the file:
[Unit]Description=Archway NodeAfter=network-online.target[Service]User=$USERExecStart=/usr/bin/docker run --rm -it -v ~/.archway:/root/.archwayghcr.io/archway-network/archwayd-dev:v9.0.0Restart=alwaysRestartSec=3LimitNOFILE=4096[Install]WantedBy=multi-user.targetYou can then reload the systemctl daemon:
sudo systemctl daemon-reloadEnable the service:
sudo -S systemctl enable archwaydAnd then start archwayd as a service:
sudo systemctl start archwaydYou can then check that the service is properly running with:
sudo systemctl status archwayd