Skip to main content

Installation

This chapter will deal with the installation process of KYSOR (the Cosmovisor of KYVE protocol nodes) and the setup of it in order to run on a storage pool.

Install KYSOR

Get the latest release of the KYSOR binaries here

Once you have the latest version for you operating system simply pull them down:

wget https://github.com/KYVENetwork/kyvejs/releases/download/%40kyve%2Fkysor%401.0.0-beta.8/kysor-linux-x64.zip
unzip kysor-linux-x64.zip
mv kysor-linux-x64 kysor
chmod 700 kysor

To verify that the KYSOR runs successfully just run

./kysor version

Initialize KYSOR

After the successful installation of KYSOR it now needs to be initialized. Depending on the network you want to join a different configuration needs to be passed to the init options.

./kysor init \
--chain-id 'kyve-1' \
--rpc 'https://rpc-eu-1.kyve.network' \
--rest 'https://api-eu-1.kyve.network'
tip

NOTE: Depending on your geolocation it might be better to use a different endpoint. You can check available endpoints for each network here

Once you have initialized KYSOR you can verify the successful initialization by printing out the home directory:

ls ~/.kysor

There should be a config.toml file where the configurations you just defined are saved. You can change those at any time if you want.

Create the Valaccount

Now that KYSOR is initialized we move on to the next step. For every pool you run on a valaccount has to be created. In our example, we want to run on the Moonbeam pool with Pool Id 0. A new valaccount with a new mnemonic can be created in the following way:

./kysor valaccounts create \
--name 'moonbeam' \
--pool 0 \
--storage-priv "$(cat path/to/arweave.json)" \
--metrics

This will create a moonbeam.toml file under the KYSOR home directory in ~/.kysor/valaccounts/ where all the other valaccounts are stored. There you can view your valaccount config.

If you want to create a valaccount from an existing mnemonic just add the --recover flag like this:

./kysor valaccounts create \
--name moonbeam \
--pool 0 \
--storage-priv "$(cat path/to/arweave.json)" \
--metrics \
--recover

This will prompt you to enter the mnemonic you want to import. More help on how to manage valaccounts can be found with ./kysor valaccounts --help

danger

ATTENTION: Since the valaccount config files store the valaccount's mnemonic and the wallet keyfile for the storage provider you should never share this file with anyone.

Loosing the mnemonic of the valaccount can cause a timeout slash. If a third party ever gets hold of the mnemonic an upload slash can be the worst case since they have control over the vote and upload behaviour of the node. Loosing the private keyfile of the storage provider means loosing your funds.

Install Pool Binaries

In the last step of the installation process of KYSOR the actual pool runtime binaries need to be installed in KYSOR.

General KYSOR Directory Structure

Knowing where KYSOR saves it's logs and binaries can be helpful. The example below shows the following setup: The KYSOR runs on two pools with pool id 0 and 2. Pool 2 is still running on version 0.8.6 while pool 0 has already upgraded from 1.8.6 to 1.8.7

.kysor
├── config.toml
├── logs
│   └── 2022-09-29T08:38:24.513Z.log
│   └── 2022-09-29T09:29:22.219Z.log
├── upgrades
│   ├── pool-0
│   | ├── 1.8.6
│   | | ├── bin
│   | | │   └── kyve-linux-x64
│   | | ├── cache
| | | │   ├── 234.json
| | | │   └── ...
│   | | └── logs
│   | | ├── 2022-09-29T08:23:02.003Z.log
│   | | └── 2022-09-29T08:23:24.953Z.log
│   | └── 1.8.7
│   | ├── bin
│   | │   └── kyve-linux-x64
│   | ├── cache
| | │   ├── 567.json
| | │   └── ...
│   | └── logs
│   | └── 2022-09-29T08:23:24.953Z.log
│   └── pool-2
│   └── 0.8.6
│   ├── bin
│   │   └── kyve-linux-x64
│   ├── cache
| │   ├── 3847.json
| │   └── ...
│   └── logs
│   └── 2022-09-29T08:23:02.003Z.log
└── valaccounts
├── moonbeam.toml
└── celo.toml

Here the following directories have the following reason:

  • .kysor - KYSOR home directory, created with init command
  • config.toml - general KYSOR config, created with init command
  • logs - logs folder containing KYSOR log files. Each log file is a run from start to end where the date is the starting date
  • upgrades - most important directory, contains all the binaries for every pool
  • upgrades/pool-$id - holds every binary of every installed version of the specified pool
  • upgrades/pool-$id/$version - acts as a home directory for a specific binary, contains binary cache, logs and actual protocol node binary
  • upgrades/pool-$id/$version/bin - holds actual node binary
  • upgrades/pool-$id/$version/cache - contains cached data relevant for the protocol node
  • upgrades/pool-$id/$version/logs - logs folder for the protocol node of that version and pool. Each log file is a run from start to end where the date is the starting date
  • valaccounts - contains all the valaccount config files with which the KYSOR can run on a pool

Binary Installation

The binary installation for each runtime can differ. Current runtimes which are live are listed below. You can follow a detailed binary installation for each runtime there. Once you are done you can continue here.

After you have installed the binary you can proceed to move it to the correct location so KYSOR can use it:

Since auto download should be disabled for security reasons on mainnet you have to install the correct binaries manually on the KYSOR. In order to fetch the correct binary head back to the pool you chose and look at the runtime and at the runtime version. With this information you can head to the binary releases and get the correct binary. Once you have found the correct release create the required folders where the binary should be placed:

mkdir -p ~/.kysor/upgrades/pool-$POOL_ID/$VERSION/bin
cd ~/.kysor/upgrades/pool-$POOL_ID/$VERSION/bin
wget https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2F$RUNTIME%40$VERSION/kyve-linux-x64.zip
unzip kyve-linux-x64.zip
rm kyve-linux-x64.zip

To verify the version and the runtime of the binary simply call the version command:

./kyve-linux-x64 version

When the runtime and the version matches the KYSOR is ready.