Cosmos Nodes
December 22, 2022

OKP4 node guide

About project:

OKP4 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. Any contributor earns rewards thanks to these new value chains.

Roadmap (2023):

Phases of testnet:

Phase 1 — Sidh (Onboarding) DEC 01 — JAN 01

This first phase is pretty basic; it is dedicated to setting up Druids’ validator environment, participating in the genesis, and getting familiar with the OKP4 testnet.

Phase 2 — Infrastructure

The second phase is focused on testing Druids’ performance and uptime. Maintenance tasks and upgrades will be performed to test different kinds of state migrations.

Phase 3 — Token Dynamics

The third phase is all about token dynamics! Druids will engage in various node and community tasks with their precious tokens. Challenges will include some IBC-related tasks to open Nemeton to the interchain world…

Phase 4 — Security Test

The fourth phase is war it will incentivize Druids to test the upper bounds of the testnet through a series of tasks including coordinated strikes, governance attacks, and data-related high-load tasks such as data upload & usage congestion. This phase will also enable us to simulate emergency updates.

Phase 5 — Builders Phase

The last phase will open a new chapter for the Nemeton testnet. It will open its gates for builders to join the community of Druids, expanding our community way beyond validators!

Tokenomics:

Total initial supply: 200,000,000 $KNOW

Maximum supply: 350,000,000 $KNOW (including block rewards, reached after 80 years)

Node

Server requirements:

2 CPU

8 RAM

200 GB storage

I rent CPX31 on Hetzner and add the disk space (how to do it here)

Prepare server:

Update system dependencies:

sudo apt update

sudo apt install

Install go (version 19+ is needed)

wget -c https://golang.org/dl/go1.19.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xvzf go1.19.2.linux-amd64.tar.gz
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
source ~/.profile
go version
rm -rf go1.19.2.linux-amd64.tar.gz

Install make, zip and jq:

apt install make unzip jq git

Node installation:

mkdir okp4
#make directory okp4

cd okp4
#go to the directory okp4

wget -P /root/okp4 https://github.com/okp4/okp4d/archive/refs/heads/main.zip
#download the repository

unzip main.zip
#unzip main.zip

rm main.zip
#delete zip

cd okp4d-main
#go to the directory okp4d-main

sudo apt install build-essential

make build install

okp4d version

CHAIN_ID=okp4-nemeton-1
#declare a variable

MONIKER="SmartHamster"
#change SmartHamster on your name of node

okp4d init $MONIKER --chain-id $CHAIN_ID
#initialize the node

Change genesis:

cd /root/.okp4d/config

rm genesis.json
 
wget genesis.json https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton-1/genesis.json

Add peers:

PEERS="8cdeb85dada114c959c36bb59ce258c65ae3a09c@88.198.242.163:36656,84da5ad673d086c5c0b4a8da8b8b1c1c29e1d81e@142.132.130.196:36656,da8e2423cb90fba519e685aa47669eb861ea18c4@65.108.249.79:36656,30092d2717053f1c0813e8354c07c761c9c3ac5c@194.163.161.234:26656,08c925f04cb7a324b1aa91b472faa99c7cccc6ab@65.108.56.126:36656,bc648d1d8aef7f622d38f47ab8a0ecaee9791c46@54.36.109.62:26656,15fdc722cd49ef7676205b6ad3120a84728d948c@65.108.225.158:17656,1655cdc8fdfe1dc2209d47ff68c02a417ef9ed52@135.181.222.179:31656,eef77b5ae1c37f3e5809ff928c329dde906be388@65.108.133.73:21656,b0b56d944cf1cc569a1e77e0923e075bad94d755@141.95.145.41:28656,977373e6ff096d43c928e14724b8c6d9d7f48cb7@5.9.147.185:51656,a49302f8999e5a953ebae431c4dde93479e17155@141.95.153.244:26656,c030413e39be95c397c6681639f5d48675554c0c@51.79.78.121:26646,2caca21c4c83bc71b551c84801018c9d84b11f8b@135.181.59.182:26656,5a343f58402802a83ac546a22f66b1a799480dec@95.216.2.232:33656,a7f1dcf7441761b0e0e1f8c6fdc79d3904c22c01@38.242.150.63:36656"

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

Start the node:

okp4d start

Now the node does not work as a service, we need to create a service file so that it worked in the background when we close the terminal:

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

Next, copy as one command:

[Unit]
Description=Okp4 Node
After=network.target
[Service]
User=$USER
Type=simple
ExecStart=/root/go/bin/okp4d start
Restart=on-failure
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Copying the executable:

cd okp4/okp4d-main
sudo cp ./target/dist/okp4d /usr/local/bin/ || exit

Run the service file:

sudo systemctl daemon-reload

sudo systemctl enable okp4d

sudo systemctl restart okp4d

sudo systemctl status okp4d

View logs:

journalctl -u okp4d -f -o cat

View the synchronization process (false - the node is synchronized):

curl http://localhost:26657/status | jq .result.sync_info.catching_up

After your node is fully synchronized, you can proceed to create a validator:

okp4d keys add wallet
#create wallet - SAVE MNEMONIC!!!

We go to the tap and ask for coins

Now the transaction to create the validator:

okp4d tx staking create-validator \ --amount=1000000uknow \ --pubkey=$(okp4d tendermint show-validator) \ --moniker="<NODENAME>" \ --chain-id=okp4-nemeton \ --commission-rate="0.01" \ --commission-max-rate="0.10" \ --commission-max-change-rate="0.01" \ --min-self-delegation="1000000" \ --fees=1000uknow \ --from=wallet \ -y
#change <NODENAME> on name of your node

Explorer

Withdraw rewards

okp4d tx distribution withdraw-rewards $(okp4d keys show wallet --bech val -a) --commission --from wallet --chain-id okp4-nemeton-1 --gas-prices 0.1uknow --gas-adjustment 1.5 --gas auto -y

Delegate 259 KNOW

okp4d tx staking delegate $(okp4d keys show wallet --bech val -a) 259000000uknow --from wallet --chain-id okp4-nemeton-1 --gas-prices 0.1uknow --gas-adjustment 1.5 --gas auto -y

Thank you for your attention and congratulations with the new node! With love, your @kulikovae!

Smart Hamster Nodes Studio