22.12.2022, 12:06 | #1 |
Member
Регистрация: 20.07.2022
Сообщений: 99
|
OKP4 | Testnet - установка ноды
OKP4 | Testnet - установка ноды
Server requirements:
Prepare server: Update system dependencies: Код:
sudo apt update sudo apt install Код:
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 Код:
apt install make unzip jq git Код:
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 Код:
cd /root/.okp4d/config rm genesis.json wget genesis.json https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton-1/genesis.json Код:
PEERS="[email protected]:36656,[email protected]:36656,[email protected]:36656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:17656,[email protected]:31656,[email protected]:21656,[email protected]:28656,[email protected]:51656,[email protected]:26656,[email protected]:26646,[email protected]:26656,[email protected]:33656,[email protected]:36656" sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.okp4d/config/config.toml Код:
okp4d start Код:
sudo tee /etc/systemd/system/okp4d.service > /dev/null <<EOF Код:
[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 Код:
cd okp4/okp4d-main sudo cp ./target/dist/okp4d /usr/local/bin/ || exit Код:
sudo systemctl daemon-reload sudo systemctl enable okp4d sudo systemctl restart okp4d sudo systemctl status okp4d Код:
journalctl -u okp4d -f -o cat Код:
curl http://localhost:26657/status | jq .result.sync_info.catching_up Код:
okp4d keys add wallet #create wallet - SAVE MNEMONIC!!! 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 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 Код:
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 |