✔️Lava network

Install go

cd $HOME 
VER="1.20.3" 
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go 
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz" 
rm "go$VER.linux-amd64.tar.gz" 
[ ! -f ~/.bash_profile ] && touch /.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile [ ! -d ~/go/bin ] && mkdir -p ~/go/bin

set vars

echo "export WALLET="wallet"" >> $HOME/.bash_profile 
echo "export MONIKER="test"" >> $HOME/.bash_profile 
echo "export LAVA_CHAIN_ID="lava-testnet-2"" >> $HOME/.bash_profile
echo "export LAVA_PORT="20"" >> $HOME/.bash_profile 
source $HOME/.bash_profile

download binary

cd $HOME
wget -O lavad https://github.com/lavanet/lava/releases/download/v2.1.3/lavad-v2.1.3-linux-amd64 chmod +x $HOME/lavad 
mv $HOME/lavad $HOME/go/bin/lavad

config and init app

lavad init $MONIKER --chain-id $LAVA_CHAIN_ID
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 genesis and addrbook

wget -O $HOME/.lava/config/genesis.json https://testnet-files.itrocket.net/lava/genesis.json
wget -O $HOME/.lava/config/addrbook.json https://testnet-files.itrocket.net/lava/addrbook.json

set seeds and peers

SEEDS="eb7832932626c1c636d16e0beb49e0e4498fbd5e@lava-testnet-seed.itrocket.net:20656"
PEERS="3693ea5a8a9c0590440a7d6c9a98a022ce3b2455@lava-testnet-peer.itrocket.net:20656,1f7e104872a3f4259343b8123f333b5b24869b02@159.89.111.21:26656,e28b8ad6e20fda1e647c977fb256208b91b74893@116.202.80.186:14456,6c398d8133a0a38c85001d2a3f01db51d064d7aa@31.220.90.180:24656,02b9b02ff18a6494f6b734772db2c7407c431c42@154.38.167.188:26656,ed295c3ece2ded17ea4007a680154db83abeca13@95.217.114.220:13656,0314d53cc790860fb51f36ac656a19789800ce5c@176.103.222.20:26656,51aeaa2c757989f720c904023c2dbedfc720f75e@23.88.5.169:27656,112fba64a7e5e27b0cf8f02c634334c957891abf@75.119.146.244:28656,614fbca7895114d5c985d57c7e20edcde8a9d98e@5.9.61.120:18656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
       -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.lava/config/config.toml

set custom ports in app.toml

sed -i.bak -e "s%:1317%:${LAVA_PORT}317%g;
s%:8080%:${LAVA_PORT}080%g;
s%:9090%:${LAVA_PORT}090%g;
s%:9091%:${LAVA_PORT}091%g;
s%:8545%:${LAVA_PORT}545%g;
s%:8546%:${LAVA_PORT}546%g;
s%:6065%:${LAVA_PORT}065%g" $HOME/.lava/config/app.toml

set custom ports in config.toml file

sed -i.bak -e "s%:26658%:${LAVA_PORT}658%g;
s%:26657%:${LAVA_PORT}657%g;
s%:6060%:${LAVA_PORT}060%g;
s%:26656%:${LAVA_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${LAVA_PORT}656\"%;
s%:26660%:${LAVA_PORT}660%g" $HOME/.lava/config/config.toml

config pruning

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

set minimum gas price, enable prometheus and disable indexing

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.0ulava"|g' $HOME/.lava/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.lava/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.lava/config/config.toml

create service file

sudo tee /etc/systemd/system/lavad.service > /dev/null <<EOF
[Unit]
Description=Lava node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.lava
ExecStart=$(which lavad) start --home $HOME/.lava
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

reset and download snapshot

lavad tendermint unsafe-reset-all --home $HOME/.lava
if curl -s --head curl https://testnet-files.itrocket.net/lava/snap_lava.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
  curl https://testnet-files.itrocket.net/lava/snap_lava.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.lava
    else
  echo no have snap
fi

enable and start service

sudo systemctl daemon-reload
sudo systemctl enable lavad
sudo systemctl restart lavad && sudo journalctl -u lavad -f

Last updated