April 9, 2022

Installing a KYVE node

Good afternoon, today we will talk about installing a KYVE node

We will assume that you already have a server, if not, you can read other guides about it

After connecting to the server, through the terminal, update it:

sudo apt update && sudo apt upgrade -y

After that install curl :

apt install wget tar curl jq -y

Next, download and unpack the archive:

wget https://github.com/KYVENetwork/chain/releases/download/v0.0.1/chain_linux_amd64.tar.gz
tar -xvzf chain_linux_amd64.tar.gz
rm chain_linux_amd64.tar.gz
chmod +x chaind
mv chaind /usr/local/bin/kyved

After that, we set the names of the variables (Leave KYVE_CHAIN unchanged, enter your names in the rest)

KYVE_CHAIN="korellia"
KYVE_MONIKER="YOUR_MONIKER_NAME"
KYVE_WALLET="YOUR_WALLET_NAME"

Add variables to .bash_profile:

echo 'export KYVE_CHAIN='${KYVE_CHAIN} >> $HOME/.bash_profileecho 'export KYVE_MONIKER='${KYVE_MONIKER} >> $HOME/.bash_profileecho 'export KYVE_WALLET='${KYVE_WALLET} >> $HOME/.bash_profilesource $HOME/.bash_profile

We enter the command to initialize:

kyved init $KYVE_MONIKER --chain-id $KYVE_CHAIN

Download and copy the genesis file:

wget https://github.com/KYVENetwork/chain/releases/download/v0.0.1/genesis.json

mv genesis.json ~/.kyve/config/genesis.json

Installing seeds:

seeds="[email protected]:26656,[email protected]:26656"
PEERS="[email protected]:26656"
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.kyve/config/config.toml

Let's make a wallet! Don't forget to save the mnemonic!!! it will also ask you to enter a password to access the wallet SAVE or REMEMBER (If you already have a wallet and you just need to restore it, use this command kyved keys add $KYVE_WALLET --recover and enter the mnemonic)

kyved keys add $KYVE_WALLET

We add the wallet address to the variable for our convenience (for confirmation, we need the password entered earlier)

KYVE_ADDR=$(kyved keys show $KYVE_WALLET -a)

Add a variable to .bash_profile:

echo 'export KYVE_ADDR='${KYVE_ADDR} >> $HOME/.bash_profilesource $HOME/.bash_profile

Create a service file:

tee $HOME/kyved.service > /dev/null <<EOF[Unit]Description=kyveAfter=network.target[Service]Type=simpleUser=$USERExecStart=$(which kyved) startRestart=on-failureRestartSec=10LimitNOFILE=65535[Install]WantedBy=multi-user.targetEOF

Move the service file to the working folder:

sudo mv $HOME/kyved.service /etc/systemd/system/

Run service file:

sudo systemctl daemon-reload
sudo systemctl enable kyved
sudo systemctl restart kyved

Checking the logs:

journalctl -u kyved -f -o cat

Or we look at the status and wait until the node is synchronized:

curl -s localhost:26657/status

After you see "catching_up": false the node has been synced

Next, you need to update the node to switch to the next chain

wget https://github.com/KYVENetwork/chain/releases/download/v0.1.0/chain_linux_amd64.tar.gz tar -xvzf chain_linux_amd64.tar.gz rm chain_linux_amd64.tar.gz sudo systemctl stop kyved chmod +x chaind mv chaind /usr/local/bin/kyved sudo systemctl start kyved

Checking the logs:

journalctl -u kyved -f -o cat

Or we look at the status and wait until the node is synchronized:

curl -s localhost:26657/status

After you see "catching_up": false the node has been synced

Switching back to the next chain

wget https://github.com/KYVENetwork/chain/releases/download/v0.2.0/chain_linux_amd64.tar.gz tar -xvzf chain_linux_amd64.tar.gz rm chain_linux_amd64.tar.gz sudo systemctl stop kyved chmod +x chaind mv chaind /usr/local/bin/kyved sudo systemctl start kyved

Checking the logs:

journalctl -u kyved -f -o cat

Or we look at the status and wait until the node is synchronized:

curl -s localhost:26657/status

After you see "catching_up": false the node has been synced

Switching back to the next chain

wget https://github.com/KYVENetwork/chain/releases/download/v0.3.0/chain_linux_amd64.tar.gz tar -xvzf chain_linux_amd64.tar.gz rm chain_linux_amd64.tar.gz sudo systemctl stop kyved chmod +x chaind mv chaind /usr/local/bin/kyved sudo systemctl start kyved

Balance check:

kyved query bank balances $KYVE_ADDR

After synchronization, we create a validator (in the --amount line, we write in numbers the amount that we want to delegate the letters tkyve do not touch), we also enter the previously entered password (do not forget that the wallet from which you will delegate should have funds):

kyved tx staking create-validator --yes \ --amount 500000000000tkyve \ --moniker $KYVE_MONIKER \ --commission-rate "0.10" \ --commission-max-rate "0.20" \ --commission-max-change-rate "0.01" \ --min-self-delegation "1" \ --pubkey "$(kyved tendermint show-validator)" \ --from $KYVE_WALLET \ --chain-id korellia

We write the address of the validator into a variable (enter the password set earlier)

KYVE_VALOPER=$(kyved keys show $KYVE_WALLET --bech val -a)

Add a variable to .bash_profile:

echo 'export KYVE_VALOPER='${KYVE_VALOPER} >> $HOME/.bash_profilesource $HOME/.bash_profile

Checking the status of the validator:

kyved query staking validator $KYVE_VALOPER

View explorer in terminal:

kyved query staking validators --limit 1000 -o json | jq -r '.validators[] | [.operator_address, .status, (.tokens|tonumber / pow(10; 6)), .description.moniker] | @csv' | column -t -s"," | sort -k3 -n -r | nl

How to delegate funds to the validator:

kyved tx staking delegate [VALOPER_ADDRESS] [STAKE_AMOUNT]tkyve --from [your-key-name] --chain-id korellia

Well, if suddenly your node got into jail, then the output is:

kyved tx slashing unjail --chain-id korellia --from [your-key-name]

Thank you very much for your attention and time

Sincerely, MMS_Team