Skip to content

(Nodes & Validators) Some basic edits & additional commands #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/nodes/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ _Build once, deploy anywhere_: The docker image is a multi-arch build supporting
Clone the [okp4/okp4d](https://github.com/okp4/okp4d) repo:

```bash
git clone git@github.com:okp4/okp4d.git
git clone https://github.com/okp4/okp4d.git
cd okp4d
```

Expand Down
11 changes: 11 additions & 0 deletions docs/nodes/join-testnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,23 @@ Here are the links to the different testnet's genesis:

- [`okp4-nemeton`](https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton/genesis.json)

```bash
URL="https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton/genesis.json"
wget -O $HOME/.okp4d/config/genesis.json $URL
````

### Peers

Here are the links to the different testnet's peers list:

- [`okp4-nemeton`](https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton/peers.txt)

```bash
URL="https://raw.githubusercontent.com/okp4/networks/main/chains/nemeton/peers.txt"
wget $URL -O $HOME/.okp4d/config/peers.txt
sed -i.bak 's/persistent_peers = \"\"/persistent_peers = \"'$(cat $HOME/.okp4d/config/peers.txt)'\"/g' $HOME/.okp4d/config/config.toml
````

:::tip

Don't hesitate to ask for other peers on our [discord server](https://discord.gg/okp4).
Expand Down
105 changes: 99 additions & 6 deletions docs/nodes/run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,55 @@ The `config/genesis.json` file shall be replaced with the one corresponding to t

Joining a network is first of all being part of the P2P protocol. To do so your node must connect with others by specifying persistent peers, either in the `config/config.toml`, or through the `p2p.persistent_peers` argument of the `start` command. Depending on the chosen network, refer to its section to find peers (i.e. [Join Testnet](join-testnet.mdx#peers) & [Join Mainnet](join-mainnet.md#peers)).

Add some peers using regex

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

# Example
# PEERS="[email protected]:23656,[email protected]:23656"
# sed -i -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.okp4d/config/config.toml
```

## 🚀 Run

Let's invoke the `start` command:
Run with `start` command:

```bash
okp4d start
```

Run with daemon service

```bash
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=65535

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable okp4d
sudo systemctl restart okp4d
```

Check logs

```bash
journalctl -fo cat -u okp4d -n 100
```

:::info

Running a validator node being critical, consider [automate upgrades](upgrade.md) and [secure your node](security.md).
Expand All @@ -110,6 +151,33 @@ During the sync process the node will apply each block on its state, you'll need

## 👨‍⚖️ Becoming validator

:::info

You will create a new wallet with the ["Create key"](run-node#Create-key) step.
Save your keys/mnemonics and never share them with anyone!

:::

### Create key

```bash
okp4d keys add <KEY_NAME>

# Example
# okp4d keys add validator
```

Or can recover the existing one

```bash
okp4d keys add <KEY_NAME> --recover

# Example
# okp4d keys add validator --recover
```

### Create validator

:::danger

Your node shall be fully synced before upgrading it to a validator. It can't take part in the validation consensus without sharing the same state than the others, and risk thus to be slashed and jailed.
Expand All @@ -119,19 +187,24 @@ Your node shall be fully synced before upgrading it to a validator. It can't tak
To make your node validator you need to submit a `create-validator` transaction referencing it by its public key:

```bash
PUB_KEY=$(okp4d tendermint show-validator)
AMOUNT="AMOUNT_OF_TOKEN"
DENOM=uknow
WALLET="YOUR_KEY_NAME"
IDENTITY="YOUR_KEYBASE_ID" #optional

okp4d tx staking create-validator \
--amount 1000000uknow \
--amount $AMOUNT$DENOM \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.20" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "Don't stop me KNOW" \
--pubkey=$PUB_KEY \
--details "Details of your validator" \
--pubkey=$(okp4d tendermint show-validator) \
--moniker "$MONIKER_NAME" \
--chain-id $CHAIN_ID \
--gas-prices 0.025uknow \
--from <key-name>
--identity=$IDENTITY \
--from $WALLET
```

:::info
Expand All @@ -143,3 +216,23 @@ okp4d tx staking create-validator --help
```

:::

## Additional Commands

Learn your valoper address

```bash
okp4d keys show $WALLET -a --bech val
```

Delegate additional stake

```bash
okp4d tx staking delegate [VALOPER_ADDRESS] [STAKE_AMOUNT]uknow --from $WALLET --chain-id $CHAIN_ID
```

Unjail

```bash
okp4d tx slashing unjail --chain-id $CHAIN_ID --from [your-key-name]
```
2 changes: 1 addition & 1 deletion docs/nodes/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ You'll need to keep the process always running in background, on Linux you can c

:::info

A description of the different environment variables can be found [here](https://docs.cosmos.network/master/run-node/cosmovisor.html#command-line-arguments-and-environment-variables).
A description of the different environment variables can be found [here](https://docs.cosmos.network/main/run-node/cosmovisor.html#command-line-arguments-and-environment-variables).

:::

Expand Down