Merge PR #3838: Update Docs for mainnet

This commit is contained in:
gamarin2 2019-03-13 15:09:39 +01:00 committed by Jack Zampolin
parent 7af11ece92
commit 5b62109334
11 changed files with 271 additions and 238 deletions

View File

@ -20,12 +20,12 @@ breaking changes.
**Note**: Requires [Go 1.11.5+](https://golang.org/dl/)
## Cosmos Hub Public Testnet
## Cosmos Hub Mainnet
To run a full-node in the latest public testnet of the Hub, first [install `gaia`](./docs/gaia/installation.md), then follow [the guide](./docs/gaia/join-testnet.md).
To run a full-node for the mainnet of the Cosmos Hub, first [install `gaia`](./docs/gaia/installation.md), then follow [the guide](./docs/gaia/join-mainnet.md).
For status updates and genesis files, see the
[testnets repo](https://github.com/cosmos/testnets).
For status updates and genesis file, see the
[launch repo](https://github.com/cosmos/launch).
## Quick Start

View File

@ -26,7 +26,7 @@ module.exports = {
sidebar: [
{
title: "Overview",
collapsable: false,
collapsable: true,
children: [
"/intro/",
"/intro/sdk-app-architecture",
@ -35,11 +35,11 @@ module.exports = {
},
{
title: "Gaia",
collapsable: false,
collapsable: true,
children: [
"/gaia/what-is-gaia",
"/gaia/installation",
"/gaia/join-testnet",
"/gaia/join-mainnet",
"/gaia/validators/validator-setup",
"/gaia/validators/overview",
"/gaia/validators/security",
@ -47,12 +47,13 @@ module.exports = {
"/gaia/delegator-guide-cli",
"/gaia/ledger",
"/gaia/gaiacli",
"/gaia/join-testnet",
"/gaia/deploy-testnet"
]
},
{
title: "Tutorial",
collapsable: false,
collapsable: true,
children: [
"/tutorial/",
"/tutorial/app-design",
@ -74,7 +75,7 @@ module.exports = {
},
{
title: "Clients",
collapsable: false,
collapsable: true,
children: [
"/clients/",
"/clients/cli",

View File

@ -11,9 +11,10 @@
- [SDK API Reference](https://godoc.org/github.com/cosmos/cosmos-sdk): Godocs of the Cosmos SDK.
- [REST API spec](https://cosmos.network/rpc/): List of endpoints to interact with a `gaia` full-node through REST.
## Cosmos Hub testnet
## Cosmos Hub
- [Join the public testnet](./gaia/join-testnet.md) of the Cosmos Hub.
- [Join the mainnet](./gaia/join-mainnet.md) of the Cosmos Hub.
- [Join the latest public testnet](./gaia/join-testnet.md) of the Cosmos Hub.
- [Start your own `gaia` testnet](./gaia/deploy-testnet.md).
## Creating a new SDK project

View File

@ -2,12 +2,16 @@
Welcome to the `Gaia` docs. `Gaia` is the current name of the Cosmos SDK application for the Cosmos Hub.
## Join the Cosmos Hub public testnet
## Join the Cosmos Hub Mainnet
- [Install the `gaia` application](./installation.md)
- [Set up a full node and join the current public testnet](./join-testnet.md)
- [Set up a full node and join the mainnet](./join-mainnet.md)
- [Upgrade to a validator node](./validators/validator-setup.md)
## Join the Cosmos Hub Public Testnet
- [Join the testnet](./join-testnet.md)
## Setup your own `gaia` testnet
- [Setup your own `gaia` testnet](./deploy-testnet.md)

View File

@ -237,7 +237,7 @@ In order to query the state and send transactions, you need a way to access the
This is the most secure option, but comes with relatively high resource requirements. In order to run your own full-node, you need good bandwidth and at least 1TB of disk space.
You will find the tutorial on how to install `gaiad` [here](https://cosmos.network/docs/gaia/installation.html), and the guide to run a full-node [here](https://cosmos.network/docs/gaia/join-testnet.html).
You will find the tutorial on how to install `gaiad` [here](https://cosmos.network/docs/gaia/installation.html), and the guide to run a full-node [here](https://cosmos.network/docs/gaia/join-mainnet.html).
### Connecting to a remote full-node
@ -336,12 +336,16 @@ For each command, you can use the `-h` or `--help` flag to get more information.
## Sending Transactions
::: warning
On Cosmos Hub mainnet, the accepted denom is `uatom`, where `1atom = 1,000,000uatom`
:::
### A note on gas and fees
Transactions on the Cosmos Hub network need to include a transaction fee in order to be processed. This fee pays for the gas required to run the transaction. The formula is the following:
```
fees = gas * gasPrices
fees = ceil(gas * gasPrices)
```
The `gas` is dependent on the transaction. Different transaction require different amount of `gas`. The `gas` amount for a transaction is calculated as it is being processed, but there is a way to estimate it beforehand by using the `auto` value for the `gas` flag. Of course, this only gives an estimate. You can adjust this estimate with the flag `--gas-adjustment` (default `1.0`) if you want to be sure you provide enough `gas` for the transaction.
@ -350,6 +354,10 @@ The `gasPrice` is the price of each unit of `gas`. Each validator sets a `min-ga
The transaction `fees` are the product of `gas` and `gasPrice`. As a user, you have to input 2 out of 3. The higher the `gasPrice`/`fees`, the higher the chance that your transaction will get included in a block.
::: tip
For mainnet, the recommended `gas-prices` is `0.025uatom`.
:::
### Bonding Atoms and Withdrawing rewards
::: tip
@ -366,20 +374,20 @@ The transaction `fees` are the product of `gas` and `gasPrice`. As a user, you h
```bash
// Bond a certain amount of Atoms to a given validator
// ex value for flags: <validatorAddress>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <amountToBound>=10000stake, <gasPrice>=0.001stake
// ex value for flags: <validatorAddress>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <amountToBound>=10000000uatom, <gasPrice>=0.025uatom
gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorKeyName> --gas auto --gas-prices <gasPrice>
// Withdraw all rewards
// ex value for flag: <gasPrice>=0.001stake
// ex value for flag: <gasPrice>=0.025uatom
gaiacli tx distr withdraw-all-rewards --from <delegatorKeyName> --gas auto --gas-prices <gasPrice>
// Unbond a certain amount of Atoms from a given validator
// You will have to wait 3 weeks before your Atoms are fully unbonded and transferrable
// ex value for flags: <validatorAddress>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <amountToUnbound>=10000stake, <gasPrice>=0.001stake
// ex value for flags: <validatorAddress>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <amountToUnbound>=10000000uatom, <gasPrice>=0.025uatom
gaiacli tx staking unbond <validatorAddress> <amountToUnbond> --from <delegatorKeyName> --gas auto --gas-prices <gasPrice>
```
@ -434,13 +442,13 @@ At the end of the voting period, the proposal is accepted if there are more than
```bash
// Submit a Proposal
// <type>=text/parameter_change/software_upgrade
// ex value for flag: <gasPrice>=0.0001stake
// ex value for flag: <gasPrice>=0.025uatom
gaiacli tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type <type> --deposit=10stake --gas auto --gas-prices <gasPrice> --from <delegatorKeyName>
gaiacli tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type <type> --deposit=10000000uatom --gas auto --gas-prices <gasPrice> --from <delegatorKeyName>
// Increase deposit of a proposal
// Retrieve proposalID from $gaiacli query gov proposals --status deposit_period
// ex value for parameter: <deposit>=1stake
// ex value for parameter: <deposit>=10000000uatom
gaiacli tx gov deposit <proposalID> <deposit> --gas auto --gas-prices <gasPrice> --from <delegatorKeyName>
@ -457,7 +465,7 @@ If you do not have a ledger device and want to interact with your private key on
```bash
// Bond Atoms
// ex value for flags: <amountToBound>=10000stake, <bech32AddressOfValidator>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <gasPrice>=0.001stake, <delegatorAddress>=cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg
// ex value for flags: <amountToBound>=10000000uatom, <bech32AddressOfValidator>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <gasPrice>=0.025uatom, <delegatorAddress>=cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg
gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorAddress> --gas auto --gas-prices <gasPrice> --generate-only > unsignedTX.json
```

View File

@ -130,29 +130,24 @@ multi signature account see [Multisig Transactions](#multisig-transactions).
### Fees & Gas
Each transaction may either supply fees or gas prices, but not both. Most users
will typically provide fees as this is the cost you will end up incurring for
the transaction being included in the ledger.
Each transaction may either supply fees or gas prices, but not both.
Validator's have a minimum gas price (multi-denom) configuration and they use
this value when when determining if they should include the transaction in a block
during `CheckTx`, where `gasPrices >= minGasPrices`. Note, your transaction must
supply fees that are greater than or equal to __any__ of the denominations the validator requires.
this value when when determining if they should include the transaction in a block during `CheckTx`, where `gasPrices >= minGasPrices`. Note, your transaction must supply fees that are greater than or equal to __any__ of the denominations the validator requires.
__Note__: With such a mechanism in place, validators may start to prioritize
txs by `gasPrice` in the mempool, so providing higher fees or gas prices may yield
higher tx priority.
txs by `gasPrice` in the mempool, so providing higher fees or gas prices may yield higher tx priority.
e.g.
```bash
gaiacli tx send ... --fees=100photino
gaiacli tx send ... --fees=1000000uatom
```
or
```bash
gaiacli tx send ... --gas-prices=0.000001stake
gaiacli tx send ... --gas-prices=0.025uatom
```
### Account
@ -345,11 +340,11 @@ gaiacli query staking validator <account_cosmosval>
#### Bond Tokens
On the testnet, we delegate `steak` instead of `atom`. Here's how you can bond tokens to a testnet validator (_i.e._ delegate):
On the Cosmos Hub mainnet, we delegate `uatom`, where `1atom = 1000000uatom`. Here's how you can bond tokens to a testnet validator (_i.e._ delegate):
```bash
gaiacli tx staking delegate \
--amount=10steak \
--amount=10000000uatom \
--validator=<validator> \
--from=<key_name> \
--chain-id=<chain_id>
@ -365,10 +360,6 @@ where `[name]` is the name of the key you specified when you initialized `gaiad`
While tokens are bonded, they are pooled with all the other bonded tokens in the network. Validators and delegators obtain a percentage of shares that equal their stake in this pool.
::: tip Note
Don't use more `steak` thank you have! You can always get more by using the [Faucet](https://faucetcosmos.network/)!
:::
##### Query Delegations
Once submitted a delegation to a validator, you can see it's information by using the following command:
@ -527,7 +518,7 @@ gaiacli tx gov submit-proposal \
--title=<title> \
--description=<description> \
--type=<Text/ParameterChange/SoftwareUpgrade> \
--deposit=<40steak> \
--deposit="1000000uatom" \
--from=<name> \
--chain-id=<chain_id>
```
@ -556,10 +547,10 @@ gaiacli query gov proposer <proposal_id>
#### Increase deposit
In order for a proposal to be broadcasted to the network, the amount deposited must be above a `minDeposit` value (default: `10 steak`). If the proposal you previously created didn't meet this requirement, you can still increase the total amount deposited to activate it. Once the minimum deposit is reached, the proposal enters voting period:
In order for a proposal to be broadcasted to the network, the amount deposited must be above a `minDeposit` value (default: `512000000uatom`). If the proposal you previously created didn't meet this requirement, you can still increase the total amount deposited to activate it. Once the minimum deposit is reached, the proposal enters voting period:
```bash
gaiacli tx gov deposit <proposal_id> <200steak> \
gaiacli tx gov deposit <proposal_id> "10000000uatom" \
--from=<name> \
--chain-id=<chain_id>
```
@ -725,7 +716,7 @@ The first step to create a multisig transaction is to initiate it on behalf
of the multisig address created above:
```bash
gaiacli tx send cosmos1570v2fq3twt0f0x02vhxpuzc9jc4yl30q2qned 10stake \
gaiacli tx send cosmos1570v2fq3twt0f0x02vhxpuzc9jc4yl30q2qned 1000000uatom \
--from=<multisig_address> \
--generate-only > unsignedTx.json
```

View File

@ -1,6 +1,6 @@
## Install Gaia
This guide will explain how to install the `gaiad` and `gaiacli` entrypoints onto your system. With these installed on a server, you can participate in the latest testnet as either a [Full Node](./join-testnet.md#run-a-full-node) or a [Validator](./validators/validator-setup.md).
This guide will explain how to install the `gaiad` and `gaiacli` entrypoints onto your system. With these installed on a server, you can participate in the mainnet as either a [Full Node](./join-mainnet.md) or a [Validator](./validators/validator-setup.md).
### Install Go
@ -23,6 +23,10 @@ Next, let's install the latest version of Gaia. Here we'll use the `master` bran
If necessary, make sure you `git checkout` the correct
[released version](https://github.com/cosmos/cosmos-sdk/releases).
::: warning
For the mainnet, make sure your version if greather than `v0.33.0`
:::
```bash
mkdir -p $GOPATH/src/github.com/cosmos
cd $GOPATH/src/github.com/cosmos
@ -43,11 +47,11 @@ $ gaiacli version --long
`gaiacli` for instance should output something similar to:
```
cosmos-sdk: 0.31.2-10-g1fba7308
git commit: 1fba7308fa226e971964cd6baad9527d4b51d9fc
vendor hash: 1aec7edfad9888a967b3e9063e42f66b28f447e6
cosmos-sdk: 0.33.0
git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0
vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f
build tags: netgo ledger
go version go1.11.5 linux/amd64
go version go1.12 linux/amd64
```
##### Build Tags
@ -66,4 +70,4 @@ Build tags indicate special features that have been enabled in the binary.
### Next
Now you can [join the public testnet](./join-testnet.md) or [create you own testnet](./deploy-testnet.md)
Now you can [join the mainnet](./join-mainnet.md), [the public testnet](./join-testnet.md) or [create you own testnet](./deploy-testnet.md)

152
docs/gaia/join-mainnet.md Normal file
View File

@ -0,0 +1,152 @@
# Join the mainnet
::: tip
See the [launch repo](https://github.com/cosmos/launch) for
information on the mainnet, including the correct version
of the Cosmos-SDK to use and details about the genesis file.
:::
::: warning
**You need to [install gaia](./installation.md) before you go further**
:::
## Setting Up a New Node
These instructions are for setting up a brand new full node from scratch.
First, initialize the node and create the necessary config files:
```bash
gaiad init <your_custom_moniker>
```
::: warning Note
Monikers can contain only ASCII characters. Using Unicode characters will render your node unreachable.
:::
You can edit this `moniker` later, in the `~/.gaiad/config/config.toml` file:
```toml
# A custom human readable name for this node
moniker = "<your_custom_moniker>"
```
You can edit the `~/.gaiad/config/gaiad.toml` file in order to enable the anti spam mechanism and reject incoming transactions with less than the minimum gas prices:
```
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
##### main base config options #####
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 10uatom).
minimum-gas-prices = ""
```
Your full node has been initialized!
## Genesis & Seeds
### Copy the Genesis File
Fetch the testnet's `genesis.json` file into `gaiad`'s config directory.
```bash
mkdir -p $HOME/.gaiad/config
curl https://raw.githubusercontent.com/cosmos/launch/master/latest/genesis.json > $HOME/.gaiad/config/genesis.json
```
Note we use the `latest` directory in the [launch repo](https://github.com/cosmos/launch) which contains details for the mainnet like the latest version and the genesis file.
::: tip
If you want to connect to the public testnet instead, click [here](./join-testnet.md)
:::
To verify the correctness of the configuration run:
```bash
gaiad start
```
### Add Seed Nodes
Your node needs to know how to find peers. You'll need to add healthy seed nodes to `$HOME/.gaiad/config/config.toml`. The [`launch`](https://github.com/cosmos/launch) repo contains links to some seed nodes.
If those seeds aren't working, you can find more seeds and persistent peers on a Cosmos Hub explorer (a list can be found on the [launch page](https://cosmos.network/launch)).
You can also ask for peers on the [Validators Riot Room](https://riot.im/app/#/room/#cosmos-validators:matrix.org)
For more information on seeds and peers, you can [read this](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers).
## A note on gas and fees
::: warning
On Cosmos Hub mainnet, the accepted denom is `uatom`, where `1atom = 1.000.000uatom`
:::
Transactions on the Cosmos Hub network need to include a transaction fee in order to be processed. This fee pays for the gas required to run the transaction. The formula is the following:
```
fees = gas * gasPrices
```
The `gas` is dependent on the transaction. Different transaction require different amount of `gas`. The `gas` amount for a transaction is calculated as it is being processed, but there is a way to estimate it beforehand by using the `auto` value for the `gas` flag. Of course, this only gives an estimate. You can adjust this estimate with the flag `--gas-adjustment` (default `1.0`) if you want to be sure you provide enough `gas` for the transaction.
The `gasPrice` is the price of each unit of `gas`. Each validator sets a `min-gas-price` value, and will only include transactions that have a `gasPrice` greater than their `min-gas-price`.
The transaction `fees` are the product of `gas` and `gasPrice`. As a user, you have to input 2 out of 3. The higher the `gasPrice`/`fees`, the higher the chance that your transaction will get included in a block.
::: tip
For mainnet, the recommended `gas-prices` is `0.025uatom`.
:::
## Set `minimum-gas-prices`
Your full-node keeps unconfirmed transactions in its mempool. In order to protect it from spam, it is better to set a `minimum-gas-prices` that the transaction must meet in order to be accepted in your node's mempool. This parameter can be set in the following file `~/.gaiad/config/gaiad.toml`.
The initial recommended `min-gas-prices` is `0.025uatom`, but you might want to change it later.
## Run a Full Node
Start the full node with this command:
```bash
gaiad start
```
Check that everything is running smoothly:
```bash
gaiacli status
```
View the status of the network with the [Cosmos Explorer](https://cosmos.network/launch).
## Export State
Gaia can dump the entire application state to a JSON file, which could be useful for manual analysis and can also be used as the genesis file of a new network.
Export state with:
```bash
gaiad export > [filename].json
```
You can also export state from a particular height (at the end of processing the block of that height):
```bash
gaiad export --height [height] > [filename].json
```
If you plan to start a new network from the exported state, export with the `--for-zero-height` flag:
```bash
gaiad export --height [height] --for-zero-height > [filename].json
```
## Upgrade to Validator Node
You now have an active full node. What's the next step? You can upgrade your full node to become a Cosmos Validator. The top 100 validators have the ability to propose new blocks to the Cosmos Hub. Continue onto [the Validator Setup](./validators/validator-setup.md).

View File

@ -1,4 +1,4 @@
# Join the public testnet
# Join the Public Testnet
::: tip Current Testnet
See the [testnet repo](https://github.com/cosmos/testnets) for
@ -10,47 +10,20 @@ of the Cosmos-SDK to use and details about the genesis file.
**You need to [install gaia](./installation.md) before you go further**
:::
## Setting Up a New Node
## Starting a new Node
> NOTE: If you ran a full node on a previous testnet, please skip to [Upgrading From Previous Testnet](#upgrading-from-previous-testnet).
These instructions are for setting up a brand new full node from scratch.
To start a new node, the mainnet instructions apply:
First, initialize the node and create the necessary config files:
- [Join the mainnet](./join-mainnet.md)
- [Deploy a validator](./validators/validator-setup.md)
```bash
gaiad init <your_custom_moniker>
```
The only difference is the SDK version and genesis file. See the [testnet repo](https://github.com/cosmos/testnets) for information on testnets, including the correct version of the Cosmos-SDK to use and details about the genesis file.
::: warning Note
Monikers can contain only ASCII characters. Using Unicode characters will render your node unreachable.
:::
## Upgrading your Node
You can edit this `moniker` later, in the `~/.gaiad/config/config.toml` file:
```toml
# A custom human readable name for this node
moniker = "<your_custom_moniker>"
```
You can edit the `~/.gaiad/config/gaiad.toml` file in order to enable the anti spam mechanism and reject incoming transactions with less than a minimum fee:
```
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
##### main base config options #####
# Validators reject any tx from the mempool with less than the minimum fee per gas.
minimum_fees = ""
```
Your full node has been initialized! Please skip to [Genesis & Seeds](#genesis-seeds).
## Upgrading From Previous Testnet
These instructions are for full nodes that have ran on previous testnets and would like to upgrade to the latest testnet.
These instructions are for full nodes that have ran on previous versions of and would like to upgrade to the latest testnet.
### Reset Data
@ -84,81 +57,6 @@ make update_tools install
:::
Note we use `master` here since it contains the latest stable release.
See the [testnet repo](https://github.com/cosmos/testnets)
for details on which version is needed for which testnet,
and the [SDK release page](https://github.com/cosmos/cosmos-sdk/releases)
for details on each release.
See the [testnet repo](https://github.com/cosmos/testnets) for details on which version is needed for which testnet, and the [SDK release page](https://github.com/cosmos/cosmos-sdk/releases) for details on each release.
Your full node has been cleanly upgraded!
## Genesis & Seeds
### Copy the Genesis File
Fetch the testnet's `genesis.json` file into `gaiad`'s config directory.
```bash
mkdir -p $HOME/.gaiad/config
curl https://raw.githubusercontent.com/cosmos/testnets/master/latest/genesis.json > $HOME/.gaiad/config/genesis.json
```
Note we use the `latest` directory in the [testnets repo](https://github.com/cosmos/testnets)
which contains details for the latest testnet. If you are connecting to a different testnet, ensure you get the right files.
To verify the correctness of the configuration run:
```bash
gaiad start
```
### Add Seed Nodes
Your node needs to know how to find peers. You'll need to add healthy seed nodes to `$HOME/.gaiad/config/config.toml`. The `testnets` repo contains links to the seed nodes for each testnet. If you are looking to join the running testnet please [check the repository for details](https://github.com/cosmos/testnets) on which nodes to use.
If those seeds aren't working, you can find more seeds and persistent peers on the [Cosmos Explorer](https://explorer.cosmos.network/nodes). Open the the `Full Nodes` pane and select nodes that do not have private (`10.x.x.x`) or [local IP addresses](https://en.wikipedia.org/wiki/Private_network). The `Persistent Peer` field contains the connection string. For best results use 4-6.
You can also ask for peers on the [Validators Riot Room](https://riot.im/app/#/room/#cosmos-validators:matrix.org)
For more information on seeds and peers, you can [read this](https://github.com/tendermint/tendermint/blob/develop/docs/tendermint-core/using-tendermint.md#peers).
## Run a Full Node
Start the full node with this command:
```bash
gaiad start
```
Check that everything is running smoothly:
```bash
gaiacli status
```
View the status of the network with the [Cosmos Explorer](https://explorecosmos.network). Once your full node syncs up to the current block height, you should see it appear on the [list of full nodes](https://explorecosmos.network/validators). If it doesn't show up, that's ok--the Explorer does not connect to every node.
## Export State
Gaia can dump the entire application state to a JSON file, which could be useful for manual analysis and can also be used as the genesis file of a new network.
Export state with:
```bash
gaiad export > [filename].json
```
You can also export state from a particular height (at the end of processing the block of that height):
```bash
gaiad export --height [height] > [filename].json
```
If you plan to start a new network from the exported state, export with the `--for-zero-height` flag:
```bash
gaiad export --height [height] --for-zero-height > [filename].json
```
## Upgrade to Validator Node
You now have an active full node. What's the next step? You can upgrade your full node to become a Cosmos Validator. The top 100 validators have the ability to propose new blocks to the Cosmos Hub. Continue onto [the Validator Setup](./validators/validator-setup.md).
Your full node has been cleanly upgraded!

View File

@ -218,9 +218,10 @@ We have to solve this simple equation to find the reward R for each validator:
### What are the slashing conditions?
If a validator misbehaves, their delegated stake will be partially slashed. There is currently one main fault that can result in slashing of funds for a validator and their delegators:
If a validator misbehaves, their delegated stake will be partially slashed. There are currently two faults that can result in slashing of funds for a validator and their delegators:
* **Double signing:** If someone reports on chain A that a validator signed two blocks at the same height on chain A and chain B, and if chain A and chain B share a common ancestor, then this validator will get slashed on chain A
* **Double signing:** If someone reports on chain A that a validator signed two blocks at the same height on chain A and chain B, and if chain A and chain B share a common ancestor, then this validator will get slashed by 5% on chain A.
* **Downtime:** If a validator misses more than 95% of the last 10.000 blocks, they will get slashed by 0.01%.
### Do validators need to self-delegate Atoms?

View File

@ -1,12 +1,10 @@
# Run a Validator on the public testnet
# Run a Validator on the Cosmos Hub Mainnet
::: tip
Information on how to join the current testnet (`genesis.json` file and seeds) is held [in our `testnet` repo](https://github.com/cosmos/testnets/tree/master/latest). Please check there if you are looking to join our latest testnet.
Information on how to join the mainnet (`genesis.json` file and seeds) is held [in our `launch` repo](https://github.com/cosmos/launch/tree/master/latest).
:::
__Note__: This documentation is only intended for validators of the **public testnet**
Before setting up your validator node, make sure you've already gone through the [Full Node Setup](../join-testnet.md) guide.
Before setting up your validator node, make sure you've already gone through the [Full Node Setup](../join-mainnet.md) guide.
## What is a Validator?
@ -16,7 +14,7 @@ Before setting up your validator node, make sure you've already gone through the
If you want to become a validator for the Hub's `mainnet`, you should [research security](./security.md).
:::
You may want to skip the next section if you have already [set up a full-node](../join-testnet.md).
You may want to skip the next section if you have already [set up a full-node](../join-mainnet.md).
## Create Your Validator
@ -26,50 +24,66 @@ Your `cosmosvalconspub` can be used to create a new validator by staking tokens.
gaiad tendermint show-validator
```
Next, craft your `gaiad gentx` command:
To create your validator, just use the following command:
::: warning Note
Don't use more `STAKE` thank you have! You can always get more by using the [Faucet](https://faucet.cosmos.network/)!
::: warning
Don't use more `uatom` than you have!
:::
```bash
gaiacli tx staking create-validator \
--amount=5STAKE \
--amount=1000000uatom \
--pubkey=$(gaiad tendermint show-validator) \
--moniker="choose a moniker" \
--chain-id=<chain_id> \
--from=<key_name> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01"
--commission-max-change-rate="0.01" \
--min-self-delegation="1" \
--gas="auto" \
--gas-prices="0.025uatom" \
--from=<key_name>
```
__Note__: When specifying commission parameters, the `commission-max-change-rate`
is used to measure % _point_ change over the `commission-rate`. E.g. 1% to 2% is
a 100% rate increase, but only 1 percentage point.
::: tip
When specifying commission parameters, the `commission-max-change-rate` is used to measure % _point_ change over the `commission-rate`. E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point.
:::
__Note__: If unspecified, `consensus_pubkey` will default to the output of `gaiad tendermint show-validator`.
`key_name` is the name of the private key that will be used to sign the transaction.
::: tip
`Min-self-delegation` is a stritly positive integer that represents the minimum amount of self-delegated voting power your validator must always have. A `min-self-delegation` of 1 means your validator will never have a self-delegation lower than `1atom`, or `1000000uatom`
:::
You can confirm that you are in the validator set by using a third party explorer.
## Participate in genesis as a validator
__Note__: This section only concerns validators that want to be in the genesis
file. If the chain you want to validate is already live, skip this section.
__Note__: `Gaia-9002` and `Game of stakes` will not use this process. They will
be bootstrapped using validators operated by Tendermint. You will just need to use the
[create-validator](#create-your-validator) command in order to join as a validator
for these networks.
::: warning
This section only concerns validators that want to be in the genesis
file of the Cosmos Hub mainnet. If the mainnet is already live, skip this section.
:::
If you want to participate in genesis as a validator, you need to justify that
you have some stake at genesis, create one (or multiple) transactions to bond this
stake to your validator address, and include this transaction in the genesis file.
you have some stake at genesis, create one (or multiple) transactions to bond this stake to your validator address, and include this transaction in the genesis file.
You will need create a `gentx`:
Your `cosmosvalconspub` can be used to create a new validator by staking tokens. You can find your validator pubkey by running:
```bash
gaiad tendermint show-validator
```
Next, craft your `gaiad gentx` command.
::: tip
A `gentx` is a JSON file carrying a self-delegation. All genesis transactions are collected by a `genesis coordinator` and validated against an initial `genesis.json`.
:::
::: warning Note
Don't use more `uatom` than you have!
:::
```bash
gaiad gentx \
--amount <amount_of_delegation> \
--amount <amount_of_delegation_uatom> \
--commission-rate <commission_rate> \
--commission-max-rate <commission_max_rate> \
--commission-max-change-rate <commission_max_change_rate> \
@ -77,46 +91,11 @@ gaiad gentx \
--name <key_name>
```
__Note__: This command automatically store your `gentx` in `~/.gaiad/config/gentx`
for it to be processed at genesis.
::: tip
Consult `gaiad gentx --help` for more information on the flags defaults.
When specifying commission parameters, the `commission-max-change-rate` is used to measure % _point_ change over the `commission-rate`. E.g. 1% to 2% is a 100% rate increase, but only 1 percentage point.
:::
A `gentx` is a JSON file carrying a self-delegation. All genesis transactions are
collected by a `genesis coordinator` and validated against an initial `genesis.json`.
Such initial `genesis.json` contains only a list of accounts and their coins.
Once the transactions are processed, they are merged in the `genesis.json`'s `gentxs` field.
### Copy the Initial Genesis File and Process Genesis Transactions
Fetch the `genesis.json` file into `gaiad`'s config directory.
```bash
mkdir -p $HOME/.gaiad/config
curl https://raw.githubusercontent.com/cosmos/testnets/master/latest/genesis.json > $HOME/.gaiad/config/genesis.json
```
__Note:__ We use the `latest` directory in the [testnets repo](https://github.com/cosmos/testnets)
which contains details for the latest testnet. If you are connecting to a different testnet, ensure you get the right files.
You also need to fetch the genesis transactions of all the other genesis validators. For now there is no repository where genesis transactions can be submitted by validators, but this will as soon as we try out this feature in a testnet.
Once you've collected all genesis transactions in `~/.gaiad/config/gentx`, you can run:
```bash
gaiad collect-gentxs
```
__Note:__ The accounts from which you delegate in the `gentx` transactions need to possess stake tokens in the genesis file, otherwise `collect-gentx` will fail.
The previous command will collect all genesis transactions and finalise `genesis.json`. To verify the correctness of the configuration and start the node run:
```bash
gaiad start
```
You can then submit your `gentx` on the [launch repository](https://github.com/cosmos/launch). These `gentx` will be used to form the final genesis file.
## Edit Validator Description
@ -131,6 +110,8 @@ gaiacli tx staking edit-validator
--identity=6A0D65E29A4CBC8E \
--details="To infinity and beyond!" \
--chain-id=<chain_id> \
--gas="auto" \
--gas-prices="0.025uatom" \
--from=<key_name> \
--commission-rate="0.10"
```
@ -187,23 +168,15 @@ To be in the validator set, you need to have more total voting power than the 10
### Problem #1: My validator has `voting_power: 0`
Your validator has become auto-unbonded. In `gaia-8000`, we unbond validators if they do not vote on `50` of the last `100` blocks. Since blocks are proposed every ~2 seconds, a validator unresponsive for ~100 seconds will become unbonded. This usually happens when your `gaiad` process crashes.
Your validator has become jailed. Validators get jailed, i.e. get removed from the active validator set, if they do not vote on `500` of the last `10000` blocks, or if they double sign.
Here's how you can return the voting power back to your validator. First, if `gaiad` is not running, start it up again:
If you got jailed for downtime, you can get your voting power back to your validator. First, if `gaiad` is not running, start it up again:
```bash
gaiad start
```
Wait for your full node to catch up to the latest block. Next, run the following command. Note that `<cosmos>` is the address of your validator account, and `<name>` is the name of the validator account. You can find this info by running `gaiacli keys list`.
```bash
gaiacli tx slashing unjail <cosmos> --chain-id=<chain_id> --from=<from>
```
::: danger Warning
If you don't wait for `gaiad` to sync before running `unjail`, you will receive an error message telling you your validator is still jailed.
:::
Wait for your full node to catch up to the latest block. Next, run the following command. Then, you can [unjail your validator](#unjail-validator)
Lastly, check your validator again to see if your voting power is back.