;

How to run a Lava Node? Complete Guide and Set Up

Airdrop

Posted by Thanh Dat - 08/03/2024

CryptoViet Info

    MỤC LỤC

Unlock the potential of Lava Node with our comprehensive guide to getting set up. Whether you're a beginner or an experienced user, our step-by-step instructions will walk you through the process of running Lava Node effortlessly. 

Follow along to maximize your experience and leverage the full capabilities of this powerful tool. Let's dive in and start exploring the world of Lava Node together!

This article will help you to run a Lava Node. Let's move on with CryptoViet Info for details.

Requirements

To run the Lava node, you need to meet the following conditions:

  • 8 vCPU Cores.
  • 16 GB RAM.
  • 400 GB SSD.

Guide to running Lava Node

Prepare Setup 

sudo apt update && sudo apt upgrade -y

Install Package

sudo apt install git curl wget tar lz4 unzip jq build-essential pkg-config clang bsdmainutils make ncdu -y

Install go

cd $HOME
version="1.20.5"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Set up validator name

LAVA_MONIKER="ABCD"

Note: ABCD = name_validator_you_choose

Download and build binaries

cd $HOME
rm -rf lava
git clone https://github.com/lavanet/lava.git
cd lava
git checkout v0.35.0

# Build binaries

export LAVA_BINARY=lavad
make build

Set up Cosmovisor and create the corresponding service

# Download and install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest

# Prepare binaries for Cosmovisor

mkdir -p $HOME/.lava/cosmovisor/genesis/bin
mv build/lavad $HOME/.lava/cosmovisor/genesis/bin/
rm -rf build

# Create application symlinks

sudo ln -s $HOME/.lava/cosmovisor/genesis $HOME/.lava/cosmovisor/current -f
sudo ln -s $HOME/.lava/cosmovisor/current/bin/lavad /usr/local/bin/lavad -f

Initialize the node

# Set node configuration

lavad config chain-id lava-testnet-2
lavad config keyring-backend test
lavad config node tcp://localhost:14457

# Initialize the node

lavad init $LAVA_MONIKER --chain-id lava-testnet-2

# Download genesis and addrbook

curl -Ls https://snapshots.kjnodes.com/lava-testnet/genesis.json > $HOME/.lava/config/genesis.json
curl -Ls https://snapshots.kjnodes.com/lava-testnet/addrbook.json > $HOME/.lava/config/addrbook.json

# Add seeds

sed -i -e "s|^seeds *=.*|seeds = \"3f472746f46493309650e5a033076689996c8881@lava-testnet.rpc.kjnodes.com:14459\"|" $HOME/.lava/config/config.toml

# Set minimum gas price

sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0ulava\"|" $HOME/.lava/config/app.toml

# Set pruning

sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "19"|' \
  $HOME/.lava/config/app.toml

# Set custom ports

sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:14458\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:14457\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:14460\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:14456\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":14466\"%" $HOME/.lava/config/config.toml
sed -i -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:14417\"%; s%^address = \":8080\"%address = \":14480\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:14490\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:14491\"%; s%:8545%:14445%; s%:8546%:14446%; s%:6065%:14465%" $HOME/.lava/config/app.toml


Update chain-specific configuration

sed -i \
  -e 's/timeout_commit = ".*"/timeout_commit = "30s"/g' \
  -e 's/timeout_propose = ".*"/timeout_propose = "1s"/g' \
  -e 's/timeout_precommit = ".*"/timeout_precommit = "1s"/g' \
  -e 's/timeout_precommit_delta = ".*"/timeout_precommit_delta = "500ms"/g' \
  -e 's/timeout_prevote = ".*"/timeout_prevote = "1s"/g' \
  -e 's/timeout_prevote_delta = ".*"/timeout_prevote_delta = "500ms"/g' \
  -e 's/timeout_propose_delta = ".*"/timeout_propose_delta = "500ms"/g' \
  -e 's/skip_timeout_commit = ".*"/skip_timeout_commit = false/g' \
  $HOME/.lava/config/config.toml

Download latest chain snapshot

curl -L https://snapshots.kjnodes.com/lava-testnet/snapshot_latest.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.lava
[[ -f $HOME/.lava/data/upgrade-info.json ]] && cp $HOME/.lava/data/upgrade-info.json $HOME/.lava/cosmovisor/genesis/upgrade-info.json

Create service

sudo tee /etc/systemd/system/lava.service > /dev/null << EOF
[Unit]
Description=lava node service
After=network-online.target

[Service] User=$USER ExecStart=$(which cosmovisor) run start Restart=on-failure RestartSec=10 LimitNOFILE=65535 Environment="DAEMON_HOME=$HOME/.lava" Environment="DAEMON_NAME=lavad" Environment="UNSAFE_SKIP_BACKUP=true"

[Install] WantedBy=multi-user.target EOF

Start Service

sudo -S systemctl daemon-reload
sudo -S systemctl enable lava
sudo -S systemctl start lava
sudo systemctl status lava
sudo journalctl -u lava.service -f --no-hostname -o cat

Becoming a validator

Create wallet

lavad keys add wallet

Details such as name, address, public key, and the seed phrase are crucial and should be saved.

Faucet Lava token

Visit Lava's discord here: https://discord.com/invite/Tbk5NxTCdA

$request lava@1s4.... 

Note: lava@1s4.... is the lava wallet address you created in the step above. You need to get at least 0.2 LAVA to be able to create your validator.

Save the private validator key

cat $HOME/.lava/config/priv_validator_key.json

Please saved this file.

Check status synced

lavad status 2>&1 | jq .SyncInfo.catching_up

As soon as the value of catching_up becomes “false”.

Create a validator


lavad tx staking create-validator -y \
--chain-id lava-testnet-2 \
--moniker name_moniker \
--gas auto \
--gas-adjustment 1.5 \
--pubkey "$(lavad tendermint show-validator)" \
--amount 100000ulava \
--details "Build details..." \
--from wallet \
--commission-rate=0.1 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation 1

Ensure you replace your_moniker and details with your actual moniker.

You can check your Validator status here. Please allow some time for your validator to be added to the Lava Validator list: https://lava.explorers.guru/validators. 

Conclusion

We have completed the Guide to running Lava Node. If you encounter any errors while running Lava Node, please join our Telegram group for assistance.

For more:

DISCLAIMER: Thông tin trên trang web này chỉ được cung cấp cho mục đích thông tin và không đại diện cho lời khuyên đầu tư. Để đưa ra quyết định đầu tư, chúng tôi khuyên bạn nên tự nghiên cứu.

Có thể bạn sẽ quan tâm

Recent PostPopular Post
Categories
Follow Us
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
CryptoViet Info
©2017 CryptoViet Info. All Rights ReservedMedia Kit