Skip to content

Commit

Permalink
Improve Validator docs (w3f#4510)
Browse files Browse the repository at this point in the history
* Improve Validator docs

* minor fixes

* Add info about Kusama chain

* Latest default values

* Update docs/maintain/kusama/maintain-guides-how-to-validate-kusama.md

Co-authored-by: Filippo <[email protected]>

* Update docs/maintain/kusama/maintain-guides-how-to-validate-kusama.md

Co-authored-by: Filippo <[email protected]>

* Update docs/maintain/kusama/maintain-guides-how-to-validate-kusama.md

Co-authored-by: Filippo <[email protected]>

* Update docs/maintain/maintain-guides-how-to-validate-polkadot.md

Co-authored-by: Filippo <[email protected]>

* Implement feedback

---------

Co-authored-by: Filippo <[email protected]>
  • Loading branch information
DrW3RK and filippoweb3 authored Mar 3, 2023
1 parent d555324 commit 44f7d89
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 30 deletions.
5 changes: 4 additions & 1 deletion components/RPC-Connection.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect } from "react";
import { ApiPromise, WsProvider } from "@polkadot/api";
import { HumanReadable, Precise, BlocksToDays, ArrayLength } from "./utilities/filters";
import { HumanReadable, Precise, BlocksToDays, Percentage, ArrayLength } from "./utilities/filters";

