Ask AI
Skip to main content

Join the network

After your node is configured it need to sync the latest state and connect to the network. We support two ways of syncing your chain.

Get genesis file

Download the genesis.json file and copy it over to the config directory: ~/.kyve/config/genesis.json. This is a genesis file with the chain-id and genesis account balances.

Download the mainnet genesis file (5.2 MB)

wget https://raw.githubusercontent.com/KYVENetwork/networks/main/kyve-1/genesis.json

verify the correctness of the genesis configuration via

echo "1dc3ec916f49ef8c221851566aca12a3f914b23afb3ab35067fc8a8d5f59c2ee  genesis.json" | sha256sum -c

and move the genesis file to the config directory

mv genesis.json ~/.kyve/config/

Syncing the network

tip

We strongly recommend setting up Cosmovisor and Systemd as a supervisor.

State-Sync with KSYNC

info

Using KSYNC for state-syncing KYVE is only available for mainnet, if you wish to join Kaon or Korellia use traditional state-sync here.

Since KYVE has validated and archived all of its own state-sync snapshots on a 3,000 block interval those can be used to bootstrap your KYVE node. For this the node-syncing tool KSYNC can be used. To install KSYNC run the following:

go install github.com/KYVENetwork/ksync/cmd/ksync@latest

You can verify the installation with ksync version. To state-sync to the latest available snapshot run the following:

warning

Please use the correct kyved binary version, you can find the correct version for each height here.

ksync state-sync --binary /path/to/kyved --chain-id kaon-1 --source kyve

After the state-sync snapshot has been applied you can normally continue syncing blocks over the P2P network.

Use traditional State-Sync

State sync fetches a snapshot of a recent height and then only syncs the missing blocks between the snapshot and the current height. This is the preferred method as it's much faster. Usually minutes versus weeks.

However, one needs to trust the provided state-sync nodes. If you need full trust you should sync from genesis.

info

Make sure to use the current version of the chain for statesync. All releases can be found here: https://github.com/KYVENetwork/chain/releases. Go to https://explorer.kyve.network/kyve/gov and look for the latest SoftwareUpgrade Proposal to find the current version.

First, one needs to obtain a trusted height and hash of that height. One can go to a blockexplorer and use the values provided there. For example block 86783 can be viewed at: https://www.mintscan.io/kyve/blocks/86783

To enable state-sync edit config.toml under the section [statesync]

[statesync]
enable = true

# ...

rpc_servers = "https://rpc-cache.kyve.network:443,https://rpc-cache.kyve.network:443"
trust_height = 86783 # Replace with newer block
trust_hash = "DFE6A7EC8D3E3A55A3CA6DA2D9BFB776A5F52604EBED078DAC87775AEA5C3D75" # Replace with newer hash

After that start the node with

./kyved start

Sync from genesis with KSYNC

info

Using KSYNC for syncing KYVE from genesis is only available for mainnet, if you wish to sync Kaon or Korellia use the normal P2P sync here.

Since KYVE has validated and archived all of its own blocks and block results they can be used to sync the node instead of fetching them from the P2P network. For this the node-syncing tool KSYNC can be used. To install KSYNC run the following:

go install github.com/KYVENetwork/ksync/cmd/ksync@latest

Since syncing the node from genesis can take weeks we strongly recommend setting up a systemd process which supervises the ksync process. Also since during the sync you will encounter multiple upgrades we also strongly recommend setting up Cosmovisor and preinstall all upgrade binaries. You can find information on setting up Cosmosvisor here and the systemd template below.

Create a file /etc/systemd/system/ksync.service with the following contents:

[Unit]
Description=ksync
After=network-online.target

[Service]
User=<your-user>
ExecStart=/<path-to-ksync>/ksync block-sync --binary <path-to-cosmovisor>/cosmovisor --chain-id kaon-1 --source=kyve -y
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="DAEMON_NAME=kyved"
Environment="DAEMON_HOME=/<path-to-kyve>/.kyve"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=false"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target

Make sure to replace <your-user>, <path-to-ksync>, <path-to-kyve> and <path-to-cosmovisor> with your values.

To start the process:

sudo systemctl enable ksync
sudo systemctl start ksync

It can be stopped using

sudo systemctl stop ksync

You can see its logs with

sudo journalctl -u ksync -f

Sync from genesis

info

For syncing from genesis you need chain binary version v1.0.0

After the genesis file is downloaded the chain binary can be started with

./kyved start