Okp4 (validator setup guide)
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.
----------------------------------------------------------------------------------------
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev libleveldb-dev jq build-essential bsdmainutils git make ncdu htop screen unzip bc fail2ban htop -y
wget https://golang.org/dl/go1.18.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz
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
The output should be:go version go1.8 linux/amd64
curl https://i.jpillora.com/okp4/okp4d@v3.0.0! | bash
Specify variables, for ease of work:
OKP4_MONIKER="YourValidatorName" OKP4_WALLET="YourWalletName"
echo 'export OKP4_MONIKER='${OKP4_MONIKER} >> $HOME/.profile echo 'export OKP4_WALLET='${OKP4_WALLET} >> $HOME/.profile source $HOME/.profile
echo $OKP4_MONIKER echo $OKP4_WALLET
okp4d init $OKP4_MONIKER --chain-id okp4-nemeton-1
okp4d config chain-id okp4-nemeton-1 && \ peers="9c462b1c0ba63115bd70c3bd4f2935fcb93721d0@65.21.170.3:42656","a4a96019d2fbc1b5df07940cd971585311166acd@65.108.206.118:61356","ee4c5d9a8ac7401f996ef9c4d79b8abda9505400@144.76.97.251:12656","2e85c1d08cfca6982c74ef2b67251aa459dd9b2f@65.109.85.170:43656","264256d32511c512a0a9d4098310a057c9999fd1@okp4.sergo.dev:12233","4ea26ce893d8f4f89a7b49b9bd77e0fbd914e029@65.109.88.162:36656","8d8fdad759361a57121903632adbd66ad072b1ab@okp4-testnet.nodejumper.io:29656","e3c602b146121c88d350bd7e0f6ce8977e1aacff@161.97.122.216:26656","3c805c2dead7b7a3a1d3ba2399d4d62153322413@65.108.2.41:36656","9d1482bc31fb4578a5c7f7f65c4e0aaf2dfc2336@213.239.215.77:34656","a7f1dcf7441761b0e0e1f8c6fdc79d3904c22c01@[2a02:c206:2093:4875::1]:36656","a7f1dcf7441761b0e0e1f8c6fdc79d3904c22c01@38.242.150.63:36656","99f6675049e22a0216af0e2447e7a4c5021874cd@142.132.132.200:28656","9392c27a9a561c31e7a920dc6f577d663c473ef8@154.12.225.88:26656","9928d19b7663a6fa639eb7c1ee239e671edcbdb2@5.9.147.22:26616","b5484e85a8802e0489234904d2b3a2d3c0c16e71@135.181.116.246:26106","f575a4c927d28990c84004d9af555f9956b1f22f@195.201.194.249:26656","b0b56d944cf1cc569a1e77e0923e075bad94d755@141.95.145.41:28656","667b419765454ad6970cc739e75d1ddf2b8a3f47@62.171.184.126:26656","eef77b5ae1c37f3e5809ff928c329dde906be388@65.108.133.73:21656","0f0c071ffc1948767fa866501a4d7d3144b8bf0b@142.132.208.26:26157","3ecbc8aa00b5dd8af88af7496489b0054e3b4d7f@138.68.182.247:26656","c030413e39be95c397c6681639f5d48675554c0c@51.79.78.121:26646","15fdc722cd49ef7676205b6ad3120a84728d948c@65.108.225.158:17656","61544968b65e34a59513b67613519cd37ace7ecb@161.97.151.109:26656" && \ sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.okp4d/config/config.toml && \ seeds="" && \ sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.okp4d/config/config.toml
okp4d keys add $OKP4_WALLET
Or restore if there is a mnemonic:
okp4d keys add $OKP4_WALLET --recover
wget -O ~/.okp4d/config/genesis.json https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton-1/genesis.json
cd $HOME/.okp4/config && \ indexer="null" && \ snapshot_interval="0" && \ pruning="custom" && \ pruning_keep_recent="100" && \ pruning_keep_every="0" && \ pruning_interval="10" && \ sed -i.bak -e "s/^indexer *=.*/indexer = \"$indexer\"/" config.toml && \ sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$snapshot_interval\"/" app.toml && \ sed -i.bak -e "s/^pruning *=.*/pruning = \"$pruning\"/" app.toml && \ sed -i.bak -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" app.toml && \ sed -i.bak -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" app.toml && \ sed -i.bak -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" app.toml
cd $HOME/.okp4/config && \ sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:26653\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:26652\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:6061\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:26651\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":26655\"%" config.toml && \ sed -i.bak -e "s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:9092\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:9093\"%" app.toml && \ echo 'export NODE=http://localhost:26652' >> $HOME/.bash_profile && \ source $HOME/.bash_profile && \ okp4d config node $NODE
sudo tee /etc/systemd/system/okp4d.service > /dev/null <<EOF [Unit] Description=okp4 After=network-online.target [Service] User=$USER ExecStart=$(which okp4d) start Restart=on-failure RestartSec=3 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF
sudo systemctl daemon-reload && sudo systemctl enable okp4d && sudo systemctl restart okp4d && sudo journalctl -u okp4d -f -o cat
Running a node from a state sync (optional)
sudo systemctl stop okp4d && \ okp4d tendermint unsafe-reset-all --home /root/.okp4d --keep-addr-book
peers="57f3df8b11c6c9b796c78d2a213b962acfcb7f3c@213.239.207.175:38656 && \ sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.okp4d/config/config.toml && \ SNAP_RPC=213.239.207.175:38657 && \ LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \ BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \ TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) && \ echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH && \ sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \ s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \ s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.okp4d/config/config.toml && \
sudo systemctl restart okp4d && journalctl -u okp4d -f -o cat
After full synchronization, you can request tokens and create your own validator.
Create a validator
okp4d tx staking create-validator \ --amount=1000000uknow \ --pubkey=$(sourced tendermint show-validator) \ --moniker=$OKP4_MONIKER \ --chain-id=okp4-nemeton-1 \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.1" \ --min-self-delegation="1" \ --fees 200uknow \ --from=$OKP4_WALLET \ --identity="" \ --website="" \ --details="" \ -y
Network monitoring system (optional)
sudo apt-get install jq sysstat bc smartmontools fdisk -y
mkdir status && \ cd status
Download the script and settings
wget https://raw.githubusercontent.com/cyberomanov/status/main/tendermint/node_status/cosmos.sh && \ wget https://raw.githubusercontent.com/cyberomanov/status/main/tendermint/node_status/cosmos.conf && \ wget https://raw.githubusercontent.com/cyberomanov/status/main/tendermint/node_status/name.conf
chmod +x cosmos.sh
CHAT_ID_ALARM="you_id_chat_for_alarm_messages(telegram)"
CHAT_ID_STATUS="you_id_chat_for_log_messages(telegram)"
BOT_TOKEN="you_bot_token(telegram bot)"
VALIDATOR_ADDRESS="you_valoper_address"
DELEGATOR_ADDRESS="you_wallet"
MONIKER="you_validator_moniker"
Updating and configuring settings in files
mv name.conf okp4.conf && \ sed -i 's,# CURL=,CURL=, g' $HOME/status/okp4.conf && \ sed -i "s/^SERVER *=.*/SERVER = \"Okp4_test\"/" $HOME/status/cosmos.conf && \ sed -i "s/^CHAT_ID_ALARM *=.*/CHAT_ID_ALARM = \"$CHAT_ID_ALARM\"/" $HOME/status/cosmos.conf && \ sed -i "s/^BOT_TOKEN *=.*/BOT_TOKEN = \"$BOT_TOKEN\"/" $HOME/status/cosmos.conf && \ sed -i "s/^MONIKER *=.*/MONIKER = \"$MONIKER\"/" $HOME/status/okp4.conf && \ sed -i 's,https://api-cosmos.cosmostation.io/v1/status/,https://okp4.api.explorers.guru/api/v1/blocks/latest, g' $HOME/status/okp4.conf && \ sed -i "s/^DELEGATOR_ADDRESS *=.*/DELEGATOR_ADDRESS = \"$DELEGATOR_ADDRESS\"/" $HOME/status/okp4.conf && \ sed -i "s/^VALIDATOR_ADDRESS *=.*/VALIDATOR_ADDRESS = \"$VALIDATOR_ADDRESS\"/" $HOME/status/okp4.conf && \ sed -i "s/^TOKEN *=.*/TOKEN = \"uKNOW\"/" $HOME/status/okp4.conf && \ sed -i "s/^DENOM *=.*/DENOM = \"1000000\"/" $HOME/status/okp4.conf && \ sed -i "s/^PROJECT *=.*/PROJECT = \"okp4-testnet\"/" $HOME/status/okp4.conf && \ sed -i 's,/root/go/bin/cosmosd,/root/go/bin/okp4d, g' $HOME/status/okp4.conf && \ sed -i 's,/root/.cosmos/config/,/root/.okp4d/config/, g' $HOME/status/okp4.conf && \ sed -i "s/^CHAT_ID_ALARM *=.*/CHAT_ID_ALARM = \"$CHAT_ID_ALARM\"/" $HOME/status/okp4.conf && \ sed -i "s/^CHAT_ID_STATUS *=.*/CHAT_ID_STATUS = \"$CHAT_ID_STATUS\"/" $HOME/status/okp4.conf && \ sed -i "s/^BOT_TOKEN *=.*/BOT_TOKEN = \"$BOT_TOKEN\"/" $HOME/status/okp4.conf
crontab -e
Adding a line
1,11,21,31,41,51 * * * * bash $HOME/status/cosmos.sh >> $HOME/status/cosmos.log 2>&1
At work, the logs look like this
Useful links
Website - https://okp4.network/
Discord - https://discord.com/invite/okp4
Twitter - https://twitter.com/OKP4_Protocol
Github - https://github.com/okp4
Medium - https://blog.okp4.network/