diff --git a/validators b/validators new file mode 100644 index 000000000..575c509ea --- /dev/null +++ b/validators @@ -0,0 +1,547 @@ +## Validators {#validators} + +If you **are a validator or wish to become one**, this section and will cover: \ + + + + +* How to become a validator +* Description of the network +* Hardware requirements +* Technical requirements +* Validators revenue +* The “know your validator” program, and earning delegations +* Running a single node network + + + +1. Becoming a validator +* Set up a **dedicated validator's website** and **signal your intention** to become a validator on our **[Discord](https://discord.gg/UDzpBFa)** server. + + \ +This is important since delegators will want to have information about the entity they are delegating their FET to. + +Strictly speaking this is not necessary, however, it is recommended. + +As a validator on the network you will want to get other** community users **to** delegate stake to you**. + +The more combined stake a validator has, the greater share of the block rewards they will take. + + + +* Seek Legal Advice + + \ +Seek legal advice if you intend to run a Validator. + + + +* Community + +We highly recommend you to get to know the validator community on our [discord](https://discord.gg/UDzpBFa) channel for more information, and to see the latest announcements about becoming a validator. + + + +2. Description of the network + +We have released our Stargate mainnet on July 29th, that is a fork of the Cosmos chain, adapted to particularly fit with Fetch.ai’s goals; see the [Technology](#technology) section: [The Fetch.ai blockchain](#the-fetch-ai-blockchain). + +Here is the information you will need for Stargate’s testnet version: + +**Parameter** **Value** + +**Chain ID** stargateworld-1 + +**Denomination** atestfet + +**Decimals** 18 (1testfet = 1000000000000000000atestfet) + +**Version** v0.8.x (fetchd >= v0.8.0-rc5) + +**RPC Endpoint** https://rpc-stargateworld.fetch.ai:443 + +**REST Endpoint** https://rest-stargateworld.fetch.ai:443 + +**Block Explorer** https://explore-stargateworld.fetch.ai/ + +**Token Faucet** Use block explorer + +**Seed Node(s)** 0831c7f4cb4b12fe02b35cc682c7edb03f6df36c@connect-stargateworld.t-v2-london-c.fetch-ai.com:36656 + +**_Information for Stargate mainnet?_** + + + +3. Validator revenue + + +#### How it works {#how-it-works} + +Validators **hosting a node** package **transactions** into **blocks **that are then added to the blockchain. + +They receive **FET rewards** for doing so. + +Blocks are grouped into **aeons**. A new aeon is generally created every 100 blocks, or roughly every 8 minutes. + +**One validator** is selected for **one aeon**. + +Validators then **compete with each other** to be selected for the next aeon. + +Validators must **stake a certain amount of FET** to be selected. The validators with the **most stake** are selected to become the next set of validators to produce blocks. + +Part of these staked FET must be provided by the validators themselves, however, other **community members can delegate their stake to validators** for a **share of their rewards**. + + +#### Validator revenue sources {#validator-revenue-sources} + +The sources of a validator’s revenue are: + + +##### Block rewards {#block-rewards} + + + +* Rewards are provided for **every block** that is produced by a validator. +* The **inflation rate** is set at an annual rate of **3%**. + + +##### Transaction fees {#transaction-fees} + + + +* All **transactions** that are submitted to the chain are charged a transaction fee denominated in FET. + + +##### Agent and Machine Learning services {#agent-and-machine-learning-services} + + + +* Hosting datasets for machine learning applications +* Agent search-and-discovery services and agent based oracle services + + +#### Validators minimal revenue {#validators-minimal-revenue} + +(Image from the Validators Crowdcast document) + + + +

