Skip to content
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

docs: new validator docs (+ updated docs for gnoland cli) #2285

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
50a317c
docs: validator
r3v4s Jun 5, 2024
6f10d67
docs: update gnoland
r3v4s Jun 5, 2024
ce1c615
docs
r3v4s Jun 5, 2024
ee8431a
doc
r3v4s Jun 5, 2024
d7486fd
docs: add faq
r3v4s Jun 10, 2024
897abf0
docs: update missing part in running a validator
r3v4s Jun 10, 2024
98fe009
docs
r3v4s Jun 10, 2024
a9da599
chore: faq id
r3v4s Jun 10, 2024
1ce0a77
fix: typo engine > protocol
r3v4s Jun 10, 2024
bb23df9
docs: change key name
r3v4s Jun 10, 2024
deff310
fix: typo
r3v4s Jun 10, 2024
c835638
chore: change card level
r3v4s Jun 10, 2024
8a5c5ab
docs: change structure
r3v4s Jun 10, 2024
7050e46
docs: update key types
r3v4s Jun 11, 2024
2ee4fc0
fix: typo
r3v4s Jun 11, 2024
da6ea30
fix: typo
r3v4s Jun 11, 2024
5736d11
docs: split long command into newlines
r3v4s Jun 11, 2024
a5aa8bd
docs
r3v4s Jun 11, 2024
90435b1
docs: explicts `gnoland start` flag
r3v4s Jun 11, 2024
81bdafb
fix: typo
r3v4s Jun 11, 2024
e78828f
set linebreaks at 80 chars
adr-sk Jun 11, 2024
9f00e43
docs: include PoA in faq
adr-sk Jun 11, 2024
b7c159c
docs: move moniker to tips
adr-sk Jun 11, 2024
a7c33cb
docs:
r3v4s Jun 11, 2024
1acd657
docs:
r3v4s Jun 11, 2024
8779009
docs: use `-data-dir` and `-config-path`
r3v4s Jun 24, 2024
f93622a
docs: drop hardcoded results
r3v4s Jun 24, 2024
1731db0
docs: separate start new chain, connect existing chain
r3v4s Jun 24, 2024
6e6e934
docs: wip tech faq
r3v4s Jun 24, 2024
02674a3
docs: fix `r/sys/vals` typo
r3v4s Jun 24, 2024
94c663b
docs: remove un intended section
r3v4s Jun 24, 2024
060b4ab
Update validator set info
adr-sk Jun 25, 2024
8c58a0b
docs: add info block for overwriting secrets
r3v4s Jun 25, 2024
da00f05
docs: remove unnecessary section to connect an existing gno chain
r3v4s Jun 25, 2024
ea51e9b
chore
r3v4s Jun 25, 2024
ad8a9b0
docs: tech faq
r3v4s Jun 25, 2024
bdd9f4d
Update faq.md
adr-sk Jun 25, 2024
2329f9a
Merge pull request #1 from onbloc/adr-sk-patch-1
r3v4s Jun 25, 2024
3f7a6dd
docs: add warn and info card
r3v4s Jun 25, 2024
d5daa75
docs: add examples txs into genesis
r3v4s Jun 25, 2024
b2e52e5
fix: typo in numbering
r3v4s Jun 25, 2024
3df29c0
Format new docs
zivkovicmilos Jun 25, 2024
1935fa5
Simplify infra docs
zivkovicmilos Jun 25, 2024
0c16221
Merge branch 'master' into fork/onbloc/docs/new-validator-docs-update…
zivkovicmilos Jun 25, 2024
b189e49
Fix dumb linting errors
zivkovicmilos Jun 25, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
365 changes: 320 additions & 45 deletions docs/gno-tooling/cli/gnoland.md

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions docs/gno-tooling/gno-tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,27 @@ id: gno-tooling

# Gno Tooling

Welcome to the **Gno Tooling** section for Gno. This section outlines programs & tools
that are commonly used when developing applications with Gno.
Welcome to the **Gno Tooling** section for Gno. This section outlines programs & tools that are commonly used when developing applications with Gno.

