How to set up okp4 validator in nemeton testnet and monitor your validator
December 28th, 2022

What is OKP4

OKP4 is the next generation of data applications on cosmos and It is a domain-specific layer-1 dedicated to trust-minimized data sharing.

The blockchain orchestrates assets shared by participants into the Dataverse: data, algorithms, software, storage and computation to enable a new generation of applications.

OKP4 make any contributor can earns rewards thanks to these new value chains.

Use OKP4, Join Data Spaces. Or create ones on your own terms.

Official guide

Hardware requirements

  • 4 core CPU

  • 8G RAM

  • 200GB SSD


Install go

sudo rm -rf /usr/local/go;
curl | sudo tar -C/usr/local -zxvf - ;
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
source $HOME/.profile

Use go version to check the installation

Install other necessary tools

sudo apt-get update -y && sudo apt-get upgrade -y;
sudo apt-get install curl build-essential jq git make vim -y;

Build from source

git clone
cd okp4d
git checkout v3.0.0
make install

Verify by run okp4d version

The output should be v3.0.0

Run the node

Init the node

okp4d init $moniker --chain-id=okp4-nemeton-1
okp4d config chain-id okp4-nemeton-1

Get genesis file

wget -O $HOME/.okp4d/config/genesis.json ""

Set seeds and peers

sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.okp4d/config/config.toml
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/" ~/.okp4d/config/config.toml

Pruning settings

pruning="custom" && \
pruning_keep_recent="100" && \
pruning_keep_every="0" && \
pruning_interval="10" && \
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.okp4d/config/app.toml && \
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.okp4d/config/app.toml && \
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.okp4d/config/app.toml && \
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.okp4d/config/app.toml

Start node

sudo tee <<EOF >/dev/null /etc/systemd/system/okp4d.service
Description=okp4d daemon
ExecStart=$(which okp4d) start
sudo systemctl daemon-reload && \
sudo systemctl enable okp4d && \
sudo systemctl start okp4d

Check log

sudo journalctl -u okp4d -f

Check sync status

curl -s localhost:26657/status | jq .result | jq .sync_info

If"catching_up":false means your nodes already synced.

Change addrbook

wget -O $HOME/.okp4d/config/addrbook.json ""

Create validator

If you are genesis validator,there is no need to create validator again.

Create wallet

okp4d keys add yourwalletname

Remember to save your mnemonic, it cannot be recovered if you lost it

Get test token

Get your wallet address

okp4d keys list

You can ask test token from others.

After that,you can query your wallet balance by

okp4d query bank balances Youraddress

Create validator

In nemeton testnet, there are 150 active validators. You can become an active validator by staking enough uknow.

$daemon tx staking create-validator \
    --amount=1000000$denom \
    --pubkey=$($daemon tendermint show-validator) \
    --moniker=$moniker \
    --chain-id=$chainid \
    --commission-rate=0.05 \
    --commission-max-rate=0.2 \
    --commission-max-change-rate=0.1 \
    --min-self-delegation=1000000 \
    --fees 100uknow \

You can check your validator on blockchain explorer testnet/staking later.

Monitor (optional)

Install node exporter

Node exporter can export your server's data like CPU, memory.

sudo  apt-get update &&  sudo  apt-get upgrade -y && \
wget && \
tar xvf node_exporter-1.2.2.linux-amd64.tar.gz && \
rm node_exporter-1.2.2.linux-amd64.tar.gz && \
sudo mv node_exporter-1.2.2.linux-amd64 node_exporter && \
chmod +x  $HOME/node_exporter/node_exporter && \
mv $HOME/node_exporter/node_exporter /usr/bin && \
rm -Rvf  $HOME/node_exporter/

sudo tee /etc/systemd/system/exporterd.service > /dev/null <<EOF

sudo systemctl daemon-reload && \
sudo systemctl enable exporterd && \
sudo systemctl restart exporterd

sudo journalctl -u exporterd -f

Log should be like this.

example logs
example logs

Open the 9100 port on your server, you can get metrics from node exporter at http://YOURIP:9100/metrics

