Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Kava node
#!/bin/bash
# Upgrade the system and install go
sudo apt update
sudo apt upgrade -y
sudo apt install gcc git make -y
sudo snap install --classic go
sudo mkdir -p /opt/go/bin
# Export environment variables
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
# Create a system user for running the service
sudo useradd -m -d /opt/kvd --system --shell /usr/sbin/nologin kvd
sudo -u kvd mkdir -p /opt/kvd/config
# Get Kava and build binaries
git clone https://github.com/Kava-Labs/kava.git
go install ./cmd/kvd ./cmd/kvcli
cd
# Copy the binaries to /opt/go/bin/
sudo cp $HOME/go/bin/kv* /opt/go/bin/
# Create systemd unit file
echo "[Unit]
Description=Kava Node
After=network-online.target
[Service]
User=kvd
ExecStart=/opt/go/bin/kvd start --home=/opt/kvd/
Restart=always
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target" > kvd.service
sudo mv kvd.service /etc/systemd/system/
sudo systemctl enable kvd.service
# Create the config skeleton as user gaiad
sudo -u kvd /opt/go/bin/kvd unsafe-reset-all --home=/opt/kvd
echo "You can copy the genesis.json file to /opt/kvd/config and edit the /opt/kvd/config/config.toml."
echo "Run 'sudo service kvd start' to start the service."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.