Lava
Run the node
Recommended Hardware Requirements
- 🖼️ Provider
- 🖼️ Validator
Before start install Lava provider, you must ensure you have:
- Your own domain (If yet buy one: namecheap
- Lava node running
- Lavap binaries installed
Step 1: Setup A record for your domain
Go to DNS setting:
- Create A record: Host = LAVA; Value = Your server public IP.
Step 2: Install Required Dependencies
sudo apt update
sudo apt install certbot net-tools nginx python3-certbot-nginx -y
Step 3: Generate Certificate
sudo certbot certonly -d yourdomain.com -d LAVA.yourdomain.com
Select 1 for Nginx Web Server Plugin
Enter your valid email
Step 4: Validate Certificate
sudo certbot certificates
Step 5: Create Nginx server
cd /etc/nginx/sites-available/
sudo nano lava_server
Copy & Paste
server {
listen 443 ssl http2;
server_name lava.your-domain.com;
ssl_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/your-domain.com/privkey.pem;
error_log /var/log/nginx/debug.log debug;
location / {
proxy_pass http://127.0.0.1:2224;
grpc_pass 127.0.0.1:2224;
}
}
Step 6: Create a link
sudo ln -s /etc/nginx/sites-available/lava_server /etc/nginx/sites-enabled/lava_server
Step 7: Test Nginx Configuration
sudo nginx -t
Expected result
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Step 8: Run Nginx
sudo systemctl restart nginx
Step 9: Create Docker file
cd ~/lava/config
nano lava-provider.yml
Copy & Paste
endpoints:
- api-interface: tendermintrpc
chain-id: LAV1
network-address:
address: 127.0.0.1:2224
disable-tls: true
node-urls:
- url: ws://127.0.0.1:26657/websocket
- url: http://127.0.0.1:26657
- api-interface: grpc
chain-id: LAV1
network-address:
address: 127.0.0.1:2224
disable-tls: true
node-urls:
url: 127.0.0.1:9090
- api-interface: rest
chain-id: LAV1
network-address:
address: 127.0.0.1:2224
disable-tls: true
node-urls:
url: http://127.0.0.1:1317
Step 10: Create reward storage
mkdir /root/.lava/config/reward/
Step 10: Run Docker
screen -S lava-provider
lavap rpcprovider lava-provider.yml --from Adam_VNBnode --geolocation 1 --chain-id lava-testnet-2 --reward-server-storage /root/.lava/config/reward/ --log_level debug
Expected result
Step 11: Test RPC provider
lavap test rpcprovider --from $MONIKER --endpoints "lava.your-domain.com:443,LAV1"
Expected result
Step 12: Stake the Provider on Chain
Make sure your wallet have enough token lava
lavap tx pairing stake-provider LAV1 "50000000000ulava" "lava.your-domain.com:443,1" 1 --from $MONIKER --provider-moniker $MONIKER --keyring-backend "test" --chain-id "lava-testnet-2" --gas="auto" --gas-adjustment "1.5" --gas "auto" --gas-prices "0.0001ulava"
Step 13: Test RPC provider again
lavap test rpcprovider --from $MONIKER --endpoints "lava.your-domain.com:443,LAV1"
Step 14: Check the status of RPC provider
https://info.lavanet.xyz/provider/ Enter your wallet address & Enjoy
1.Set Validator nam
MONIKER="Your-name_VNBnode"
2.Update system
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
3. Install Go version 1.20.5
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.20.5.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
4. Install GCC
sudo apt install build-essential
5. Install all Binaries 🛠️
git clone https://github.com/lavanet/lava.git
cd lava
make install-all
Check version
lavad version && lavap version
6.Build all Binaries
make build-all
7. Set up a local node
Download app configurations
- Download setup configuration Download the configuration files needed for the installation
# Download the installation setup configuration
git clone https://github.com/lavanet/lava-config.git
cd lava-config/testnet-2
# Read the configuration from the file
# Note: you can take a look at the config file and verify configurations
source setup_config/setup_config.sh
- Set app configurations Copy lavad default config files to config Lava config folder
echo "Lava config file path: $lava_config_folder"
mkdir -p $lavad_home_folder
mkdir -p $lava_config_folder
cp default_lavad_config_files/* $lava_config_folder
Set the genesis file
- Set the genesis file in the configuration folder
# Copy the genesis.json file to the Lava config folder
cp genesis_json/genesis.json $lava_config_folder/genesis.json
Set up Cosmovisor
- Set up cosmovisor to ensure any future upgrades happen flawlessly. To install Cosmovisor:
go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/[email protected]
# Create the Cosmovisor folder and copy config files to it
mkdir -p $lavad_home_folder/cosmovisor/genesis/bin/
# Download the genesis binary
wget -O $lavad_home_folder/cosmovisor/genesis/bin/lavad "https://github.com/lavanet/lava/releases/download/v0.21.1.2/lavad-v0.21.1.2-linux-amd64"
chmod +x $lavad_home_folder/cosmovisor/genesis/bin/lavad
# Set the environment variables
echo "# Setup Cosmovisor" >> ~/.profile
echo "export DAEMON_NAME=lavad" >> ~/.profile
echo "export CHAIN_ID=lava-testnet-2" >> ~/.profile
echo "export DAEMON_HOME=$HOME/.lava" >> ~/.profile
echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> ~/.profile
echo "export DAEMON_LOG_BUFFER_SIZE=512" >> ~/.profile
echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.profile
echo "export UNSAFE_SKIP_BACKUP=true" >> ~/.profile
source ~/.profile
Initialize the chain
$lavad_home_folder/cosmovisor/genesis/bin/lavad init \
my-node \
--chain-id lava-testnet-2 \
--home $lavad_home_folder \
--overwrite
cp genesis_json/genesis.json $lava_config_folder/genesis.json
Check version
cosmovisor version
Create Cosmovisor unit file
echo "[Unit]
Description=Cosmovisor daemon
After=network-online.target
[Service]
Environment="DAEMON_NAME=lavad"
Environment="DAEMON_HOME=${HOME}/.lava"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
User=$USER
ExecStart=${HOME}/go/bin/cosmovisor start --home=$lavad_home_folder --p2p.seeds $seed_node
Restart=always
RestartSec=3
LimitNOFILE=infinity
LimitNPROC=infinity
[Install]
WantedBy=multi-user.target
" >cosmovisor.service
sudo mv cosmovisor.service /lib/systemd/system/cosmovisor.service
Enable and start the Cosmovisor service
# Enable the cosmovisor service so that it will start automatically when the system boots
sudo systemctl daemon-reload
sudo systemctl enable cosmovisor.service
sudo systemctl restart systemd-journald
sudo systemctl start cosmovisor
Verify cosmovisor setup
- Check the status of the service
sudo systemctl status cosmovisor
- To view the service logs - to escape, hit CTRL+C
sudo journalctl -u cosmovisor -f
Verify node status
# Check if the node is currently in the process of catching up
$HOME/.lava/cosmovisor/current/bin/lavad status | jq .SyncInfo.catching_up
Ensure your node synched & Wait until you see the output: "false"
8. Create wallet
current_lavad_binary="$HOME/.lava/cosmovisor/current/bin/lavad"
ACCOUNT_NAME=$MONIKER
$current_lavad_binary keys add $ACCOUNT_NAME
Ensure you write down the mnemonic as you can not recover the wallet without it
List the key & Wallet
$current_lavad_binary keys list
obtain your validator pubkey
$current_lavad_binary tendermint show-validator
Check balance of your account
YOUR_ADDRESS=$($current_lavad_binary keys show -a $ACCOUNT_NAME)
$current_lavad_binary query \
bank balances \
$YOUR_ADDRESS \
--denom ulava
9. Stake as validator
$current_lavad_binary tx staking create-validator \
--amount="10000ulava" \
--pubkey=$($current_lavad_binary tendermint show-validator --home "$HOME/.lava/") \
--moniker="Your-name_VNBnode" \
--chain-id=lava-testnet-2 \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="10000" \
--gas="auto" \
--gas-adjustment "1.5" \
--gas-prices="0.05ulava" \
--home="$HOME/.lava/" \
--from=$ACCOUNT_NAME