Skip to main content

Kava Node Setup Guide

This guide presents you the Kava Node setup for Mainnet.

Prerequisites

Storage

The monthly storage requirements for a node are as follows. These are estimated values based on experience, but should serve as a good guide.

  • An archival node (pruning = "nothing") grows at a rate of ~100 GB per month Current total disk usage is 6TB, so a larger disk would be necessary.
  • A full pruning node (pruning = "everything") grows at a rate of ~5 GB per month
  • A default pruning node (pruning = “default”) grows at a rate of ~25 GB per month

Memory

The minimum memory requirements for a node are as follows. These are estimated values based on experience, but should serve as a good guide.

  • An archival node (pruning = "nothing") should have at least 128GB of dedicated memory (256GB is optimal to avoid possible OOM errors due to other system utilization)
  • A full pruning node (pruning = "everything") should have at least 64GB of dedicated memory
  • A default pruning node (pruning = “default”) should have at least 64GB of dedicated memory

Install Kava

Mainnet

git clone https://github.com/kava-labs/kava
cd kava
git checkout [release tag]
make install

#verify versions
kava version --long

Setup Kava Node

Initialize Kava Config

kava init [your_moniker_name] --chain-id kava_2222-10
kava tendermint unsafe-reset-all --home $HOME/.kava
cd $HOME/.kava/config
rm genesis.json

Setup the Genesis File

wget https://kava-genesis-files.s3.us-east-1.amazonaws.com/kava_2222-10/genesis.json

Edit $HOME/.kava/config/config.toml to add the following persistent peers.

Mainnet

persistent_peers = "2a15d9c39eea97b4cf00480b45d4ea32a2e173d0@94.130.78.22:26656,5a933891627e8bde0c4bd0b43c9f99b706e520a2@141.95.99.214:11656,ab3064c37d406245fa2d6e6109395518e8ac8a4c@95.111.255.148:26656,41d88639239c55fd37279d24df507238e1c417ea@85.237.192.104:26656,b23050c89f8cb2f4099688b2bcd60f49b15f41d1@95.214.53.217:26656,d5db8898d40054c07442f3364b32f7fac2752f5e@188.34.178.92:26656,fc34d9a3aff6026a3dbd531a96a50680df61dd91@50.116.3.21:26656,50e4cad7d5e28f7b6495168f92e12bf810e293fd@142.132.152.187:10856,6885971cdb724fa93034fb9e6a11113a6f555d2a@15.235.53.92:11656,7b5a2b519cb5a7d70f0fc5842829d4cce1262585@65.108.121.153:26656,51cfccb07d5a45efdf98d005159c01f0656751ad@54.165.27.59:26656,f7c894901f450b92614fd051d10854d168ec30b5@65.21.94.20:10856,7393ed21b6dc516fcc0ad33c4fe42bdd295d2795@18.206.217.244:26656,508d7ec33c7f3c9c479ca9b845cadbbefee670f7@162.55.133.237:21656,d68410115d7681196651e7fece9e4cafc0456856@3.0.206.176:26656,4cfdd459466cfd492d66b7a5fe26cde96e35d735@182.48.203.7:26656,63ec88e98fc267fb82fa62a51ca5c0a2c115d749@51.38.53.4:27656,ebc272824924ea1a27ea3183dd0b9ba713494f83@185.16.39.172:26656,4efe3caf3b8c0ca197d40756f3bb1bd6081bf18d@51.210.220.20:36656,c124ce0b508e8b9ed1c5b6957f362225659b5343@136.243.248.185:26656,82588f011491c6100d922d133f52fc23460b9231@95.217.91.233:26656,8b5c4a890c8ae7efbbe3360af71be1c3c3a9e12e@121.78.241.68:46656,ce203135031ab08fc0ddff5bd13806e25f21b91d@3.115.125.121:26656,dcd6026ebe5586ed0e94751090f8290b5997666b@5.189.165.172:26656,bc61c26018f65e54232b7e9e99bf7599dffeb78b@13.56.56.180:26656"\\
seeds = "b334e291ac361f9a1cf253d290047700b488b679@52.2.147.96:26656"

