Ask AI
Skip to main content

Run KSYNC

KSYNC will provide the snapshot of an Archway Node, which will act as the source for the KYVE protocol validator and is required.

Install Cronos node

The Cronos binary with the version v0.6.11 has to be installed. You can

  • follow the official installation instructions here or
  • download the binary directly from here.
danger

If you are building from source please use the specified go version in the go.mod file, else there is the danger of receiving vote slashes.

For cronosd v0.6.11 it is go17

You can verify the successful installation with

./cronosd version
v0.6.11

After the successful installation, you need to set up the cronosd config. First choose a moniker and initialize everything:

./cronosd init <your-moniker> --chain-id cronosmainnet_25-1

To download and setup the genesis file execute the following command:

wget -qO- https://raw.githubusercontent.com/crypto-org-chain/cronos-mainnet/master/cronosmainnet_25-1/genesis.json | cat > ~/.cronos/config/genesis.json

Upgrades

To upgrade the cronosd binary successfully, it is required to change the used binary manually. Therefore, just start the KSYNC process with the upgraded cronosd binary after it exited automatically.

Cosmovisor is not supported yet, but an upgrade handler like this will be added soon.

Install KSYNC

To install the required version of ksync, run the following command:

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 git@github.com:KYVENetwork/ksync.git
cd ksync
git checkout tags/v1.0.1
make 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

Start KSYNC

This command is essential for running as a protocol node in a state-sync pool since this will serve the snapshots to the protocol node. Basically, KSYNC will sync the blocks with block-sync and waits for the ABCI app to create the snapshots, once created they are exposed over a REST API server which the protocol node can then query.

To start with default settings serve the snapshots with:

ksync serve-snapshots --binary="/path/to/cronosd" --home="/path/to/.cronos" --source="cronos"
caution

You can only run this command when the corresponding KYVE data snapshot-pool has been created.

Once you see that KSYNC is syncing blocks you can open http://localhost:7878/list_snapshots. In the beginning it should return an empty array, but after the first snapshot height is reached (check the interval in the data pool settings) you should see a first snapshot object in the response.

caution

Software upgrades of the data source node have to be performed manually. Therefore, you only need to switch the cronosd binaries (after the node exited automatically at an upgrade height) in order to restart KSYNC.

Changing snapshot api server port

You can change the snapshot api server port with the flag --snapshot-port=<port>

Enabling metrics server and manage port

You can enable a metrics server running by default on http://localhost:8080/metrics by add the flag --metrics. Furthermore, can you change the port of the metrics server by adding the flag --metrics-port=<port>

Manage pruning

By default, pruning is enabled. That means that all blocks, states and snapshots prior to the snapshot pool height are automatically, deleted, saving a lot of disk space. If you want to disable it add the flag --pruning=false