## Gno Command Syntax Guide
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

### gno [subcommand] [flags] [arg...]

#### Subcommand

The gno command consists of various purpose-built subcommands.

- `gno {mod}` : manage gno.mod
- `gno {mod} {download} : download modules to local cache

#### Flags

Options of the subcommand.

- `gno mod download [-remote]` : remote for fetching gno modules

#### Arg

The actual value of the flag .

- `gno mod download -remote {rpc.gno.land:26657}`
53 changes: 53 additions & 0 deletions docs/validator/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
id: faq
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
---

# FAQ
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

### What is a Gno.land validator?

Gno.land is based on [Tendermint2](https://docs.gno.land/concepts/tendermint2) that relies on a set of validators selected based on [Proof of Contribution](https://docs.gno.land/concepts/proof-of-contribution) (PoC) to secure the network. Validators are tasked with participating in consensus by committing new blocks and broadcasting votes. Validators are compensated with a portion of transaction fees generated in the network. In Gno.land, the voting power of all validators are equally weighted to achieve a high nakamoto coefficient and fairness.

### What is Tendermint2?

[Tendermint2](https://docs.gno.land/concepts/tendermint2) (TM2) is the consensus engine that powers Gno.land. TM2 is a successor of [Tendermint Core](https://github.com/tendermint/tendermint2), a de facto consensus framework for building Proof of Stake blockchains. The design philosophy of TM2 is to create “complete software” without any vulnerabilities with development focused on minimalism, dependency removal, and modularity.
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

### What is Proof of Contribution?

[Proof of Contribution](https://docs.gno.land/concepts/proof-of-contribution) (PoC) is a novel consensus mechanism that secures Gno.land. PoC weighs expertise and alignment with the project to evaluate the contribution of individuals or teams who govern and operate the chain. Unlike Proof of Stake (PoS), validators are selected via governance of Contributors based on their reputation and technical proficiency. The voting power of the network is equally distributed across all validators for higher decentralization. A portion of all transaction fees paid to the network are evenly shared between all validators to provide a fair incentive structure.

### How does Gno.land differ from the Cosmos Hub?

In Cosmos Hub, validators are selected based on the amount of staked `ATOM` tokens delegated. This means that anyone with enough capital can join as a validator only to seek economic incentives without any alignment or technical expertise. This system leads to an undesirable incentive structure in which validators are rewarded purely based on the capital delegated, regardless of the quality of their infrastructure or service. On the contrary, validators in Gno.land are reviewed and verified to have made significant contributions, in order to join the validator set. All validators are evenly rewarded to ensure that the entire validator set is fairly incentivized.
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

### What is a full node and a pruned node?

A full node fully validates transactions and blocks of a blockchain and keeps a full record of all historic activity. A pruned node is a lighter node that processes only block headers and does not keep all historical data of the blockchain post-verification. Pruned nodes are less resource intensive in terms of storage costs. Although validators may run either a full node or a pruned node, it is important to retain enough blocks to be able to validate new blocks.

### How do I join the testnet as a validator?

Out of many official Gno testnets, Testnet4 (`test4`) is the purpose-built network for testing the multi-node validator environment prior to mainnet launch. Testnet4 is scheduled to go live in Q2 2024 with genesis validators consisting of the Gno Core Team, partners, and external contributors.

For more information about joining testnet4, visit (add link to the criteria issue/discussion). For more information about different testnets, visit the [Gno Testnet](https://docs.gno.land/concepts/testnets) section.

### What are the incentives for running a validator?

Network transaction fees paid on the Gno.land in `GNOT` are collected, from which a portion is directed to reward validators for their work. All validators fairly receive an equal amount of rewards.

### What are the different types of keys?
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

1. **Tendermint ( Tendermint2 ) Key :** A unique key used for voting in consensus during creation of blocks. A Tendermint Key is also often called a Validator Key. It is automatically created when running the `gnoland secrets init` command. A validator may check their Tendermint Key by running the `gnoland secrets get ValidatorPrivateKey` command.

2. **Application Key :** A key that is generated when a new account is created using the `gnokey` command. It is used to sign transactions.
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

### What stage is the Gno.land project in?

Gno.land is currently in Testnet 3, the single-node testnet stage. The next version, Testnet 4, is scheduled to go live in Q2 2024, which will include a validator set implementation for a multinode environment.

### How many validators will there be in mainnet?

The exact plans for mainnet are still TBD. Based on the latest discussions between contributors, the mainnet will likely have a validator set size of 20~50, which will gradually scale with the development and decentralization of the Gno.land project.

### How do I make my first contribution?

Gno.land is in active development and external contributions are always welcome! If you’re looking for tasks to begin with, we suggest you visit the [Bounties & Worx](https://github.com/orgs/gnolang/projects/35/views/3) board and search for open tasks up for grabs. Start from small challenges and work your way up to the bigger ones. Every contribution is acknowledged and highly regarded in PoC. We look forward to having you onboard as a new Contributor!
252 changes: 252 additions & 0 deletions docs/validator/running-a-validator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
---
id: running-a-validator
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
---

# Running a Validator
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

## Becoming a Gno.land validator

The Gno.land blockchain is powered by the [Tendermint2](https://docs.gno.land/concepts/tendermint2) (TM2) consensus, which involves committing of new blocks and broadcasting votes by multiple validators selected via governance in [Proof of Contribution](https://docs.gno.land/concepts/proof-of-contribution) (PoC). While traditional Proof of Stake (PoS) blockchains such as the Cosmos Hub required validators to secure a delegation of staked tokens to join the validator set, no bonding of capital is involved in Gno.land. Rather, the validators on Gno.land are expected to demonstrate their technical expertise and alignment with the project by making continuous, meaningful contributions to the project. Furthermore, the voting power and the transaction fee rewards between validators are distributed evenly to achieve higher decentralization. From a technical perspective, the validator set implementation in Gno.land as its abstracted away into the `r/sys/val` realm ([work in progress](https://github.com/gnolang/gno/issues/1824)), as a form of smart-contract, for modularity, whereas existing blockchains include the validator management logic within the consensus layer.

# Start a New Gno Chain and a Validator

## 1. Initialize the configurations (required)
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

```bash
gnoland config init
```

## 2. Initialize the secrets (required)

```bash
gnoland secrets init
```

## 3. Set a moniker (optional)
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

```bash
gnoland config set moniker node01
```

## 4. Set the rpc connection address (required for connecting with other nodes)

```bash
gnoland config set rpc.laddr "tcp://0.0.0.0:26657"

