Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Cumulo-pro/OKP4


https://github.com/Cumulo-pro/OKP4

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

Basic tools for a validator node in OKP4


OKP4, the Open Protocol for Knowledge


πŸ“Œ Overview


OKP4 is a domain-specific, layer 1 blockchain dedicated to the exchange of data with minimal trust. Digital Territory for the Data Economy and the Next Generation of Data Applications

OKP4 is PoS and is based on Tendermint. Its validators participate in the consensus protocol by casting votes containing cryptographic signatures signed by each validator’s private key.

The KNOW is the native token of OKP4.

Chain ID: okp4-nemeton-1 | Latest version Tag: v3.0.0

🌐 Useful links


Website: https://okp4.network

GitHub: https://github.com/okp4/okp4d

OKP4 whitepaper and documentation: https://docs.okp4.network

Frequently Asked Questions: https://nemeton.okp4.network/faq#faq

Cumulo Spanish Resources: http://cumulo.pro/okp4.html

Social media:


● Twitter: https://twitter.com/OKP4_Protocol

● Telegram: https://t.me/okp4network

● Discord: https://discord.com/invite/okp4

● Medium: https://blog.okp4.network/

● LinkedIn: https://www.linkedin.com/company/okp4-open-knowledge-protocol-for/

● Youtube: https://www.youtube.com/@okp4351

Explorers:


● https://explore.okp4.network/

● https://okp4.explorers.guru/

βš™οΈHardware requirements


● Memory: 8 GB RAM

● CPU: 2 core

● Disk: 200 GB of storage

πŸ›  Manual installation

Updating packages and installing dependencies


sudo apt update && sudo apt upgrade -y

sudo apt install curl git wget htop tmux build-essential jq make gcc -y

Environment variables


To set environment variables replace your wallet and moniker < YOUR_WALLET_NAME> < YOUR_MONIKER> without <> , and save and import the variables into the system.

echo "export OKP4_WALLET=""" >> $HOME/.bash_profile

echo "export OKP4_MONIKER=""" >> $HOME/.bash_profile
echo "export OKP4_CHAIN_ID="okp4-nemeton-1"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Install go


cd $HOME

VER="1.19.1"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm -rf "go$VER.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version

Download and compile binaries


cd || return

rm -rf okp4d
git clone https://github.com/okp4/okp4d.git
cd okp4d || return
git checkout v3.0.0
make install
okp4d version # 3.0.0

Configure and start the application


okp4d config chain-id okp4-nemeton-1

okp4d init $OKP4_MONIKER --chain-id $OKP4_CHAIN_ID

Download genesis


curl https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton-1/genesis.json > $HOME/.okp4d/config/genesis.json

sha256sum $HOME/.okp4d/config/genesis.json #2ec25f81cc2abecbc0da3de45b052ea3314d0d658b1b7f4c7b6a48d09254c742

Set seeds and peers


Seeds

sed -i -e "s|^seeds *=.*|seeds = \"3f472746f46493309650e5a033076689996c8881@okp4-testnet.rpc.kjnodes.com:36659\"|" $HOME/.okp4d/config/config.toml


Peers
[email protected]:42656,[email protected]:61356,[email protected]:12656,[email protected]:43656,[email protected]:12233,[email protected]:36656,8d8fdad759361a57121903632adbd66ad072b1ab@okp4-testnet.nodejumper.io:29656,[email protected]:26656,[email protected]:36656,[email protected]:34656,a7f1dcf7441761b0e0e1f8c6fdc79d3904c22c01@[2a02:c206:2093:4875::1]:36656,[email protected]:36656,[email protected]:28656,[email protected]:26656,[email protected]:26616,[email protected]:26106,[email protected]:26656,[email protected]:28656,[email protected]:26656,[email protected]:21656,[email protected]:26157,[email protected]:26656,[email protected]:26646,[email protected]:17656,[email protected]:26656,[email protected]:51656,[email protected]:37656,[email protected]:31656,[email protected]:36656,[email protected]:31656,[email protected]:26656,[email protected]:26656,[email protected]:49656,[email protected]:26656,[email protected]:26657,[email protected]:36656,[email protected]:28656,[email protected]:26656,[email protected]:26656,[email protected]:36658,[email protected]:26656,[email protected]:36656,[email protected]:28656,[email protected]:36656,[email protected]:36656,[email protected]:26656,2f9e54645aca860f703e3f756fa7c472b829a9a9@tenderseed.ccvalidators.com:26009,[email protected]:26656

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

Configure pruning


sed -i 's|pruning = "default"|pruning = "custom"|g' $HOME/.okp4d/config/app.toml

sed -i 's|pruning-keep-recent = "0"|pruning-keep-recent = "100"|g' $HOME/.okp4d/config/app.toml
sed -i 's|pruning-interval = "0"|pruning-interval = "17"|g' $HOME/.okp4d/config/app.toml
#Set the minimum gas price
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.0001uknow"|g' $HOME/.okp4d/config/app.toml

Activate prometheus


sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.okp4d/config/config.toml

Clean up old data


okp4d tendermint unsafe-reset-all --home $HOME/.okp4d --keep-addr-book



♻️ Fast synchronisation with snapshot (Optional)





You can sync your OKP4 node quickly by downloading a recent snapshot from kjnodes (https://services.kjnodes.com/home/testnet/okp4/snapshot), Kolot (https://github.com/Kolot86/Snapshots-StateSync/blob/main/OKP4/Snapshot.md), …

sudo systemctl stop okp4d

cp $HOME/.okp4d/data/priv_validator_state.json $HOME/.okp4d/priv_validator_state.json.backup
rm -rf $HOME/.okp4d/data
cd $HOME
rm -rf $HOME/.okp4d/data
curl -L https://snapshots.kjnodes.com/okp4-testnet/snapshot_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.okp4d
mv $HOME/.okp4d/priv_validator_state.json.backup $HOME/.okp4d/data/priv_validator_state.json

πŸ›Ž Service with SystemD


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

[Unit]
Description=OKP4 Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which okp4d) start
Restart=on-failure
RestartSec=10
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF

