Page cover
githubEdit

Create a validator

This guide assumes you're running on Ubuntu 22.04 LTS - the commands will probably work just fine on 20.04 LTS or Debian.

Basic machine setup

  1. SSH into your node

  2. Update your machine (Answer yes / ok to the prompts)

sudo apt update && sudo apt dist-upgrade -y
  1. Install required tools

sudo apt install build-essential git unzip curl wget

Prepare environment

Best practice is to run node software on an isolated unprivileged user. We'll create the kuji user in this guide; if your username is different change it wherever it appears.

sudo useradd -m -s /bin/bash kuji

Install Golang

Download go and extract go 1.20.8

# remove old go version

sudo rm -rvf /usr/local/go/

# download and install recent go version

curl -fsSL https://golang.org/dl/go1.20.8.linux-amd64.tar.gz | sudo tar -xzC /usr/local

# remove unneeded installer
rm go1.20.8.linux-amd64.tar.gz

# source go
cat <<EOF >> ~/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source ~/.profile
go version

Build node binary

  1. Login as kuji(skip if you already did)

  1. Download the project code and checkout to mainnet branch

  1. Verify your binary is working

Configure chain

This section is written for mainnet (kaiyo-1); modify the ID, genesis, and seeds as needed.

  1. Login as kuji (skip if you're already logged in).

  1. Initialize config files and dirs. Replace with a public name for your node.

  1. Download the kaiyo-1 genesis.json.

  1. Set the chain-id. This will save it in client.toml so you won't need --chain-id again.

  1. Set some defaults in config.toml and app.toml.

  1. (Optional) Configure some seeds. This will help your node find peers.

Start the node

The node is now ready to go.

  1. (Optional) State-syncarrow-up-right if you want a head start over syncing from scratch.

  2. Start syncing blocks

And then watch a fair amount of log messages while your node is catching up. After making sure that it works, it's time to install it as a system level service so it always starts with the machine.

Register the node as a service

A systemd service will keep kujirad running in the background and restart it if it stops.

  1. Create the service file with sudo using your favorite text editor in /etc/systemd/system/kujirad.service .

  1. Reload systemd to pick up the new service.

  1. Start the service.

  1. Tail your service logs.

  1. (Optional) Enable the service. This will set it to start on every boot.

Last updated