- Docs
- Run a node
- Sync from genesis
Sync from genesis
This is the slowest (and most secure) way to sync your node, as your node goes through every block since the genesis block. There are two ways for syncing your node from genesis:
- Through an archival node RPC.
- Through the validated and archived blocks by KYVE.
Info
Before going any further, it is recommended to set up Cosmovisor.
You can use the Networks page to find useful information such as the chain-id and rpc-url of the network you would like to connect to.
With the above data, make sure to download correct genesis file, by fetching it from an available node:
curl -s "$RPC_ENDPOINT/genesis" | jq '.result.genesis' > ~/.archway/config/genesis.json
Triomphe (mainnet) genesis file
You can find relevant information regarding archway-1 on Github. For example, you can launch the command to connect to the RPC Endpoint of the Constantine network, and download the Genesis File:
curl -s https://rpc.mainnet.archway.io/genesis |jq -r .result.genesis > ${HOME}/.archway/config/genesis.json
You can also download the genesis file from github, for example by launching:
wget https://github.com/archway-network/networks/blob/main/archway-1/genesis/genesis.json.gz
Constantine (testnet) genesis file
You can find relevant information regarding constantine-3 on Github. For example, you can launch the command to connect to the RPC Endpoint of the Constantine network, and download the Genesis File:
curl -s https://rpc.constantine.archway.io/genesis |jq -r .result.genesis > ${HOME}/.archway/config/genesis.json
You can also download the genesis file from github, for example by launching:
wget https://github.com/archway-network/networks/blob/main/constantine-3/genesis.json
1. How to sync through RPC
Start archwayd (default)
Start the archway and join the network:
Binary
Docker
archwayd start \ --p2p.seeds Address1@Host_Name_OR_IP1:PORT1, ...AddressN@Host_Name_OR_IPN:PORTN \
Below is the command to join the Triomphe mainnet:
Binary
Docker
archwayd start \ --p2p.seeds [email protected]:26656
Below is the command to join the Constantine testnet:
Binary
Docker
archwayd start \ --p2p.seeds [email protected]:26656
Start archwayd 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.service
And add the following content to the file:
[Unit]
Description=Archway Node
After=network-online.target
[Service]
User=$USER
ExecStart=/home/$USER/go/bin/archwayd start
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
You can then reload the systemctl daemon:
sudo systemctl daemon-reload
Enable the service:
sudo -S systemctl enable archwayd
And then start archwayd as a service:
sudo systemctl start archwayd
You can then check that the service is properly running with:
sudo systemctl status archwayd
Start 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.service
And 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.target
You can then reload the systemctl daemon:
sudo systemctl daemon-reload
Enable the service:
sudo -S systemctl enable archwayd
And then start archwayd as a service:
sudo systemctl start archwayd
You can then check that the service is properly running with:
sudo systemctl status archwayd
2. How to sync through KYVE
KYVE is a blockchain that validates and archives chain data like Archway blocks and state-sync snapshots. The tool KSYNC provides the possibility to use the validated data in order to sync an Archway node to any height.
Info
More information about KSYNC can be found in the KYVE Docs.
KSYNC Installation
Install with Go (recommended)
Install the latest version:
go install github.com/KYVENetwork/ksync/cmd/ksync@latest
Run ksync version
to verify the installation.
Install from source
You can also install from source by pulling the ksync repository and switching to the correct version and building as follows:
git clone [email protected]:KYVENetwork/ksync.gitcd ksyncgit checkout tags/vx.x.x -b vx.x.xmake ksync
This will build ksync in /build
directory. Afterwards, you may want to put it into your machine's PATH like
as follows:
cp build/ksync ~/go/bin/ksync
Starting KSYNC (default)
You can block-sync from genesis up to live height with the blocks validated and archived by KYVE with the following command:
ksync block-sync --binary="/path/to/archwayd" --source="archway"
You can also continue the block-sync from your current height to any
target height you specify with --target-height
.
ksync block-sync --binary="/path/to/archwayd" --source="archway" --target-height=<height>
Starting KSYNC as a service
Since syncing from genesis can take a while a service file can be used to allow the automatic restart of the service.
You can create a service file with:
nano /etc/systemd/system/archwayd.service
And add the following content to the file:
[Unit]
Description=KSYNC Archway Node
After=network-online.target
[Service]
User=$USER
ExecStart=/home/$USER/go/bin/ksync block-sync --binary="/path/to/archwayd" --source="archway"
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
You can then reload the systemctl daemon:
sudo systemctl daemon-reload
Enable the service:
sudo -S systemctl enable archwayd
And then start archwayd as a service:
sudo systemctl start archwayd
You can then check that the service is properly running with:
sudo systemctl status archwayd
Cleaning up (optional)
In case you want to remove any previous genesis file and configuration that you have used, you can clean up the network.
rm -rf ~/.archway
Warning
This command will remove all data and configs you already set.
Next Steps
Now that you have joined a network, you can start validating.