# Lava Full Node **Published by:** [GLCstaked](https://paragraph.com/@glcstaked/) **Published on:** 2023-07-06 **URL:** https://paragraph.com/@glcstaked/lava-full-node ## Content Deploy a full node for Lava chain, this is a non-validating node. NOTE: this is for current lava-testnet-2 Document Last Update: 14/09/23 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.xyzLava Chain: is a cosmos PoS layer 1 with $LAVA for settlement, validator nodes secure the chain. 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 providersHardware requirements: For Full (current Testnet): 8GB RAM /100GB SSD Storage/ CPU 4v x64 2.0 GHz. These are minimum specs, and I would recommend more.1. Initial SetupUpdate and install dependenciessudo apt update && sudo apt upgrade -y sudo apt install git curl wget tar unzip jq build-essential pkg-config clang bsdmainutils make ncdu -y Install Go Use version 1.20.5 for current binarywget -q -O - https://git.io/vQhTU | bash -s -- --version 1.20.5 Run source $HOME/.bashrc to take effect Confirm install is successfulgo version This script is made by osmosis-labs and installs PATH variables to .bashrc and sets up in a way compatible with the rest of the build. Go binary installs to $HOME/.go and $HOME/go/bin#to remove installation wget -q -O - https://git.io/vQhTU | bash -s -- --remove 2. Download Lava BinaryNote: downloading the latest binary requires snapshot Check for latest version here: replace version accordingly, always use the version tagged latest Select binary type. Lava is split into two binaries which handle different functions, lava-visor handles consensus for lava, while lava-protocol is the process for provider node. For lava full node lavad For provider node lava-providerexport LAVA_BINARY=lavad cd $HOME git clone https://github.com/lavanet/lava.git cd lava git checkout v0.22.0 make install Confirm installedwhich lavad lavad --help When running the binary 1st time it creates the working folder .lava with the following files, app.toml, client.toml, config.toml3. Lava CLIclient.toml: Configuration file for using the lava CLI If not setting up as a full node and syncing the data, you can add a public RPC. This adds to the client.toml Skip this step if using your own (following the rest of this guide), the default is tcp://localhost:26657lavad config node https://public-rpc.lavanet.xyz:443/rpc/ Set Keyring backend and chain-idlavad config chain-id lava-testnet-2 lavad config keyring-backend test Set Variables:LAVA_WALLET="NAME OF WALLET" LAVA_MONIKER="NAME OF CHOICE FOR NODE" Adding Wallet:# create new lavad keys add $LAVA_WALLET --keyring-backend test # to restore from seed lavad keys add $LAVA_WALLET --keyring-backend test --recover 4. Configure Lava NodeConfiguration of lavad to run as a full node with Snapshot Initialize nodelavad init $LAVA_MONIKER --chain-id lava-testnet-2 Get Genesiswget -O $HOME/.lava/config/genesis.json "https://raw.githubusercontent.com/lavanet/lava-config/main/testnet-2/genesis_json/genesis.json" Set Min Gas Price This needs to be configured to avoid an errorsed -i -e 's|^minimum-gas-prices = ".*"|minimum-gas-prices = "0ulava"|' $HOME/.lava/config/app.toml Set SeedsSEEDS="3a445bfdbe2d0c8ee82461633aa3af31bc2b4dc0@testnet2-seed-node.lavanet.xyz:26656,e593c7a9ca61f5616119d6beb5bd8ef5dd28d62d@testnet2-seed-node2.lavanet.xyz:26656,258f523c96efde50d5fe0a9faeea8a3e83be22ca@seed.lava-testnet-2.lava.aviaone.com:20271,3a445bfdbe2d0c8ee82461633aa3af31bc2b4dc0@testnet2-seed-node.lavanet.xyz:26656,e593c7a9ca61f5616119d6beb5bd8ef5dd28d62d@testnet2-seed-node2.lavanet.xyz:26656" PEERS="" sed -i 's|^seeds *=.*|seeds = "'$SEEDS'"|; s|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.lava/config/config.toml Download Address-book This can aid in finding peers quicker, many validators host this, example is with AviaOnewget -O $HOME/.lava/config/addrbook.json "https://services.lava-testnet-2.lava.aviaone.com/addrbook.json" 5. Download Chain data (Snapshot)This install method is using snapshot data, this means downloading the blockchain history directly from a trusted source, many community members host this data example: Kjnodes, AviaOne, Skynodes, bccnodes If you have previously started the node and started to sync the chain, you will need to clear the data to use snapshotlavad tendermint unsafe-reset-all $HOME/.lava --keep-addr-book Get Snapshot URL, from one of the providers aboveSNAPSHOT_URL="COPY URL TO RECENT SNAPSHOT HERE" Depending on Provider, you may have gz or lz4 extension files Option 1: Download Snapshot gz extensioncp $HOME/.lava/data/priv_validator_state.json $HOME/.lava/priv_validator_state.json.backup rm -rf $HOME/.lava/data $HOME/.lava/wasm wget -c $SNAPSHOT_URL $ -O - | tar -xz -C $HOME/.lava mv $HOME/.lava/priv_validator_state.json.backup $HOME/.lava/data/priv_validator_state.json Option 2: Download Snapshot lz4 extension# get packages required to unpack data sudo apt install snapd -y sudo snap install lz4 # Download Snapshot cp $HOME/.lava/data/priv_validator_state.json $HOME/.lava/priv_validator_state.json.backup rm -rf $HOME/.lava/data $HOME/.lava/wasm curl -L $SNAPSHOT_URL | tar -Ilz4 -xf - -C $HOME/.lava mv $HOME/.lava/priv_validator_state.json.backup $HOME/.lava/data/priv_validator_state.json Adjust Pruning settings for Snapshot WARNING: Check with snapshot provider to confirm and adjust the app.toml accordingly for pruning settings, as these values may be different depending on provider.change to pruning = “custom” Adjust the config.toml accordingly for indexer settings7. Set up SystemD for Lava NodeOption 1: without CosmovisorSet up a system service to run the lava nodesudo tee /etc/systemd/system/lavad.service > /dev/null <<EOF [Unit] Description=LAVA\n After=network.target [Service] Type=simple User=$USER ExecStart=$(which lavad) start Restart=on-failure RestartSec=10 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF Enable and Start servicesudo systemctl daemon-reload sudo systemctl enable lavad sudo systemctl start lavad Check status and logssudo systemctl status lavad journalctl -u lavad -f Synced & working node will look similarStop servicesudo systemctl stop lavad Make changes to service filesudo nano /etc/systemd/system/lavad.service Check Node Sync status# Query via the RPC (default port: 26657) curl http://localhost:26657/status | jq .result.sync_info.catching_up Option 2: with CosmovisorCosmovisor: is a process management tool to handle cosmos-based chain upgrades seamlessly, it looks for chain upgrades and downloads & installs at the correct block height. Create directories for Cosmovisorcd mkdir -p ~/.lava/cosmovisor/genesis/bin mkdir -p ~/.lava/cosmovisor/upgrades create directory for corresponding binary version (change v0.22.0 accordingly)mkdir -p ~/.lava/cosmovisor/upgrades/v0.22.0/bin Install Cosmovisor binarygo install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest this should install Cosmovisor binary to $GOPATH/bin/cosmovisor Copy binaries to Cosmovisor Note on versions: if using snapshot (this guide) you are downloading the latest binary, with chain data manually downloaded and placed in the correct location, Cosmovisor will look from the block height the node is currently on and the corresponding binary in the upgrades folder. The binary also needs to be placed in ~/.lava/cosmovisor/genesis/bin for first start up or an error will occur.cp $GOPATH/bin/lavad ~/.lava/cosmovisor/genesis/bin cp $GOPATH/bin/lavad ~/.lava/cosmovisor/upgrades/v0.22.0/bin/ Create system service: Set up a system service to run the lava node through Cosmovisorsudo tee /etc/systemd/system/cosmovisor.service > /dev/null <<EOF [Unit] Description=lava Daemon (cosmovisor) After=network-online.target [Service] User=$USER ExecStart=$HOME/go/bin/cosmovisor run start Restart=always RestartSec=10 LimitNOFILE=65535 Environment="DAEMON_NAME=lavad" Environment="DAEMON_HOME=$HOME/.lava" Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true" Environment="DAEMON_RESTART_AFTER_UPGRADE=true" Environment="DAEMON_LOG_BUFFER_SIZE=512" [Install] WantedBy=multi-user.target EOF Enable and Start servicesudo systemctl daemon-reload sudo systemctl enable cosmovisor sudo systemctl start cosmovisor Additional Settings to Open Node for API callsEdit RPC/gRPC server configurations Edit Configurations to ensure APIs are open and reachable on all servers, to expose externally change to 0.0.0.0 which will listen for requests from any IP. If configuring with a sub-domain process (setup locally) then localhost should be used, as these API ports would only need to be exposed to the host. Ports can be changed, if need be but will need to be changed in any other services that connect. Open RPC: in config.toml# TCP or UNIX socket address for the RPC server to listen on laddr = "tcp://0.0.0.0:26657" # TCP or UNIX socket address for the gRPC server to listen on # NOTE: This server only supports /broadcast_tx_commit grpc_laddr = "" Open REST API: in app.toml[api] # Enable defines if the API server should be enabled. enable = true # Swagger defines if swagger documentation should automatically be registered. swagger = false # Address defines the API server to listen on. address = "tcp://0.0.0.0:1317" Open gRPC: in app.toml[grpc] # Enable defines if the gRPC server should be enabled. enable = true # Address defines the gRPC server address to bind to. address = "tcp://0.0.0.0:9090" Open Ports in Firewall settingssudo ufw allow 26657 # RPC sudo ufw allow 26656 # P2P Port sudo ufw allow 1317 # REST sudo ufw allow 9090 # gRPC # Ensure do not get locked ot if on VPS sudo ufw allow shh sudo ufw enable Port forward these ports from router if running local ## 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