# Lava Network- Validator Node

By [GLCstaked](https://paragraph.com/@glcstaked) · 2023-01-06

---

**Lava Protocol, a crypto-market which powers a decentralized RPC layer for Web3.**

[

Lava Network
------------

2.5m+ users, 30+ chains supported, 70b+ RPC calls - you are using Lava without knowing. Lava is the infrastructure that powers access to all blockchains, enabling essential onchain actions such as minting, swapping and transacting.

https://www.lavanet.xyz

![](https://storage.googleapis.com/papyrus_images/45b0bf144f30a9a0154de3a3057bdbd50576e6379eea1ff8dc302c14ce19e73a.webp)

](https://lavanet.xyz/)

### Main Concepts

**Lava Chain:** is a cosmos PoS layer 1 with $LAVA for settlement, validator nodes secure the chain by verifying new blocks to earn rewards.

**Providers:** Provider nodes, are nodes running atop Lavanet connecting to Lava chain for rewards do not participate in consensus), these nodes provide RPC endpoints of other chains to any consumer.

**Consumers:** consumers of chain data, paying for access to RPC endpoints to providers

Setup Validator Node
--------------------

**This Guide will focus on the setup of a Validator node which is also a Full node for Lava chain**

**Hardware Requirements:** 4vCPU/8GB/100GB SSD OS: Ubuntu 20.04LTS

1\. Install dependencies and setup server
-----------------------------------------

Switch to root user, can exit any time with `exit`

    sudo -i
    

Update your system and repositories

    apt update && apt upgrade -y
    

**Install Dependencies**

The following packages required for lava node

    sudo apt install make clang pkg-config libssl-dev build-essential git jq llvm libudev-dev -y
    

**Install Go**

Download and unpack installation file to /usr/local

    ver="1.19.4"
    wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
    rm -rf /usr/local/go
    tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
    rm "go$ver.linux-amd64.tar.gz"
    

Add to PATH

    echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
    source $HOME/.bash_profile
    

Confirm installed with `go version`

![](https://storage.googleapis.com/papyrus_images/47ef9cbcc233a5a81d63efb136cd04b20e4bd3a180d0deb0a918f1463087da07.png)

**Firewall Settings**

Outbound - allow all traffic. Inbound - open the following ports: 1317 - REST, 26657 - TENDERMINT\_RPC, 26656 - Cosmos

    sudo ufw allow 1317
    sudo ufw allow 26657
    sudo ufw allow 26656
    sudo ufw allow ssh
    sudo ufw enable
    

Default setting ufw is to allow all outgoing, if your server is remote ensure to allow 22 for ssh.

2\. Download Lava Node (lavad)
------------------------------

Download lavad (genesis) binary, move to `$HOME/go/bin` and make executable. Check discord ‘updates’ for the latest version.

    mkdir -p $HOME/go/bin
    wget $HOME/go/bin/lavad "https://lava-binary-upgrades.s3.amazonaws.com/testnet/v0.4.0/lavad" -O lavad
    chmod +x $HOME/go/bin/lavad
    

Lavad should now be accessible from `PATH`, to verify run `lavad --help` this will output available commands, if you have Error then make sure the lavad\_binary\_path is part of PATH

3\. Download setup configurations
---------------------------------

Copy lavad default config files to config Lava config folder, and set genesis JSON file in the configuration folder, obtain files from here

    git clone https://github.com/K433QLtr6RA9ExEq/GHFkqmTzpdNLDd6T.git
    cd GHFkqmTzpdNLDd6T/testnet-1
    

in here you can see the configurations, `source setup_config/setup_config.sh`

    mkdir -p $HOME/.lava/config
    cp default_lavad_config_files/* $HOME/.lava/config
    cp genesis_json/genesis.json $HOME/.lava/config/genesis.json
    

This makes a folder in our working directory `.lava` to copy setup configurations to, that were cloned from github. 2nd line copies the folder and contents to `$HOME/.lava/config`, and 3rd line the file `genesis.json` to `$HOME/.lava/config`

![You should have the following files in here now](https://storage.googleapis.com/papyrus_images/43df2a8add544ff71599a95b5ff6a34c9e6a80cf19f3b1f0e88f88aeb33db6c8.png)

You should have the following files in here now

**Validator Configurations**

These configurations should be set to help with performance which can be edited in the `~/.lava/config/config.toml`

    create_empty_blocks = true
    create_empty_blocks_interval = "60s"
    timeout_propose = "60s"
    timeout_commit = "60s"
    timeout_broadcast_tx_commit = "601s"
    

4 . Setup lavad to run with systemD
-----------------------------------

Make System service file

    tee /etc/systemd/system/lavad.service << EOF
    [Unit]
    Description=Lava Node
    After=network-online.target
    [Service]
    User=root
    ExecStart=$(which lavad) start --home="$HOME/.lava"
    Restart=always
    RestartSec=30
    LimitNOFILE=infinity
    LimitNPROC=infinity
    [Install]
    WantedBy=multi-user.target
    EOF
    

Enable and Start Service

    systemctl enable lavad
    systemctl daemon-reload
    systemctl start lavad
    

Check running and Check logs with

    systemctl status lavad
    journalctl -u lavad -f
    

![if started with no errors node will be trying to connect to other peers](https://storage.googleapis.com/papyrus_images/f6a080cf608f7a671a36923b3e3e27865bec596a90c69ed8de4d5e0bc13bd3b3.png)

if started with no errors node will be trying to connect to other peers

It might take a while to find peers, and get synced. If having trouble a number of options as follows can be tried.

**Adding an address book**

a number of validators are hosting address books, that you can download to help find peers quicker. Such as

    curl -s https://snapshots1-testnet.nodejumper.io/lava-testnet/addrbook.json > $HOME/.lava/config/addrbook.json 
    

**Snapshot Sync (optional)**

    lavad tendermint unsafe-reset-all --home $HOME/.lava --keep-addr-book
    

![](https://storage.googleapis.com/papyrus_images/47c004ba20931a39aeaac433a979d01777ec82bb464e949e19cbf9ada7a65b73.png)

This resets and deletes current chain data, next to download a snapshot of the chain from one of a number of hosts.

    SNAP_NAME=$(curl -s https://snapshots1-testnet.nodejumper.io/lava-testnet/ | egrep -o ">lava-testnet-1.*\.tar.lz4" | tr -d ">")
    curl https://snapshots1-testnet.nodejumper.io/lava-testnet/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.lava
    

![](https://storage.googleapis.com/papyrus_images/02e0b60bc0703d139a59449c339c8bbf0c7b23fb3e3848dee371a5006f2897d6.png)

**Check Sync**

    curl localhost:26657/status
    

![Look for catching up, this will be false once synced](https://storage.googleapis.com/papyrus_images/f3258f8801af404c97bfd3ea24ba48688c3f057d07060f83282f0beed88f12fc.png)

Look for catching up, this will be false once synced

5\. Wallet Setup
----------------

You need to create a wallet on Lava chain and to fund it with $LAVA (test tokens)

**Option 1: Via Keplr browser extension** (Experimental)

[Keplr](https://www.keplr.app/) is a cosmos based browser extension for Cosmos chains, you can install and setup with keplr then connect to the Lava network below.

[https://docs.lavanet.xyz/wallet/#keplr-integration](https://docs.lavanet.xyz/wallet/#keplr-integration)

**Option 2: Create New Via CLI**

    lavad keys add <your-key-name> --keyring-backend test
    

new account details will be output, the name, public address and your mnemonic phrase. Save your Seed Phrase as this is the only way to recover your wallet. NOTE: Your public address, starts with lava@

**Restore existing wallet**

If you used option 1, then run the following to import it to lavad on your device

    lavad keys add <your-key-name> --keyring-backend test --recover
    

Once a wallet has been created, a working directory `.lava` becomes available and your keys will be stored in `.lava/keyring-test`. find out about [Keyring](https://docs.lavanet.xyz/faq/#keyring) here.

**Show saved accounts/wallets**

    lavad keys list --keyring-backend test
    

**Claim Tokens**

This can be done from discord or via the Faucet API [here](https://docs.lavanet.xyz/faucet).

**Check Balance**

Once tokens have been claimed you can query balance using your own node with

    lavad query bank balances "<YOUR_ADDRESS>" --denom ulava 
    

![](https://storage.googleapis.com/papyrus_images/db8c5a195cf913b8d69a7af2c339ff6d47750161ead94015a3db18a574ae24c9.png)

6\. Create Validator
--------------------

Create Validator Transaction

    lavad tx staking create-validator \
    --amount="<ammount to stake>ulava" \
    --pubkey=$(lavad tendermint show-validator --home "$HOME/.lava/") \
    --moniker="<your name of choice>" \
    --chain-id=lava-testnet-1 \
    --commission-rate="0.10" \
    --commission-max-rate="0.20" \
    --commission-max-change-rate="0.01" \
    --min-self-delegation="1" \
    --gas="auto" \
    --home="$HOME/.lava/" \
    --from=<name of wallet from step5>
    

![](https://storage.googleapis.com/papyrus_images/9a152c8618248308df2f3db947957a5d61b7c818798748757c9533a41aab2a4e.png)

It will broadcast your transaction and output a TX hash you can search on the blockchain explorer, or find your validator node there once confirmed

[

Validators Overview - Lava (LAVA) Blockchain Explorer
-----------------------------------------------------

Meet the validators powering the Lava (LAVA) blockchain. View their performance, staked amount, and rewards.

https://lava.explorers.guru

![](https://storage.googleapis.com/papyrus_images/c64564917b3336448d9e2e3ebf0aafbacca52caaf53f870dfa3f05948430a96f.jpg)

](https://lava.explorers.guru/validators)

Find Valoper address

A validator node, has a unique address Valoper different from the standard derived address from the same seed.

    lavad keys show <wallet-key> --bech val -a
    

See Validator Details

    lavad q staking validator <Valoper address>
    

Useful Commands
---------------

Stop and Restart Node for changes to configs

    systemctl stop lavad
    # make changes to config files in ./lava/config
    # restart service with
    systemctl daemon-reload
    systemctl restart lavad
    

Delegate to validator (add more to own validator)

    lavad tx staking delegate <lava@valoper1...-address> 1000000ulava --chain-id <CHAIN-ID> --from <wallet-name> --gas=auto
    

Withdraw all-rewards & commission

    lavad tx distribution withdraw-rewards <lava@valoper1...-address> --from <wallet-name>  --chain-id <CHAIN-ID> --commission --yes --gas=auto
    

unjail command

    lavad tx slashing unjail --from <wallet_name> --chain-id <CHAIN-ID> --gas=auto
    

Updating Version
----------------

See [HERE](https://docs.lavanet.xyz/testnet-manual#upgrades)

If not using cosmovisor, upgrade the binaries manually with the following steps. You can check for governance to see at what block height the proposal upgrade is to be implemented, **upgrades must be done when this block height is reached**.

    curl localhost:26657/status
    

![for v0.5.2 the upgrade is at block 63760](https://storage.googleapis.com/papyrus_images/b1fd0f8fdb3c30c86e404de5ff802f336eb3b2fc39132e4f8a29fe7f0e409efc.png)

for v0.5.2 the upgrade is at block 63760

**Stop Lava Validator**

    systemctl stop lavad
    

**Set new version**

Look for releases [here](https://github.com/lavanet/lava/releases), and change the `required_upgrade_name` respectively

    temp_folder=$(mktemp -d) && cd $temp_folder
    required_upgrade_name="v0.5.3"
    upgrade_binary_url=https://lava-binary-upgrades.s3.amazonaws.com/testnet/$required_upgrade_name/lavad
    

    source $HOME/.bash_profile
    

**Obtain new binary**

    wget "$upgrade_binary_url" -q -O $temp_folder/lavad
    

Make executable

    chmod +x $temp_folder/lavad
    

**Replace current binary**

    sudo cp $temp_folder/lavad $(which lavad)
    

**Restart Lava Validator**

    systemctl daemon-reload
    systemctl start lavad
    

You can confirm version with `lavad version` check logs and sync with the following

    lavad status | jq .SyncInfo.catching_up
    

### Alternative- If this doesn’t work

If this doesn’t work, it may be that the file path name has changed, you can manually get the file from GitHub from here: [https://github.com/lavanet/lava/releases](https://github.com/lavanet/lava/releases)

Manually copy the link from under assets under specific version

Example (with version 0.6.0)

    wget https://github.com/lavanet/lava/releases/download/v0.6.0/lavad-v0.6.0-RC3-linux-amd64
    

![](https://storage.googleapis.com/papyrus_images/8da1d94a07ba70c18ae7ba6e8e339300148ab006fc37a4effe521a8209b364cb.png)

Make Executable

    chmod +x lavad-v0.6.0-RC3-linux-amd64
    

 Move and rename to the executable files directory

    sudo mv lavad-v0.6.0-RC3-linux-amd64 /root/go/bin/lavad
    

 this method simply downloads the binary to the home folder, you grant permissions then move and rename the now executable file to the right path in the service. Can follow the remaining steps to restart the node.

Server Migration
----------------

Process for migrating validator from one server to another

**1. Backup “priv\_validator\_key.json”**

On the old server that you wish to retire Locate `priv_validator_key.json` it should be in here by default `cd .lava/config/priv_validator_key.json`

**2\. Start Node & Sync New Server**

follow the steps for a validator up until Create wallet (Step 5) allow this node to fully sync, use snapshot for a fast migration. Allow to sync on the New server

**3\. Stop Node on Old Server**

Before inserting the existing validator key on the new server, ensure that the Old Server validator/node is stopped

    systemctl stop lavad.service
    

Shut down the device to be sure, and erase the data/reinstall

**4. Replace the priv\_validator\_key.json on New Server**

Stop the Node on New server

    systemctl stop lavad
    

Open the `priv_validator_key.json` on the New Device for editing. Replace the contents with the contents from original server.

    nano /home/$USER/.lava/config/priv_validator_key.json
    

**5\. Recover wallet on New server**

    lavad keys add <your-key-name> --keyring-backend test --recover
    

**6.  Restart the node on New server**

Setup with Cosmovisor
---------------------

[https://mirror.xyz/0xf3bF9DDbA413825E5DdF92D15b09C2AbD8d190dd/uf8HLudmN9FagaVfXccxNSTbHaMrj7zKmcXrOCY7t3w](https://mirror.xyz/0xf3bF9DDbA413825E5DdF92D15b09C2AbD8d190dd/uf8HLudmN9FagaVfXccxNSTbHaMrj7zKmcXrOCY7t3w)

---

*Originally published on [GLCstaked](https://paragraph.com/@glcstaked/lava-network-validator-node)*