# similar behavior for cosmos validator
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
# gaiad tx staking create-validator `--node string (default:tcp://localhost:26657)`
```

## 5. Set the validator private key (required)
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

:::tip

The key file path is relative by default.

:::

```bash
gnoland config set priv_validator_key_file secrets/priv_validator_key.json
```

## 6. Set the validator state (required)

:::tip

The key file path is relative by default.

:::

```bash
gnoland config set priv_validator_state_file secrets/priv_validator_state.json
```

## 7. Set the node key (required)

:::tip

The key file path is relative by default.

:::

```bash
gnoland config set node_key_file secrets/node_key.json
```

## 8. Set the genesis file (required)
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

```bash
gnoland genesis generate
```

## 9. Add a validator (required)

```bash
# check the secrets file generated in step (2)
$ gnoland secrets get
[Node P2P Info]
Node ID: g19d8x6tcr2eyup9e2zwp9ydprm98l76gp66tmd6

[Validator Key Info]
Address: g1lnha5yem9dmj0yfzysfqsnvrm6j2ywshq83qdf
Public Key: gpub1pggj7ard9eg82cjtv4u52epjx56nzwgjyg9zpleysamt23ar025757uepld60xztnw7ujc3gwtjuy4pwv6z9sh4g284h3q

[Last Validator Sign State Info]
Height: 0
Round: 0
Step: 0

