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
https://docs.okp4.network/nodes/installation
Hardware requirements
-
4 core CPU
-
8G RAM
-
200GB SSD
Prerequisites
Install go
sudo rm -rf /usr/local/go;
curl https://dl.google.com/go/go1.19.2.linux-amd64.tar.gz | 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
EOF
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
cd
git clone https://github.com/okp4/okp4d
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
moniker="your_moniker_name"
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 "https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton-1/genesis.json"
Set seeds and peers
PEERS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
seeds="[email protected]:36656,[email protected]:16256,2f9e54645aca860f703e3f756fa7c472b829a9a9@tenderseed.ccvalidators.com:26009"
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
[Unit]
Description=okp4d daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$(which okp4d) start
Restart=on-failure
RestartSec=3
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF
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 "https://raw.githubusercontent.com/sergiomateiko/addrbooks/main/okp4/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=okp4d
denom=uknow
moniker=yourmonikername
chainid=nemeton-1
$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 \
--from=yourwalletname
You can check your validator on blockchain explorer https://explore.okp4.network/okp4 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 https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz && \
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
[Unit]
Description=node_exporter
After=network-online.target
[Service]
User=$USER
ExecStart=/usr/bin/node_exporter
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && \
sudo systemctl enable exporterd && \
sudo systemctl restart exporterd
sudo journalctl -u exporterd -f
Log should be like this.
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
cd
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.
cd
wget https://github.com/prometheus/prometheus/releases/download/v2.30.1/prometheus-2.30.1.linux-amd64.tar.gz && \
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"
static_configs:
- targets: ["nodeip:9100"]
labels:
label: "okp4"
- job_name: "node"
static_configs:
- targets: ["nodeip:26660"]
labels:
label: "okp4"
Set system service
sudo tee /etc/systemd/system/prometheusd.service > /dev/null <<EOF
[Unit]
Description=prometheus
After=network-online.target
[Service]
User=$USER
ExecStart=$HOME/prometheus/prometheus --config.file="/root/prometheus/prometheus.yml"
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
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 https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(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 containerd.io 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.
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 https://github.com/silentnoname/Node-runner/blob/main/monitor/okp4_dashboard.json
Select proper data source, click import and you will see dashboard like this.
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.
Next, set alert for each panel on dashboard.
This is a example alert.
More info
Official website:
Official twitter:
https://twitter.com/OKP4_Protocol
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
1know=1000000uknow
Vote
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
Delegate
okp4d tx staking delegate validatoraddress <num>uknow --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow
Undelegate
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 \
--chain-id=nemeton-1
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"
Unjail
okp4d tx slashing unjail --from yourwalletname -y --chain-id=nemeton-1 --fees 100uknow