# Lava Network- Validator Node **Published by:** [GLCstaked](https://paragraph.com/@glcstaked/) **Published on:** 2023-01-06 **URL:** https://paragraph.com/@glcstaked/lava-network-validator-node ## Content Lava Protocol, a crypto-market which powers a decentralized RPC layer for Web3.Lava Network2.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.xyzMain ConceptsLava 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 providersSetup Validator NodeThis 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.04LTS1. Install dependencies and setup serverSwitch to root user, can exit any time with exitsudo -i Update your system and repositoriesapt update && apt upgrade -y Install Dependencies The following packages required for lava nodesudo 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/localver="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 PATHecho "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile source $HOME/.bash_profile Confirm installed with go versionFirewall Settings Outbound - allow all traffic. Inbound - open the following ports: 1317 - REST, 26657 - TENDERMINT_RPC, 26656 - Cosmossudo 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 PATH3. Download setup configurationsCopy lavad default config files to config Lava config folder, and set genesis JSON file in the configuration folder, obtain files from heregit clone https://github.com/K433QLtr6RA9ExEq/GHFkqmTzpdNLDd6T.git cd GHFkqmTzpdNLDd6T/testnet-1 in here you can see the configurations, source setup_config/setup_config.shmkdir -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/configYou should have the following files in here nowValidator Configurations These configurations should be set to help with performance which can be edited in the ~/.lava/config/config.tomlcreate_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 systemDMake System service filetee /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 Servicesystemctl enable lavad systemctl daemon-reload systemctl start lavad Check running and Check logs withsystemctl status lavad journalctl -u lavad -f if started with no errors node will be trying to connect to other peersIt 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 ascurl -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 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 Check Synccurl localhost:26657/status Look for catching up, this will be false once synced5. Wallet SetupYou need to create a wallet on Lava chain and to fund it with $LAVA (test tokens) Option 1: Via Keplr browser extension (Experimental) Keplr 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 Option 2: Create New Via CLIlavad 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 devicelavad 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 here. Show saved accounts/walletslavad keys list --keyring-backend test Claim Tokens This can be done from discord or via the Faucet API here. Check Balance Once tokens have been claimed you can query balance using your own node withlavad query bank balances "<YOUR_ADDRESS>" --denom ulava 6. Create ValidatorCreate Validator Transactionlavad 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> It will broadcast your transaction and output a TX hash you can search on the blockchain explorer, or find your validator node there once confirmedValidators Overview - Lava (LAVA) Blockchain ExplorerMeet the validators powering the Lava (LAVA) blockchain. View their performance, staked amount, and rewards.https://lava.explorers.guruFind 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 Detailslavad q staking validator <Valoper address> Useful CommandsStop and Restart Node for changes to configssystemctl 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 & commissionlavad tx distribution withdraw-rewards <lava@valoper1...-address> --from <wallet-name> --chain-id <CHAIN-ID> --commission --yes --gas=auto unjail commandlavad tx slashing unjail --from <wallet_name> --chain-id <CHAIN-ID> --gas=auto Updating VersionSee HERE 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 63760Stop Lava Validatorsystemctl stop lavad Set new version Look for releases here, and change the required_upgrade_name respectivelytemp_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 binarywget "$upgrade_binary_url" -q -O $temp_folder/lavad Make executablechmod +x $temp_folder/lavad Replace current binarysudo cp $temp_folder/lavad $(which lavad) Restart Lava Validatorsystemctl daemon-reload systemctl start lavad You can confirm version with lavad version check logs and sync with the followinglavad status | jq .SyncInfo.catching_up Alternative- If this doesn’t workIf 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 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 Make Executablechmod +x lavad-v0.6.0-RC3-linux-amd64 Move and rename to the executable files directorysudo 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 MigrationProcess 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 stoppedsystemctl 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 serversystemctl 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 serverlavad keys add <your-key-name> --keyring-backend test --recover 6. Restart the node on New serverSetup with Cosmovisorhttps://mirror.xyz/0xf3bF9DDbA413825E5DdF92D15b09C2AbD8d190dd/uf8HLudmN9FagaVfXccxNSTbHaMrj7zKmcXrOCY7t3w ## Publication Information - [GLCstaked](https://paragraph.com/@glcstaked/): Publication homepage - [All Posts](https://paragraph.com/@glcstaked/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@glcstaked): Subscribe to updates