# add the validator to the genesis file using the address and the public key in the Validator Key Info section
$ gnoland genesis validator add -address g1lnha5yem9dmj0yfzysfqsnvrm6j2ywshq83qdf -name node01 -power 10 -pub-key gpub1pggj7ard9eg82cjtv4u52epjx56nzwgjyg9zpleysamt23ar025757uepld60xztnw7ujc3gwtjuy4pwv6z9sh4g284h3q
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
```

## 10. Start the chain

```bash
gnoland start
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
```

:::warning
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

Slashing policies for downtimes, double signing or any manipulation using the validator membership will be introduced in the near future.

Setting up the Sentry Node Architecture minimizes the risks of DDoS targetting the validator node. Configuring the `unconditional_peer_ids` is essential. Refer to [this issue](https://github.com/gnolang/gno/issues/1923) for further information. :::

# Connect to an Existing Gno Chain

## 1. Initialize the configurations (required)

```bash
gnoland config init
```

## 2. Initialize the secrets (required)

```bash
gnoland secrets init
```

## 3. Set a moniker (optional)

```bash
gnoland config set moniker node02
```

## 4. Set the rpc connection address (required for connecting with other nodes)

```bash
gnoland config set rpc.laddr "tcp://0.0.0.0:26657"
```

## 5. Set the validator private key (required)

:::tip

The key file path is relative by default.

:::

```bash
gnoland config set priv_validator_key_file secrets/priv_validator_key.json
```

## 6. Set the validator state (required)

:::tip

The key file path is relative by default.

:::

```bash
gnoland config set priv_validator_state_file secrets/priv_validator_state.json
```

## 7. Set the node key (required)

:::tip

The key file path is relative by default.

:::

```bash
gnoland config set node_key_file secrets/node_key.json
```

## 8. Obtain the genesis file of the chain to connect to

:::info

The genesis file will be [easily downloadable from GitHub](https://github.com/gnolang/gno/issues/1836#issuecomment-2049428623) in the future.

For now, obtain the file by

1. Sharing via scp or ftp
2. Getting from `{chain_rpc:26657}/genesis` (might result in time-out error due to large file size)

:::

```bash
## TODO: Add link to download the file from GitHub
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
```

## 9. Add the new validator to existing chain
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

::: info

This step is currently unavailable. It will be supported in the future after complete implementation of validator set injection with the `r/sys/val` realm.

:::

```bash
## TODO: Add a new validator
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
```

## 10. Confirm the validator information of the first node.

```bash
# Node ID
$ gnoland secrets get NodeKey

[Node P2P Info]
Node ID: g19d8x6tcr2eyup9e2zwp9ydprm98l76gp66tmd6

# The Public IP of the Node
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
$ curl ifconfig.me/ip
1.2.3.4 # USE YOUR OWN IP
```

## 11. Configure the persistent_peers list

Configure a list of nodes that your validators will always retain a connection with.

```bash
$ gnoland config set p2p.persistent_peers "g19d8x6tcr2eyup9e2zwp9ydprm98l76gp66tmd61.2.3.4:26656"
```

## 12. Configure the seeds

Configure the list of seed nodes. Seed nodes provide information about other nodes for the validator to connect with the chain, enabling a fast and stable initial connection.

:::info

This is an option to configure the node set as the Seed Mode. However, the option to activate the Seed Mode from the node is currently missing.

:::

```bash
gnoland config set p2p.seeds "g19d8x6tcr2eyup9e2zwp9ydprm98l76gp66tmd6@1.2.3.4:26656"
```

## 13. Start the second node

```bash
gnoland chain start
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved
```

## Results After Starting the Chain and Two Nodes
zivkovicmilos marked this conversation as resolved.
Show resolved Hide resolved

![1st_node](../assets/validator/running-a-validator/1st_node.png) The 1st node at height 12263.

![2nd_node](../assets/validator/running-a-validator/2nd_node.png) The 2nd node at height 12263 (synced with the 1st node)
Loading