>>>>> gd2md-html alert: inline image link here (to images/image4.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

+ + +![alt_text](images/image4.png "image_tooltip") + + +The rows represent the commission which validators will charge to those delegating their stake. + +(Image from the Validators Crowdcast document) + + + +

>>>>> gd2md-html alert: inline image link here (to images/image5.png). Store image on your image server and adjust path/filename/extension if necessary.
(Back to top)(Next alert)
>>>>>

+ + +![alt_text](images/image5.png "image_tooltip") + + +The columns represent the fraction of the stake that is delegated to the validator. + + + +4. Hardware requirements + +The hardware resources for running a validator node largely depend on the network load. + +As a recommended configuration we suggest the following requirements + + + +* 2 x CPU, either Intel or AMD, with the SSE4.1 and SSE4.2 flags (use lscpu to verify) +* 4 GB RAM +* 500 GB SSD +* 100 Mbit/s always-on internet connection +* Linux OS (Ubuntu 18.04 or 20.04 recommended) / MacOS + +Uptime is incredibly important for being a validator. It is expected that validators will have appropriate redundancies for compute, power, connectivity etc. + +While the blockchain itself is highly replicated, it is also expected that validators will perform local storage backups in order to minimise validator down time. + + + +5. Technical requirements + +Validators must understand the voting process that will be required to maintain the Fetch.ai Network. + +The installation requires Golang along with C++ Compiler. + + + +6. The Know Your Validator program + +Users that are not validators need to choose the validator they are wishing to delegate their tokens to for stake. + +Therefore, it is important that they know about who the various validators are, what they do, and what reward they can expect to receive from each. + +This is why we have set up the Know Your Validator program, to give users all the information they need to know. + +**_Page link when available_** + +If you haven’t been approached yet about this by the Fetch.ai team, please get in touch with us in the dedicated [Validators channel](https://discord.com/channels/441214316524339210/767751116317392945) on our Discord. + + + +7. Running a Single Node Network + +Before running a validator on mainnet, it can be very useful to be able to run a **single node network for testing**. + +This section will outline the steps that are required in order to configure a fetchd network (Stargate testnet) of 1 node: + + + +* Network setup + + Building your ledger + + + Removing any existing networks + + + Creating an initial genesis + + + Creating your validator key + + + Adding your validator to the network + + + Generating a validator transaction + + + Building the complete genesis + +* Running the local node +* Resetting the network + +Let’s now detail each of these steps. + + + +* Network setup +1. Build the ledger from source + +**a - Prerequisites** + +Go 1.14+ (installation instructions available [here](https://golang.org/dl/)) + +**Ubuntu 20.04 / Debian 10** + + +``` +# Run the following command if using Ubuntu +sudo apt-get install libgmp-dev swig + +# Download and install the MCL libraries +cd ~ +wget https://github.com/herumi/mcl/archive/v1.05.tar.gz +tar xvf v1.05.tar.gz +cd mcl-1.05 +sudo make install +sudo ldconfig +``` + + +**Mac OS** + +First open your terminal and install Homebrew, by copy pasting the command line available on their [website](https://brew.sh/). + +Once this done: + + +``` +# Run the following command +brew install swig gmp + +# Download and install the MCL libraries +cd ~ +wget https://github.com/herumi/mcl/archive/v1.05.tar.gz +tar xvf v1.05.tar.gz +cd mcl-1.05 +sudo make install +sudo ldconfig +``` + + +**b - Building the code** + +Download the latest released version from github using the following command: + + +``` +git clone https://github.com/fetchai/fetchd.git && cd fetchd +``` + + +Then build the code with the command: + + +``` +make build +``` + + +This will generate the following binaries: + + + +* `./build/fetchcli` - This is the command line client that is useful for interacting with the network +* `./build/fetchd` - This is the block chain node daemon and can be configured to join the network + +For non-developer users we recommend that the user installs the binaries into their system. This can be done with the following command: + + +``` +sudo make install +``` + + +This will install the binaries in the directory specified by your `$GOBIN` environment variable. + +These steps only need to be done once in order to set up the local network. + + + +2. Remove any existing networks + +Since we are starting a new network we need to remove any local files that we have in our system from a previous network: + + +``` +rm -Rf ~/.fetchd + +``` + + + +3. Create an initial genesis + +Create the initial genesis file (~/.fetchd/config/genesis.json) with the following command: + + +``` +fetchd init --chain-id localnet-1 my-local-node-name +``` + + +For this command, see the above section Description of the network **_(link_**) + + + `localnet-1` is the chain id + + + `my-local-node-name` is the moniker for the node + +If you want to make any updates to the genesis, it is a good opportunity to make these updates now. + + + +4. Create your validator key + +In the following steps we will need to create the public/private keypair for our node. + +To create a new key called "validator" use the following command. + + +``` +fetchd keys add validator +``` + + +Note: `validator` is the name of the key in the keyring + +For more information checkout the complete [documentation on keys](https://github.com/fetchai/fetchd/blob/b287f6e670a834b36bcb11f826141339b7da0d60/docs/cli-keys) ---.**_404 link_** + + + +5. Adding the validator to the network + +To set the initial state for the network use the following command. This allocates `100000000000000000000` stake tokens to the validator which can be bonded. + + +``` +fetchd add-genesis-account validator 100000000000000000000stake + +``` + + + +6. Generating a validator transaction + +To get your validator to sign the genesis block (and to agree that this is the correct genesis starting point) use the following command. + + +``` +fetchd gentx validator 100000000000000000000stake --chain-id localnet-1 +``` + + +Notes: + + + +* `validator` here is the name that you have given to the key. +* Replace the chain-id value by the one seen above in the Description of the network section (**_link_**) +7. Building the complete genesis + +To build final genesis configuration for the network run the following command: + + +``` +fetchd collect-gentxs +``` + + +After running this command the network is successfully configured and you have computed the final genesis configuration for the network. + + +#### +Running the local node {#running-the-local-node} + +To run the network use the following command: + + +``` +`fetchd start` +``` + + + +#### +Resetting the network {#resetting-the-network} + +Often you will want to clear out all the data from the network and start again. To do that in a local network simply run the following command: + + +``` +`fetchd unsafe-reset-all` +``` + + +This resets the chain back to genesis, and you DO NOT need to perform the network setup steps again. + +After running this command you can simply run the `fetchd start` command again. + + +### c) Running a mainnet node + + +#### Setting up a Validator Node + +This guide assumes that you have successfuly [installed](../../building/), configured and [connected](../../joining-a-testnet/) your validator to the desired network. + + +#### Creating a validator + +To create a validator on the network you will need to send a transaction to the network bonding / staking your FET tokens. This process registers you as a validator and if you are one of the chosen validators you will start to produce blocks. + + +``` +```bash +fetchcli tx staking create-validator \ + --amount= \ + --pubkey=$(fetchd tendermint show-validator) \ + --moniker="choose a moniker" \ + --chain-id= \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --min-self-delegation="" \ + --from= +``` +``` + + +** Beacon World Example ** + +(Deprecated network) + +In the case of Beaconworld the minimum self delegation amount (the amount of FET that the validator themselves must stake) is 1000TESTFET (i.e. 1000000000000000000000atestfet). + +Before trying to create a validator you should verify that you have this required minimum number of tokens available beforehand. The easiest way to do this is via the [CLI](../../cli-tokens/). + +Here is an example of a typical command line command that will register the node as running the validator. + + +``` +```bash +fetchcli tx staking create-validator \ + --amount=1000000000000000000000atestfet \ + --pubkey=fetchvalconspub1zcjduepqa8ldmfnt6avct9x5h7269jjfmv2l22pnejezz37vh7syajfyku6stlj0s9 \ + --moniker="my-test-validator" \ + --chain-id=beaconworld-3 \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --min-self-delegation="1000000000000000000000" \ + --from=beaonworld-test-key +``` +``` + + + +#### Editing a validator + +Over time it is possible that validators will want to adjust various settings about their nodes. This can be simple things like the associated website for a validator or more consequential actions like altering the commission rate. + +In either case, should a validator choose to make this update they would send an "edit-validator" transaction to the network. These can be created in a similar way to the "create-validator" transactions as shown below: + +```bash + +fetchcli tx staking edit-validator + + --moniker="choose a moniker" \ + + --website="https://fetch.ai" \ + + --details="To infinity and beyond!" \ + + --chain-id=<chain_id> \ + + --commission-rate="0.10" + + --from=<key_name> + +``` + + +#### Unbonding a validator + +When / if a validator wants to stop being a validator for any reason, they can unbond some or all of their staked FET. This is done with the following command. + + +``` +```bash +./build/fetchcli tx staking unbond \ + \ + \ + --from +``` +``` + + +An example of the command is given in the following example: + + +``` +```bash +./build/fetchcli tx staking unbond \ + fetchvaloper1jqqwdch3jmzlmj4tjfn67s3sqm9elkd3wrpspf \ + 1000000000000000000000atestfet \ + --from beaonworld-test-key +``` +``` + + +** Note ** + +Validators' obligations continue until the end of the aeon (which is typically 100 blocks or ~8 minutes depending on the configuration). It is therefore important that after a validator unbonds their stake they must leave their node up and running for 2 complete aeons before switching off. Failure to do so is treated as malicious behaviour and will result in stake being slashed.