Enable, start service and check logs


sudo systemctl daemon-reload

sudo systemctl enable okp4d
sudo systemctl restart okp4d
sudo journalctl -u okp4d -f --no-hostname -o cat

πŸ—Wallet

Create wallet


Don’t forget to save the mnemonic.

okp4d keys add $OKP4_WALLET

Restore wallet


okp4d keys add $OKP4_WALLET --recover

Deposit funds into your wallet


Before creating a validator, you have to deposit funds in your wallet, go to the OKP4 discord server and request them in the faucet channel.

/reques  <<-YOUR_WALLET_ADDRESS->>

πŸ“Validator

Save the wallet and validator address


OKP4_WALLET_ADDRESS=$(okp4d keys show $OKP4_WALLET -a)

OKP4_VALOPER_ADDRESS=$(okp4d keys show $OKP4_WALLET --bech val -a)
echo "export OKP4_WALLET_ADDRESS="${OKP4_WALLET_ADDRESS} >> $HOME/.bash_profile
echo "export OKP4_VALOPER_ADDRESS="${OKP4_VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

Create validator


Before creating a validator, you should make sure that the node is synchronised and check the balance of your wallet.

Check synchronisation status

Once your node is fully synchronised, the output will read false.

okp4d status 2>&1 | jq .SyncInfo

Check your balance

okp4d q bank balances $(okp4d keys show wallet -a)

Create validator

okp4d tx staking create-validator \

--amount=1000000uknow \
--pubkey=$(okp4d tendermint show-validator) \
--moniker=$OKP4_MONIKER \
--chain-id=$OKP4_CHAIN_ID \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=wallet \
--gas-adjustment=1.4 \
--gas=auto \
-y

You can add the flags β€” website β€” security-contact β€” identity β€” details (optional)

--website  \

--security-contact \
--identity \
--details

πŸŽ› Monitoring


If you want to set up a monitoring and alerting system use our guide to monitoring Cosmos nodes with tenderduty.

πŸ›Ž SystemD commands


Stop the service


sudo systemctl stop okp4d

Start service


sudo systemctl start okp4d

Restart service


sudo systemctl restart okp4d

Check logs


sudo journalctl -u okp4d -f --no-hostname -o cat

Check status


sudo systemctl status okp4d

πŸ“ˆ Node information


Synchronization information


okp4d status 2>&1 | jq .SyncInfo

Node information


okp4d status 2>&1 | jq .NodeInfo

Validator information


okp4d status 2>&1 | jq .ValidatorInfo

Get peers


echo $(okp4d tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.okp4d /config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')

πŸ” Wallet operation


Check balance


okp4d query bank balances $OKP4_WALLET_ADDRESS

Wallet Key List


okp4d keys list

Create a new wallet


okp4d keys add $OKP4_WALLET

Wallet recovering


okp4d keys add $OKP4_WALLET --recover

Delete wallet


okp4d keys delete $OKP4_WALLET

Transfer funds


okp4d tx bank send $OKP4_WALLET_ADDRESS  800000000uknow --gas auto --gas-adjustment 1.3 --fees 14uknow

πŸ’¬ Governance


List all proposals


okp4d query gov proposal 1

Vote YES


okp4d tx gov vote 1 yes --from $OKP4_WALLET --chain-id $OKP4_CHAIN_ID --gas-adjustment 1.4 --gas auto -y

Vote NO


okp4d tx gov vote 1 no --from $OKP4_WALLET --chain-id $OKP4_CHAIN_ID --gas-adjustment 1.4 --gas auto -y

Refrain


okp4d tx gov vote 1 abstain --from $OKP4_WALLET --chain-id $OKP4_CHAIN_ID --gas-adjustment 1.4 --gas auto -y

🚰 Staking, delegation and rewards


Withdraw all rewards


okp4d tx distribution withdraw-all-rewards --from $OKP4_WALLET --chain-id $OKP4_CHAIN_ID --gas auto --gas-adjustment 1.3

Withdraw commission


okp4d tx distribution withdraw-rewards $OKP4_VALOPER_ADDRESS --from $OKP4_WALLET --commission --fees 20uknow

Delegate Stake


okp4d tx staking delegate $OKP4_VALOPER_ADDRESS 10000000uknow --from $OKP4_WALLET --chain-id $OKP4_CHAIN_ID --gas=auto --gas-adjustment 1.3

βœ”οΈ Validator operation


Edit validator


okp4d tx staking edit-validator \

--moniker=$NODENAME \
--identity= \
--website="" \
--details="" \
--chain-id=$OKP4_CHAIN_ID \
--from=$OKP4_WALLET


Validator information


okp4d status 2>&1 | jq .ValidatorInfo

Jailing information


okp4d q slashing signing-info $(okp4d tendermint show-validator)

Validator unjailing


okp4d tx slashing unjail --broadcast-mode=block --from $OKP4_WALLET --chain-id $OKP4_CHAIN_ID --gas auto --gas-adjustment 1.5

πŸ—‘ Delete node


sudo systemctl stop okp4d

sudo systemctl disable okp4d
sudo rm -rf /etc/systemd/system/okp4d*
sudo systemctl daemon-reload
sudo rm $(which okp4d)
sudo rm -rf $HOME/.okp4d
sudo rm -fr $HOME/ okp4d
sed -i "/OKP4_/d" $HOME/.bash_profile

Authors: Sami & Mon


http://cumulo.pro/