diff --git a/packages/docs/pages/networks/testnets.mdx b/packages/docs/pages/networks/testnets.mdx index 04d5af6e..7a35acc9 100644 --- a/packages/docs/pages/networks/testnets.mdx +++ b/packages/docs/pages/networks/testnets.mdx @@ -25,9 +25,9 @@ If you find a bug, please submit an issue with the `bug` [issue template](https: 1. [Environment setup](./testnets/environment-setup.mdx) 2. [Pre-genesis instructions](./testnets/pre-genesis.mdx) -3. [Pre-genesis validator setup](../operators/validators/genesis-validator-setup.mdx) +3. [Pre-genesis validator setup](../operators/validators/validator-setup.mdx) 4. [Pre-genesis validator apply](./testnets/genesis-validator-apply.mdx) -5. [Running your genesis validator](../operators/validators/run-your-genesis-validator.mdx) +5. [Running your genesis validator](../operators/validators/validator-setup.mdx#start-validating) 6. [Running a full node](../operators/ledger/running-a-full-node.mdx) 7. [Becoming a validator post-genesis](./testnets/post-genesis-validator.mdx) diff --git a/packages/docs/pages/networks/testnets/faq.mdx b/packages/docs/pages/networks/testnets/faq.mdx index 75b6e175..a67f3313 100644 --- a/packages/docs/pages/networks/testnets/faq.mdx +++ b/packages/docs/pages/networks/testnets/faq.mdx @@ -2,7 +2,7 @@ ### **Q: How do I join as a validator post-genesis?** -**A:** Joining as a validator post genesis can be done following [these instructions](../../operators/validators/post-genesis-validator-setup.mdx). +**A:** Joining as a validator post genesis can be done following [these instructions](../../operators/validators/validator-setup.mdx). ### **Q: How do I use the Faucet?** diff --git a/packages/docs/pages/networks/testnets/genesis-validator-apply.mdx b/packages/docs/pages/networks/testnets/genesis-validator-apply.mdx index aadd597e..588eb4ca 100644 --- a/packages/docs/pages/networks/testnets/genesis-validator-apply.mdx +++ b/packages/docs/pages/networks/testnets/genesis-validator-apply.mdx @@ -6,7 +6,7 @@ Before a testnet launches, you can apply to be a genesis validator. ### Set up -Follow [this guide](../../operators/validators/genesis-validator-setup.mdx#pre-genesis) on how to generate your "pre-genesis" validator files. +Follow [this guide](../../operators/validators/validator-setup.mdx#pre-genesis) on how to generate your "pre-genesis" validator files. After this, you'll have a `validator.toml` file, the contents of which will look something like the following: diff --git a/packages/docs/pages/networks/testnets/joining-the-testnet.mdx b/packages/docs/pages/networks/testnets/joining-the-testnet.mdx index 39a6e707..2e38dd00 100644 --- a/packages/docs/pages/networks/testnets/joining-the-testnet.mdx +++ b/packages/docs/pages/networks/testnets/joining-the-testnet.mdx @@ -5,7 +5,7 @@ Depending on whether you are a genesis validator, you can join the latest testne ## Joining as a genesis validator Joining the testnet validator is identical to that of a mainnet validator. -For this reason, please refer to [these docs](../../operators/validators/run-your-genesis-validator.mdx). +For this reason, please refer to [these docs](../../operators/validators/validator-setup.mdx#start-validating). ## Joining as a full node If you are not a genesis validator, please follow the steps for [joining as a full node](../../operators/ledger/running-a-full-node.mdx). diff --git a/packages/docs/pages/networks/testnets/post-genesis-validator.mdx b/packages/docs/pages/networks/testnets/post-genesis-validator.mdx index a396be69..ec8c9184 100644 --- a/packages/docs/pages/networks/testnets/post-genesis-validator.mdx +++ b/packages/docs/pages/networks/testnets/post-genesis-validator.mdx @@ -2,7 +2,7 @@ After genesis, you can still join the network as a user and become a validator through self-bonding. -After [joining the network as a full node](../../operators/ledger/running-a-full-node.mdx), you must [create a validator account](../../operators/validators/post-genesis-validator-setup.mdx). +After [joining the network as a full node](../../operators/ledger/running-a-full-node.mdx), you must [create a validator account](../../operators/validators/validator-setup.mdx). After this has been completed, you will need to increase your validator's `bonded-stake`, which can be done by self-bonding tokens sourced from the faucet. diff --git a/packages/docs/pages/networks/testnets/testnet-history.mdx b/packages/docs/pages/networks/testnets/testnet-history.mdx index af897804..4353e4a8 100644 --- a/packages/docs/pages/networks/testnets/testnet-history.mdx +++ b/packages/docs/pages/networks/testnets/testnet-history.mdx @@ -202,7 +202,8 @@ mkdir backup-pregenesis && cp -r .namada/pre-genesis backup-pregenesis/ rm -r .namada/public-testnet-3.0.81edd4d6eb6 rm .namada/public-testnet-3.0.81edd4d6eb6.toml ``` -WARNING: Do not delete the entire `.namada` folder, as it contains your pre-genesis keys. If this is accidentally done, you will have to copy over the backup-pregenesis file. See [these instructions](../../operators/validators/run-your-genesis-validator.mdx) for more details +WARNING: Do not delete the entire `.namada` folder, as it contains your pre-genesis keys. If this is accidentally done, you will have to copy over the backup-pregenesis file. + 3. Rejoin the network ```bash copy export CHAIN_ID="public-testnet-3.0.81edd4d6eb6" diff --git a/packages/docs/pages/operators.mdx b/packages/docs/pages/operators.mdx index a8377825..1c376b1c 100644 --- a/packages/docs/pages/operators.mdx +++ b/packages/docs/pages/operators.mdx @@ -7,4 +7,4 @@ The guide assumes that you have already installed the node and are familiar with - [Running a full node](./operators/ledger.mdx) - [Running a validator node](./operators/validators.mdx) -- [Setting up a local network](./operators/local-network.mdx) \ No newline at end of file +- [Setting up a local network](./operators/networks/local-network.mdx) \ No newline at end of file diff --git a/packages/docs/pages/operators/_meta.json b/packages/docs/pages/operators/_meta.json index 998de86e..15b68b28 100644 --- a/packages/docs/pages/operators/_meta.json +++ b/packages/docs/pages/operators/_meta.json @@ -2,7 +2,7 @@ "hardware": "Hardware requirements", "ledger": "Running a full node", "validators": "Validators", - "local-network": "Setting up a local network", + "networks": "Starting a network", "ibc": "IBC Relayers", "troubleshooting": "Troubleshooting" } \ No newline at end of file diff --git a/packages/docs/pages/operators/networks.mdx b/packages/docs/pages/operators/networks.mdx new file mode 100644 index 00000000..2b5710ef --- /dev/null +++ b/packages/docs/pages/operators/networks.mdx @@ -0,0 +1,8 @@ +# Starting Namada networks + +This guide will explore setting up Namada networks. + +It is broken into the following sections: + +* [Decentralised network setup](./networks/genesis-flow.mdx) +* [Local network setup](./networks/local-network.mdx) \ No newline at end of file diff --git a/packages/docs/pages/operators/networks/_meta.json b/packages/docs/pages/operators/networks/_meta.json new file mode 100644 index 00000000..fb0eb0e9 --- /dev/null +++ b/packages/docs/pages/operators/networks/_meta.json @@ -0,0 +1,4 @@ +{ + "genesis-flow": "Setting up a decentralised network", + "local-network": "Setting up a local network" +} \ No newline at end of file diff --git a/packages/docs/pages/operators/networks/genesis-flow.mdx b/packages/docs/pages/operators/networks/genesis-flow.mdx new file mode 100644 index 00000000..23901d6b --- /dev/null +++ b/packages/docs/pages/operators/networks/genesis-flow.mdx @@ -0,0 +1,15 @@ +# Setting up a decentarlised Namada network + +Setting up a decentralised Namada network requires coordination between two distinct parties: + +1. [The network coordinator](./genesis-flow/coordinator.mdx#the-network-coordinator) +2. [The pre-genesis network participants](./genesis-flow/participants.mdx#pre-genesis-network-participants) + +This process is also called the **genesis ceremony**. + + + + + + + diff --git a/packages/docs/pages/operators/networks/genesis-flow/_meta.json b/packages/docs/pages/operators/networks/genesis-flow/_meta.json new file mode 100644 index 00000000..0573abb0 --- /dev/null +++ b/packages/docs/pages/operators/networks/genesis-flow/_meta.json @@ -0,0 +1,4 @@ +{ + "coordinator": "The network coordinator", + "participants": "Pre-genesis participants" +} \ No newline at end of file diff --git a/packages/docs/pages/operators/networks/genesis-flow/coordinator.mdx b/packages/docs/pages/operators/networks/genesis-flow/coordinator.mdx new file mode 100644 index 00000000..41de6a9e --- /dev/null +++ b/packages/docs/pages/operators/networks/genesis-flow/coordinator.mdx @@ -0,0 +1,47 @@ +import { Steps } from 'nextra-theme-docs' + +## The network coordinator + +The network coordinator is responsible for: + + 0. [Setup](#setup) + 1. [Collecting pre-genesis public keys](#collecting-pre-genesis-public-keys) + 2. [Allocating pre-genesis NAM balances](#allocating-pre-genesis-nam-balances) + 3. [Collecting pre-genesis transactions](#collecting-pre-genesis-transactions) + 4. [Generating the genesis block](#generating-the-genesis-block) + +### Setup + +The genesis ceremony preperation includes creating a coordinated location for the pre-genesis network participants to submit their public keys. The network coordinator is responsible for setting up this location. Conventionally, the network coordinator will host a git repository that allows the pre-genesis network participants to submit their public keys. The network coordinator must ensure that the git repository is publicly accessible and that the pre-genesis network participants are able to submit their public keys in a secure manner. + +Further, the network coordinator is responsible for making clear timelines for the various steps in the genesis ceremony. The network coordinator must ensure that the pre-genesis network participants are aware of the timelines and that they are able to submit their public keys, transactions, and be online in due time. + + + +### Collecting pre-genesis public keys + +The ceremony begins by the network coordinator collecting the public keys of the pre-genesis network participants. The network coordinator must ensure that the total number of pre-genesis public keys collected is equal to the total number of pre-genesis network participants. + +Conventionally, the network coordinator hosts a git repository that allows the pre-genesis network participants to submit their public keys. The network coordinator must ensure that the git repository is publicly accessible and that the pre-genesis network participants are able to submit their public keys in a secure manner. + +### Allocating pre-genesis NAM balances + +Once the participants have [submitted their keys and addresses](./participants.mdx#submitting-keys-and-addresses) the network coordinator must allocate balances to these addresses/public keys. The coordinator will often have prior identity information associated with desired balances, which they will then associate with the public keys and addresses in order to set the correct balances in `balances.toml`. The coordinaotor must also ensure that the total pre-genesis NAM balances allocated to the pre-genesis network participants is equal to the total NAM supply. + +After this is completed, the network coordinator will publish the `balances.toml` file that contains the pre-genesis NAM balances allocated to the pre-genesis network participants. The `balances.toml` file should be published in the same location as the pre-genesis public keys were submitted. + + +### Collecting pre-genesis transactions + +Once the participants have [submitted their keys and addresses](./participants.mdx#submitting-keys-and-addresses) the network coordinator must collect the signed pre-genesis transactions from the pre-genesis network participants. The network coordinator must ensure that the total number of pre-genesis transaction files collected is equal to the total number of pre-genesis network participants. + +The network coordinator then aggregates these transaction files into one file and saves it as the `transactions.toml` file to be used in the generation of the genesis block. + +The `transactions.toml` file is validated by the network coordinator to ensure that each transaction has been correctly signed by each pre-genesis network participant. The network coordinator must ensure that the `transactions.toml` file is valid before proceeding to the next step. + +### Generating the genesis block + +Once the network coordinator has collected the pre-genesis public keys, allocated pre-genesis NAM balances, and collected pre-genesis transactions, the network coordinator is ready to generate the genesis block. + + + \ No newline at end of file diff --git a/packages/docs/pages/operators/networks/genesis-flow/participants.mdx b/packages/docs/pages/operators/networks/genesis-flow/participants.mdx new file mode 100644 index 00000000..47d8a8c6 --- /dev/null +++ b/packages/docs/pages/operators/networks/genesis-flow/participants.mdx @@ -0,0 +1,204 @@ +import { Callout } from 'nextra-theme-docs' +import { Steps } from 'nextra-theme-docs' + + +## Pre-genesis network participants + +The pre-genesis network participants are the entities that are participating in the genesis ceremony. The pre-genesis network participants are responsible for: +1. [Generating their public and private keys](#generating-keys) +2. [Submitting their public keys and addresses to the network coordinator](#submitting-keys-and-addresses) +3. [Generating their pre-genesis transactions](#generating-transactions) +4. [Signing their pre-genesis transactions](#signing-transactions) +5. [Submitting their pre-genesis transactions to the network coordinator](#submitting-transactions) + + + +### Generating keys + +Before the genesis ceremony begins, the pre-genesis network participants must generate their public and private keys. The pre-genesis network participants must ensure that their private keys are kept secret and that their public keys are submitted to the network coordinator in due time. + +This can be done through the namada cli: + +```bash +ALIAS="" +namadac gen key --alias $ALIAS --pre-genesis +``` + +After the user has entered their passwords and written down their mnemonic phrase, the namada cli will save the keys to the `pre-genesis` folder inside the [base directory](../../ledger/base-directory.mdx). + +In order to print the keys, the user can run the following command: + +```bash +# Not recommended in production since it will print the private key to the terminal (which can be recovered) +cat $BASE_DIR/pre-genesis/wallet.toml +``` + +It is the public keys that the pre-genesis network participants must submit to the network coordinator. + +```toml +# Example wallet.toml +[public_keys] +bengt = "ED25519_PK_PREFIXtpknam1qq2vscpcvhdwht9tldj9ntxnknandhnerhzd6d42xqzukw2kpcfpudh3dl2" + +... + +[addresses] +bengt = "tnam1qq97eqvv4lam8ds00j9em2s2f0r8e7r60qw9fdfq" +``` + +It is then the right hand side of each of these fields that is submitted to the network coordinator, i.e `ED25519_PK_PREFIXtpknam1qq2vscpcvhdwht9tldj9ntxnknandhnerhzd6d42xqzukw2kpcfpudh3dl2` and `tnam1qq97eqvv4lam8ds00j9em2s2f0r8e7r60qw9fdfq` in the example above. + +The network coordinator should specify the schema in which the pre-genesis network participants should submit their public keys and addresses. A toml file with the following schema is recommended: + +```toml +[] +"public-key" = "ED25519_PK_PREFIXtpknam1qpjs6jrjuu5cj508ys7ezee4r40v8as6vz4j3ddc9qm68nfhf5n7clp4xse" +"address" = "tnam1qq5skuga54tfs7422hzz8sqvk3s6lhe2dg32jjhd" +``` + +### Submitting keys and addresses + +After the network coordinator has published the location (conventionally a git repository) for the pre-genesis network participants to submit their public keys, the participants are expected to submit their generated public keys (and their corresponding addresses) to the network coordinator in due time. The deadline will be set by the network coordinator. + +### Generating transactions + +Participants are also responsible for generating the genesis-block transactions that set the initial state of the blockchain, including initialising genesis validator accounts and bonding to them. However, it is only possible to make transactions that require value once the balances of the keys become agreed upon (once the `balances.toml` file has been published). + +#### Generate an established account + +In order to generate a pre-genesis validator account, the pre-genesis network participants must first generate an established account. This can be done through the namada cli: + + +The `$ALIAS` variable is the alias of the pre-genesis keys that were generated in the [Generating keys](#generating-keys) step. + + +```bash +#Ensure $BASE_DIR is set to the base directory +TX_FILE_PATH="$BASE_DIR/pre-genesis/transactions.toml" +namadac utils init-genesis-established-account --path $TX_FILE_PATH --alias $ALIAS + +# You can change the `--path` argument to any file path, but the recommended is `$BASE_DIR/pre-genesis/transactions.toml` +``` + +The command will ouptut the generated address of the established account. + +```text +Derived established account address: tnam1q8lsztqqhpjxdwzw88mqqc2mun7dvpxvas3v2dxk +``` + +It is useful to save this address for later use. + +```bash +ESTABLISHED_ACCOUNT_ADDRESS=tnam1q8lsztqqhpjxdwzw88mqqc2mun7dvpx +``` + +This will generate a `transactions.toml` file that contains the pre-genesis transaction that will establish the account. The `transactions.toml` file should look something like this: + +```toml +[[established_account]] +vp = "vp_user" +threshold = 1 +public_keys = ["tpknam1qr872zwdvw4u4nkpl0ykmvhyvxw7j0u6g7ymz03d7he0jr3szkuwczddjp2"] +``` + +#### Generate a pre-genesis multisignature account + +In order to generate a pre-genesis multisignature account, simply add multiple `--alias` flags to the command: + +```bash +# Ensure $BASE_DIR is set to the base directory +# Assuming that the values of $ALIAS1, $ALIAS2, and $ALIAS3 are the aliases of the pre-genesis keys that were generated in the [Generating keys](#generating-keys) step. +TX_FILE_PATH="$BASE_DIR/pre-genesis/transactions.toml" +namadac utils init-genesis-established-account --path $TX_FILE_PATH --alias $ALIAS1 --alias $ALIAS2 --alias $ALIAS3 +``` + +The command will ouptut the generated address of the multisignature account. + + +```text +Derived established account address: tnam1q8qvns6ndpff03wmszkhgepk2r8f9ws68ugktfml +``` + +The corresponding `transactions.toml` file should look something like this: + +```toml +[[established_account]] +vp = "vp_user" +threshold = 1 +public_keys = ["tpknam1qr872zwdvw4u4nkpl0ykmvhyvxw7j0u6g7ymz03d7he0jr3szkuwczddjp2", "tpknam1qpz5n0u49s6s5jx4nyycyw0w288yfq96p3lvwxkedxyw77y0vd53sqmryce"] +``` + +#### Generate a pre-genesis validator account + + +This step will require the `balances.toml` file to have been published by the network coordinator. + + +Once the pre-genesis network participants have generated respective pre-genesis established accounts, they can generate their pre-genesis validator accounts. This can be done through the namada cli: + +```bash +# Ensure $BASE_DIR is set to the base directory +# Ensure $ESTABLISHED_ACCOUNT_ADDRESS is set +# Ensure $TX_FILE_PATH is set + +EMAIL="" +SELF_BOND_AMOUNT=1000000 # Set this to the amount of NAM you want to self-bond +VALIDATOR_ALIAS="" +namadac utils init-genesis-validator \ + --address $ESTABLISHED_ACCOUNT_ADDRESS \ + --alias $VALIDATOR_ALIAS \ + --net-address "127.0.0.1:26656" \ + --commission-rate 0.05 \ + --max-commission-rate-change 0.01 \ + --self-bond-amount $SELF_BOND_AMOUNT \ + --email $EMAIL \ + --path $TX_FILE_PATH +``` + + + +The `SELF_BOND_AMOUNT` must be less than or equal to the amount of NAM allocated to the pre-genesis keys in the `balances.toml` that was published by the network coordinator. It will correspond to the self-bonded stake of the validator account at genesis. + +The `--net-address` specifies the network address of the validator node given by "IP:PORT". It is also possible to use DNS names instead of IP:PORT addresses. + +The `--alias` flag is the moniker name of the validator account. + +The `--commission-rate` and `--max-commision-rate` flags are the commission rate and the maximum permitted commission rate change of the validator account per epoch. See the validator docsfor more info. + +The `--email` flag is the email address of the validator account. This is used for the validator account to receive notifications from the network coordinator and other participants. + +The `--address` flag is the Namada address of the account. + +The `--path` flag is the path to the `transactions.toml` file that will be appended to, and requires the established account to already be initialised under. + + + +The above command will append the necessary transactions to the `transactions.toml` file. The `transactions.toml` file should look something like this: + +Successful execution will output the new validator address: + +```text +Validator account address: tnam1q8lsztqqhpjxdwzw88mqqc2mun7dvpxvas3v2dxk +``` + +### Signing transactions + +Once the `transactions.toml` file has been generated, the pre-genesis network participants must sign the transactions. This can be done through the namada cli: + +```bash +namadac utils sign-genesis-txs \ + --path $TX_FILE_PATH \ + --output $BASE_DIR/pre-genesis/signed-transactions.toml \ + --alias $VALIDATOR_ALIAS # This is only necessary if a validator account was generated, otherwise leave out the flag entirely +``` + +The above command will output a `signed-transactions.toml` file that contains the signed transactions. + + +### Submitting transactions + +Once all pre-genesis transactions have been generated and signed, the pre-genesis network participants must submit their transactions to the network coordinator in due time. The deadline will be set by the network coordinator. This will involve simply submitting the `signed-transactions.toml` file to the network coordinator at the agreed upon location. + +By convention, a directory for each pre-genesis network participant is created in the git repository. The `signed-transactions.toml` file is then submitted to the respective directory. + + \ No newline at end of file diff --git a/packages/docs/pages/operators/local-network.mdx b/packages/docs/pages/operators/networks/local-network.mdx similarity index 95% rename from packages/docs/pages/operators/local-network.mdx rename to packages/docs/pages/operators/networks/local-network.mdx index ee88443e..5c2a809d 100644 --- a/packages/docs/pages/operators/local-network.mdx +++ b/packages/docs/pages/operators/networks/local-network.mdx @@ -1,10 +1,10 @@ -import Expandable from "../../components/Expandable"; +import Expandable from "../../../components/Expandable"; # Spinning up a local network ## Prerequisites -Namada must be installed [from source](../introduction/install/source.mdx) in order to run a local network. +Namada must be installed [from source](../../introduction/install/source.mdx) in order to run a local network. There is a script that has been written specifically for this purpose, which can be found under `MakeFile` in the root directory. diff --git a/packages/docs/pages/operators/validators.mdx b/packages/docs/pages/operators/validators.mdx index ed611d97..82547a08 100644 --- a/packages/docs/pages/operators/validators.mdx +++ b/packages/docs/pages/operators/validators.mdx @@ -17,6 +17,6 @@ In addition, the validator node must meet the [minimum hardware requirements](./ #### Steps -See these steps for [setting up a genesis validator](./validators/genesis-validator-setup.mdx). +See these steps for [setting up a genesis validator](./validators/validator-setup.mdx). -See these steps for [setting up a post-genesis validator](./validators/post-genesis-validator-setup.mdx). \ No newline at end of file +See these steps for [setting up a post-genesis validator](./validators/validator-setup.mdx). \ No newline at end of file diff --git a/packages/docs/pages/operators/validators/_meta.json b/packages/docs/pages/operators/validators/_meta.json index e5c234f3..52e83075 100644 --- a/packages/docs/pages/operators/validators/_meta.json +++ b/packages/docs/pages/operators/validators/_meta.json @@ -1,6 +1,4 @@ { - "genesis-validator-setup": "Genesis validator setup", - "run-your-genesis-validator": "Running a genesis validator", - "post-genesis-validator-setup": "Initialising a validator account", + "validator-setup": "Validator setup", "staking": "Staking" } diff --git a/packages/docs/pages/operators/validators/run-your-genesis-validator.mdx b/packages/docs/pages/operators/validators/run-your-genesis-validator.mdx deleted file mode 100644 index 45fd53ff..00000000 --- a/packages/docs/pages/operators/validators/run-your-genesis-validator.mdx +++ /dev/null @@ -1,32 +0,0 @@ -# Run your node as a genesis validator - -Once the `CHAIN_ID` has been released, it is possible to join the testnet. If the node joining is registered as a genesis-validator in the genesis file, it will be able to participate in the consensus and produce blocks from the start of the chain. - -#### Joining the network -As a genesis validator, it is then possible to join the network with the `CHAIN_ID` distributed. Let's say this `CHAIN_ID` is `namada-mainnet`. - -In this case, the genesis validator can join the network with: - -``` bash copy -export CHAIN_ID="namada-mainnet" -namada client utils join-network \ ---chain-id $CHAIN_ID --genesis-validator $ALIAS -``` - -#### Start your node and sync -```bash copy -NAMADA_LOG=info CMT_LOG_LEVEL=p2p:none,pex:error NAMADA_CMT_STDOUT=true namada node ledger run -``` -Optional: If you want more logs, you can instead run -```bash copy -NAMADA_LOG=debug CMT_LOG_LEVEL=p2p:none,pex:error NAMADA_CMT_STDOUT=true namada node ledger run -``` -And if you want to save your logs to a file, you can instead run: -```bash copy -TIMESTAMP=$(date +%s) -NAMADA_LOG=debug CMT_LOG_LEVEL=p2p:none,pex:error NAMADA_CMT_STDOUT=true namada node ledger run &> logs-${TIMESTAMP}.txt -tail -f -n 20 logs-${TIMESTAMP}.txt ## (in another shell) -``` -#### If started correctly you should see the following log: -`[] This node is a validator ...` - diff --git a/packages/docs/pages/operators/validators/post-genesis-validator-setup.mdx b/packages/docs/pages/operators/validators/validator-setup.mdx similarity index 63% rename from packages/docs/pages/operators/validators/post-genesis-validator-setup.mdx rename to packages/docs/pages/operators/validators/validator-setup.mdx index b3a4499f..dcb991d9 100644 --- a/packages/docs/pages/operators/validators/post-genesis-validator-setup.mdx +++ b/packages/docs/pages/operators/validators/validator-setup.mdx @@ -1,19 +1,43 @@ import { Callout } from 'nextra-theme-docs' -# Generating a validator account +# Setting up a validator account + +## Genesis validators + +A genesis validator is one which is a validator right from the first block of the chain, i.e., at genesis. The details of genesis validators are hardcoded into the genesis file that is distributed to all users who want to interact with a chain. + +### Prerequisites + +- a machine that meets the [requirements](../hardware.mdx) for running a validator node +- an associated public IPv4 address with ports 26656 reachable from anywhere for P2P connections + +### Method + +The method for setting up a genesis validator is described under the [pre-genesis participants](../networks/genesis-flow/participants.mdx#generate-a-pre-genesis-validator-account) section. + + +## Post-genesis validators + +Post-genesis validators are validators that become initialised after the genesis block. This is the most common way of becoming a validator, and is the method described in this section. Note the use of the placeholder `aliace` for the alias parameter. This is a completely configurable parameter, and should just refer to the alias of the key/address generated. + +### Initialising a new validator account + +The user must first generate a key pair for their validator account. + ```bash copy KEY_ALIAS="aliace" -namada wallet address gen --alias $KEY_ALIAS +namada wallet key gen --alias $KEY_ALIAS ``` Now choose a name for your validator: ```bash copy export VALIDATOR_ALIAS="" +export EMAIL="" ``` A validator account requires additional keys compared to a user account, so start by initialising a validator account: @@ -24,9 +48,23 @@ namada client init-validator \ --account-keys $KEY_ALIAS \ --signing-keys $KEY_ALIAS \ --commission-rate \ - --max-commission-rate-change + --max-commission-rate-change \ + --email $EMAIL +``` + +It is also possible to convert an established account to a validator account: + +```bash copy +namada client become-validator \ + --address $ESTABLISHED_ACCOUNT_ADDRESS \ + --signing-keys $KEY_ALIAS \ + --commission-rate \ + --max-commission-rate-change \ + --email $EMAIL ``` +The validator account will now have the same alias as the established account. + When initialising a validator account, it is also mandatory to specify both the `commission-rate` charged by the validator for delegation rewards (in decimal format) as well as the `maximum-commission-rate-change` per epoch in the `commission-rate`. Both are expressed as a decimal between 0 and 1. The standard for mainnet will be set by social consensus, but for testnets, the standard has been `0.01` and `0.05`, respectively. This command will generate the keys required for running a validator: @@ -38,10 +76,12 @@ Then, it submits a transaction to the ledger that generates the new validator ac The keys and the alias of the address will be saved in your wallet. +### Start validating + **IMPORTANT** -Our local ledger node will also be setup to run this validator, you just have to shut it down with e.g. `Ctrl + C`, then start it again with the same command as before. +The local ledger node will also be setup to run this validator, you just have to shut it down with e.g. `Ctrl + C`, then start it again with the same command as before. ```shell copy