Open prometheus metrics on your node

sed -i "s/prometheus-retention-time = 0/prometheus-retention-time = 60/g" $HOME/.okp4d/config/app.toml
sed -i "s/prometheus = false/prometheus = true/g" $HOME/.okp4d/config/config.toml
sudo systemctl restart okp4d

Install prometheus

Install prometheus on your monitor server.

wget && \
tar xvf prometheus-2.30.1.linux-amd64.tar.gz && \
rm prometheus-2.30.1.linux-amd64.tar.gz && \
mv prometheus-2.30.1.linux-amd64 prometheus

Add monitor

vim prometheus/prometheus.yml 

Add config like this under scrape_configs and restart promethues

 - job_name: "node_exporter"

      - targets: ["nodeip:9100"]
          label: "okp4"

  - job_name: "node"

      - targets: ["nodeip:26660"]
          label: "okp4"

Set system service

sudo tee /etc/systemd/system/prometheusd.service > /dev/null <<EOF
ExecStart=$HOME/prometheus/prometheus --config.file="/root/prometheus/prometheus.yml"

sudo systemctl daemon-reload && \
sudo systemctl enable prometheusd && \
sudo systemctl restart prometheusd

sudo journalctl -u prometheusd -f

Install grafana

Install docker

sudo apt update -y && sudo apt upgrade -y
sudo apt-get install ca-certificates curl gnupg lsb-release -y
sudo mkdir -p /etc/apt/keyrings
curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli docker-compose-plugin -y
sudo systemctl restart docker

Use docker to start grafana

sudo docker run -d -p 3000:3000 --name grafana grafana/grafana:9.0.5

Open http://yourip:3000 The default username and password are admin, click add your first data source,add promethues data source.

add your data source
add your data source

Enter http://YourpromethuesserverIP:9090 at the URL (remember to open port 9090 of the Promethues server). If promethues and grafana are on the same host, enter http://localhost:9090 and click Save & test to save and test when you are done.

Import dashboard

import dashboard
import dashboard

Select proper data source, click import and you will see dashboard like this.

example dashboard
example dashboard

Set alert

First click on the Contact point under Alerting in the left menu bar to add a notification method, there are discord, dinging, etc.

add contact points
add contact points

Next, set alert for each panel on dashboard.

add alert
add alert

This is a example alert.

example alert
example alert

More info

Official website:

Official twitter:

Official Docs:

Other useful command

Service management

Check logs

sudo journalctl -u okp4d -f

Run/Restart node

sudo systemctl restart okp4d

Stop node

sudo systemctl stop okp4d

Get node info

Sync info

okp4d status 2>&1 | jq .SyncInfo

Validator info

okp4d status 2>&1 | jq .ValidatorInfo

Node info

okp4d status 2>&1 | jq .NodeInfo

Get node id

okp4d tendermint show-node-id

Wallet management

Show all wallets

okp4d keys list

Recover wallet

okp4d keys add yourwalletname --recover

Delete wallet

okp4d keys delete yourwalletname

Query balances

okp4d query bank balances youraddress

Send tokens

okp4d tx bank send yourwalletname receiveraddress <num>uknow --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow



okp4d tx gov vote proposal_id option --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow

options include yes/no/no_with_veto/abstain

Delegete,Withdraw reward


okp4d tx staking delegate validatoraddress <num>uknow  --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow


okp4d tx staking unbond validatoraddress <num>uknow  --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow

Withdraw staking reward and commission

okp4d tx distribution withdraw-rewards validatoraddress --commission --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow

Withdraw all rewards

okp4d tx distribution withdraw-all-rewards --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow

Validator management

Edit validator info

okp4d tx staking edit-validator \
  --new-moniker="Your moniker" \
  --identity="your keybase id" \
  --website="your website" \
  --details="Your descripptions" \
  --from=yourwalletname \
  --fees 100uknow \

If you want to show your validator logo on the block explorer. you need to register a keybase account and upload your logo. set --identity="your keybase id"


okp4d tx slashing unjail --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow
Arweave TX
Ethereum Address
Content Digest