/*
This component connects to the Polkadot/Kusama APIs and renders the response data.
Expand Down Expand Up @@ -143,6 +143,9 @@ function applyFilter(value, filter, network, setReturnValue) {
case "blocksToDays":
BlocksToDays(value, setReturnValue);
break;
case "percentage":
Percentage(value, setReturnValue);
break;
case "arrayLength":
ArrayLength(value, setReturnValue);
break;
Expand Down
6 changes: 6 additions & 0 deletions components/utilities/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ module.exports = {
setReturnValue(value.toString());
},

Percentage: function (value, setReturnValue) {
value = (value) / 10000000;
// Update value
setReturnValue(value.toString());
},

ArrayLength: function (value, setReturnValue) {
value = value.split(',').length;
// Update value
Expand Down
96 changes: 88 additions & 8 deletions docs/maintain/kusama/maintain-guides-how-to-validate-kusama.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,95 @@ keywords: [validate, validator, kusama, stake, maintain]
slug: ../../maintain-guides-how-to-validate-kusama
---

Running a validator on the Kusama network is identical to running a Polkadot validator. Check out
the [Polkadot guide](../maintain-guides-how-to-validate-polkadot.md) on how to setup a validator.
import RPC from "./../../../components/RPC-Connection";

import MinimumStake from "./../../../components/Minimum-Stake";

## Preliminaries

Running a validator on a live network is a lot of responsibility! You will be accountable for not
only your own stake, but also the stake of your current nominators. If you make a mistake and get
slashed, your tokens and your reputation will be at risk. However, running a validator can also be
very rewarding, knowing that you contribute to the security of a decentralized network while growing
your stash.

:::warning

It is highly recommended that you have significant system administration experience before
attempting to run your own validator.

You must be able to handle technical issues and anomalies with your node which you must be able to
tackle yourself. Being a validator involves more than just executing the binary file.

:::

Since security is so important to running a successful validator, you should take a look at the
[secure validator](maintain-guides-secure-validator.md) information to make sure you understand the
factors to consider when constructing your infrastructure. As you progress in your journey as a
validator, you will likely want to use this repository as a _starting point_ for your own
modifications and customizations.

If you need help, please reach out on the
[Kusama Validator Lounge](https://matrix.to/#/#KusamaValidatorLounge:polkadot.builders) on Element.
The team and other validators are there to help answer questions and provide tips from experience.

### How many KSM do I need to become an active Validator?

You can have a rough estimate on that by using the methods listed
[here](../../general/faq.md/#what-is-the-minimum-stake-necessary-to-be-elected-as-an-active-validator).
To be elected into the set, you need a minimum stake behind your validator. This stake can come from
yourself or from [nominators](../../learn/learn-nominator.md). This means that as a minimum, you
will need enough KSM to set up Stash and Controller [accounts](../learn/learn-cryptography.md) with
the existential deposit, plus a little extra for transaction fees. The rest can come from
nominators. To understand how validators are elected, check the
[NPoS Election algorithms](../../learn/learn-phragmen.md) page.

Make sure to adjust the Polkadot guide to run a Kusama network validator:
:::info On-Chain Data for Reference

1. When starting the node pass `--chain=kusama` CLI flag:
On Kusama, the minimum stake backing a validator in the active set is
{{ kusama: <MinimumStake network="kusama" defaultValue={5288388652143741} /> :kusama }}
{{ polkadot: <MinimumStake network="kusama" defaultValue={5288388652143741} /> :polkadot }} in the
era
{{ kusama: <RPC network="kusama" path="query.staking.currentEra" defaultValue="4838"/>. :kusama }}
{{ polkadot: <RPC network="kusama" path="query.staking.currentEra" defaultValue="4838"/>. :polkadot }}

On Polkadot, the minimum stake backing a validator in the active set is
{{ polkadot: <MinimumStake network="polkadot" defaultValue={17314855524834056}/> :polkadot }}
{{ kusama: <MinimumStake network="polkadot" defaultValue={17314855524834056}/> :kusama }} in the era
{{ polkadot: <RPC network="polkadot" path="query.staking.currentEra" defaultValue="998"/>. :polkadot }}
{{ kusama: <RPC network="polkadot" path="query.staking.currentEra" defaultValue="998"/>. :kusama }}

:::

:::tip Join the Thousand Validator Programme

[The Thousand Validator Programme](../../general/thousand-validators.md) is an initiative by Web3
Foundation and Parity Technologies to use the funds held by both organizations to nominate
validators in the community.

:::

**Warning:** Any KSM that you stake for your validator is liable to be slashed, meaning that an
insecure or improper setup may result in loss of DOT tokens! If you are not confident in your
ability to run a validator node, it is recommended to nominate your DOT to a trusted validator node
instead.

### Validator Rewards

On Kusama, one day is approximately four eras whereas on Polkadot, one era is approximately a day.
In each era, the validators elected to the active set earn era points which correspond to the actual
rewards earned that are distributed proportionally to the nominators after deducting the validator
commission. Currently, the minimum validator commission is set to
{{ kusama: <RPC network="kusama" path="query.staking.minCommission" filter = "percentage" defaultValue="10"/>%. :kusama }}
{{ polkadot: <RPC network="kusama" path="query.staking.minCommission" filter = "percentage" defaultValue="10"/>%. :polkadot }}
For more information, check the [validator payout](../maintain-guides-validator-payout.md) document.

## Run a Kusama Validator

Running a validator on the Kusama network is identical to running a Polkadot validator. Check out
the [Polkadot guide](../maintain-guides-how-to-validate-polkadot.md) on how to setup a validator.

```sh
./target/release/polkadot --pruning=archive --chain kusama
```
Make sure to adjust the Polkadot guide to run a Kusama network validator (the instructions will also
be available in the Polkadot Validator guide):

2. Similar to Polkadot network Kusama has its own token called KSM
- When starting the node pass `--chain=kusama` CLI flag
49 changes: 28 additions & 21 deletions docs/maintain/maintain-guides-how-to-validate-polkadot.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@ import RPC from "./../../components/RPC-Connection";

import MinimumStake from "./../../components/Minimum-Stake";

:::info

The following information applies to the Polkadot network. If you want to set up a validator on
Kusama, check out the [Kusama guide](kusama/maintain-guides-how-to-validate-kusama.md) instead.
:::tip

This guide will instruct you how to set up a validator node on the Polkadot network.
If you are a beginner, it is recommended that you start your validator journey on Kusama network.
Check the [Kusama guide](kusama/maintain-guides-how-to-validate-kusama.md) for details on how to get
started.

:::

## Preliminaries

Running a validator on a live network is a lot of responsibility! You will be accountable for not
only your own stake, but also the stake of your current nominators. If you make a mistake and get
slashed, your money and your reputation will be at risk. However, running a validator can also be
slashed, your tokens and your reputation will be at risk. However, running a validator can also be
very rewarding, knowing that you contribute to the security of a decentralized network while growing
your stash.

Expand All @@ -40,19 +39,16 @@ tackle yourself. Being a validator involves more than just executing the Polkado

Since security is so important to running a successful validator, you should take a look at the
[secure validator](maintain-guides-secure-validator.md) information to make sure you understand the
factors to consider when constructing your infrastructure. Web3 Foundation also maintains a
[reference implementation for a validator set-up](https://github.com/w3f/polkadot-validator-setup)
that you can use by deploying yourself (video walkthrough is available
[here](https://www.youtube.com/watch?v=tTn8P6t7JYc)). As you progress in your journey as a
factors to consider when constructing your infrastructure. As you progress in your journey as a
validator, you will likely want to use this repository as a _starting point_ for your own
modifications and customizations.

If you need help, please reach out on the
[Polkadot Validator Lounge](https://matrix.to/#/!NZrbtteFeqYKCUGQtr:matrix.parity.io?via=matrix.parity.io&via=matrix.org&via=web3.foundation)
on Riot. The team and other validators are there to help answer questions and provide tips from
[Polkadot Validator Lounge](https://matrix.to/#/#polkadotvalidatorlounge:web3.foundation) on
Element. The team and other validators are there to help answer questions and provide tips from
experience.

### How many DOT do I need?
### How many DOT do I need to become an active Validator?

You can have a rough estimate on that by using the methods listed
[here](../general/faq.md/#what-is-the-minimum-stake-necessary-to-be-elected-as-an-active-validator).
Expand All @@ -66,17 +62,17 @@ understand how validators are elected, check the
:::info On-Chain Data for Reference

On Polkadot, the minimum stake backing a validator in the active set is
{{ polkadot: <MinimumStake network="polkadot" defaultValue={18684315524834056}/> :polkadot }}
{{ kusama: <MinimumStake network="polkadot" defaultValue={18684315524834056}/> :kusama }} in the era
{{ polkadot: <RPC network="polkadot" path="query.staking.currentEra" defaultValue="799"/>. :polkadot }}
{{ kusama: <RPC network="polkadot" path="query.staking.currentEra" defaultValue="799"/>. :kusama }}
{{ polkadot: <MinimumStake network="polkadot" defaultValue={17314855524834056}/> :polkadot }}
{{ kusama: <MinimumStake network="polkadot" defaultValue={17314855524834056}/> :kusama }} in the era
{{ polkadot: <RPC network="polkadot" path="query.staking.currentEra" defaultValue="998"/>. :polkadot }}
{{ kusama: <RPC network="polkadot" path="query.staking.currentEra" defaultValue="998"/>. :kusama }}

On Kusama, the minimum stake backing a validator in the active set is
{{ kusama: <MinimumStake network="kusama" defaultValue={5367388652143741} /> :kusama }}
{{ polkadot: <MinimumStake network="kusama" defaultValue={5367388652143741} /> :polkadot }} in the
{{ kusama: <MinimumStake network="kusama" defaultValue={5288388652143741} /> :kusama }}
{{ polkadot: <MinimumStake network="kusama" defaultValue={5288388652143741} /> :polkadot }} in the
era
{{ kusama: <RPC network="kusama" path="query.staking.currentEra" defaultValue="4058"/>. :kusama }}
{{ polkadot: <RPC network="kusama" path="query.staking.currentEra" defaultValue="4058"/>. :polkadot }}
{{ kusama: <RPC network="kusama" path="query.staking.currentEra" defaultValue="4838"/>. :kusama }}
{{ polkadot: <RPC network="kusama" path="query.staking.currentEra" defaultValue="4838"/>. :polkadot }}
:::

**Warning:** Any DOT that you stake for your validator is liable to be slashed, meaning that an
Expand Down Expand Up @@ -373,6 +369,17 @@ validator mode right away:
./target/production/polkadot
```

:::info

If you want to run a validator on Kusama, you have an option to specify the chain. With no
specification, this would default to Polkadot.

```sh
./target/production/polkadot --chain=kusama
```

:::

```
2021-06-17 03:07:07 Parity Polkadot
2021-06-17 03:07:07 ✌️ version 0.9.5-95f6aa201-x86_64-linux-gnu
Expand Down

0 comments on commit 44f7d89

Please sign in to comment.