June 7, 2022

Protocol Node Kyve with Kysor support

For this guide, I took information from the project's github https://github.com/kyve-org/kysor

The team developed Cosmovisor for all the protocol nodes in the KYVE network (KYSOR).

In short, there is no more need to download binaries and update them.

So let's begin the installation process

Update all packages

sudo apt update && sudo apt upgrade -y

Installing Yarn

sudo apt install curl
curl https://deb.nodesource.com/setup_14.x | sudo bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt upgrade -y
sudo apt install nodejs=14.* yarn build-essential jq -yq -y

Create variables

POOL_ID="number EVM pool"
STAKE="amount stake"
echo "export POOL_ID=$POOL_ID" >> $HOME/.bash_profile
echo "export STAKE=$STAKE" >> $HOME/.bash_profile
source $HOME/.bash_profile

Download Kysor

sudo apt install git
git clone https://github.com/kyve-org/kysor.git
cd $HOME/kysor

Create a directory secrets and mnemonic txt file

mkdir $HOME/kysor/secrets
echo 'your mnemonic phrase' > $HOME/kysor/secrets/mnemonic.txt

Then transfer the file to the secrets directory arweave.json either through MobaXterm or through SCP, for a local PC run the command like this. Replacing the path and IP addresses:

scp C:\arweave.json [email protected]:/root/kysor/secrets/

Check for files in the folder

ls -la $HOME/kysor/secrets/

Prepare a new kysor.conf.ts, copy everything without changes.

tee $HOME/kysor/kysor.conf.ts > /dev/null <<EOF
import { IConfig } from "./src/faces";
const config: IConfig = {
  // target of the host machine, can be either "linux" or "macos"
  // important for downloading the correct binaries
  hostTarget: "linux",
  
  // whether KYSOR should auto download new binaries
  // if set to false, you have to insert the binaries manually
  autoDownload: true,
  
  // whether KYSOR should verify the checksums of downloaded binaries
  // if autoDownload is false this option can be ignored
  verifyChecksums: true,
  
  // settings for protocol node
  // notice that mnemonic and keyfile is missing, those need to be files under the secrets directory
  protocolNode: {
    // the ID of the pool you want to join as a validator
    // an overview of all pools can be found here -> https://app.kyve.network
    poolId: $POOL_ID,
    
    // the network you want to run on
    // currently only the testnet network "korellia" is available
    network: "korellia",
    
    // the amount of $KYVE you want to stake
    // will only get applied if you are not a validator yet
    // once you are a validator you can manage your stake in the KYVE app
    initialStake: $STAKE,
    
    // the amount of bytes the node can use at max to cache data
    // 1000000000 equals 1 GB which is usually enough
    space: 1000000000,
    
    // specify verbose logging
    // is often recommended in order to have a more detailed insight
    verbose: true,
  },
};

export default config;
EOF

Install Kysor, I advise you to do this in the screen

cd $HOME/kysor
yarn install
yarn build

Create a service file

sudo tee <<EOF >/dev/null /etc/systemd/system/kyved.service
[Unit]
Description=Protocol Node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/kysor
ExecStart=yarn start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF

Running the service file

sudo systemctl daemon-reload && sudo systemctl enable kyved && sudo systemctl start kyved

See logs

journalctl -u kyved -f -o cat

Congratulations, you have become a validator of the protocol node!

Chat: https://t.me/russianbears1

Author's Channel: https://t.me/cryptorussianbears