Add minimum gas prices into app.toml

minimum-gas-prices = "0.025ukava;1000000000akava"

Do the rest of the port configuration as desired; The EVM configuration and ports can be found in the app.toml under section "EVM Configuration"

Setting Up Your Pruning Node

To setup a pruning node, you can:

  • Go to Quicksync and download the .tar pruned file
  • Sync without the pruned file

Please note that Quicksync’s pruning nodes snapshots should be run using Goleveldb flag for your setup.

Setting Up Your Archival Node

To setup an archival node, you must download the correct version of the kava node data and sync a node:

  • Go to Quicksync and download the archive .tar archive file to be used (please note that you should only download this file once)
  • Ensure you are using the correct network (current mainnet=kava_2222-10)
  • Ensure you compile your archive node with rocksdb flag for your setup

Creating a New Data Folder Using Node Tar File

Requirements:
  • Ensure the kava process is not running
  • Disk large enough for the data directory, which is around 6TB uncompressed. Ideally 12TB for room for growth
  • Zst compression library:
sudo apt-get install zstd

Steps:

  1. Downloading the tar file
  • Example using aria2c:
aria2c --continue -x16 --file-allocation=falloc
  1. Extract the tar file
tar -I unzstd -xvf - -C /path/to/your/kava/data
  1. Replace data directory in your kava directory with the extracted data if necessary.

Compiling Kava with RocksDB Support

The provided quicksync archive snapshot is from a Kava mainnet node that uses RocksDB as the database backend. RocksDB is used as a more efficient and performant choice for Kava’s production infrastructure than the default GolevelDB database backend.

Config Recommendations

  1. Set lazy loading on in the app.toml file for faster initial load (optional)
iavl-lazy-loading = true
  1. Ensure rocksdb is enabled in the config.toml file
db_backend = "rocksdb"

Install RocksDB on your system

Install RocksDB on your machine, use version v8.1.1

Compiling Kava binary with RocksDB flag

  • Check out Kava mainnet version source code
  • Change into that directory
  • Run make install COSMOS_BUILD_OPTIONS=rocksdb

Building Kava using Docker Images

If you are using docker to build kava using rocksdb please utilize the docker file in your configuration.

Syncing Your Node

To sync your node, you will use systemd, which manages the Kava daemon and automatically restarts it in case of failure. To use systemd, you will create a service file. Be sure to replace <your_user> with the user on your server:

sudo tee /etc/systemd/system/kava.service > /dev/null <<'EOF'
[Unit]
Description=Kava daemon
After=network-online.target

[Service]
User=<your_user>
ExecStart=/home/<your_user>/go/bin/kava start
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
EOF

To start syncing:

# Start the node
sudo systemctl enable kava
sudo systemctl start kava

To check on the status of syncing:

kava status --log_format json | jq '.sync_info'

This will give output like:

{
"latest_block_hash": "920E4D32F02CFF8064D26DD7D34C65DC623F4026C65C192BBCD7DBF19AFB5630",
"latest_app_hash": "442E7E55982109D9F73467EA0E374312B402AE620DEC81CB3441E949ED0D0A29",
"latest_block_height": "2437",
"latest_block_time": "2022-05-25T23:07:36.752766828Z",
"earliest_block_hash": "9D2AF876309BB9174604004A813DCFEE94F4947B08C5BB4C1A042F318488851E",
"earliest_app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",
"earliest_block_height": "1",
"earliest_block_time": "2022-05-25T17:00:00Z",
"catching_up": true
}

The main thing to watch is that the block height is increasing. Once you are caught up with the chain, catching_up will become false. At that point, you can start using your node to create a validator.

To check the logs of the node:

sudo journalctl -u kava -f

Create Validator Node

If you would like to setup a validator, continue the steps outlined in Run Validator Node