From d7fc4e98abbea86aa4a6e70c83edef9fa221d7f4 Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Wed, 6 Mar 2019 21:03:15 -0500 Subject: [PATCH 01/13] Improve iterate validators dist. invariant (#3818) --- x/distribution/simulation/invariants.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/x/distribution/simulation/invariants.go b/x/distribution/simulation/invariants.go index fa5f585c9..853e9494b 100644 --- a/x/distribution/simulation/invariants.go +++ b/x/distribution/simulation/invariants.go @@ -59,24 +59,30 @@ func CanWithdrawInvariant(k distr.Keeper, sk types.StakingKeeper) sdk.Invariant var remaining sdk.DecCoins + valDelegationAddrs := make(map[string][]sdk.AccAddress) + for _, del := range sk.GetAllSDKDelegations(ctx) { + valAddr := del.GetValidatorAddr().String() + valDelegationAddrs[valAddr] = append(valDelegationAddrs[valAddr], del.GetDelegatorAddr()) + } + // iterate over all validators sk.IterateValidators(ctx, func(_ int64, val sdk.Validator) (stop bool) { _ = k.WithdrawValidatorCommission(ctx, val.GetOperator()) - // TODO fetch delegations just for the validator, requires sdk.ValidatorSet change - // iterate over all current delegations, withdraw rewards - dels := sk.GetAllSDKDelegations(ctx) - for _, delegation := range dels { - if delegation.GetValidatorAddr().String() == val.GetOperator().String() { - err := k.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) - if err != nil { + + delegationAddrs, ok := valDelegationAddrs[val.GetOperator().String()] + if ok { + for _, delAddr := range delegationAddrs { + if err := k.WithdrawDelegationRewards(ctx, delAddr, val.GetOperator()); err != nil { panic(err) } } } + remaining = k.GetValidatorOutstandingRewards(ctx, val.GetOperator()) if len(remaining) > 0 && remaining[0].Amount.LT(sdk.ZeroDec()) { return true } + return false }) From 506712341dad80213a80a6420781bcbaf8595071 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sat, 9 Mar 2019 19:13:27 -0800 Subject: [PATCH 02/13] Temporarily remove snap from installation instructions Temporarily remove snap from installation instructions until it's been more thoroughly audited. --- docs/gaia/installation.md | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index b1eb099e6..676044c3c 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -61,34 +61,7 @@ Build tags indicate special features that have been enabled in the binary. ### Install binary distribution via snap (Linux only) -Gaia can be installed on various GNU/Linux distributions from the [Snapcraft.io](https://snapcraft.io/gaia) store: - -```bash -$ sudo snap install gaia -``` - -Development builds are available through the `edge` channel: - -```bash -$ sudo snap install --edge gaia -``` - -::: tip -At the time of writing, only the following [architectures are supported](https://build.snapcraft.io/user/cosmos/cosmos-sdk): `amd64` `i386` `arm64` `armhf` `ppc64el` `s390x`. -::: - -`snap` installs Gaia binaries as `gaia.gaiad` and `gaia.gaiacli`. It is recommended to create commands aliases for the user's convenience once the package is installed: - -``` -$ sudo snap alias gaia.gaiad gaiad -$ sudo snap alias gaia.gaiacli gaiacli -``` - -::: warning -Note that the binaries provided by the snap package save their data into **$HOME/snap/gaia/** instead of **$HOME**. -::: - -Please refer to [Snap documentation](https://docs.snapcraft.io/installing-snapd/6735) for specific information on how to install `snap` on your distribution. +**Do not use snap at this time to install the binaries for production until we have a reproduceable binary system.** ### Next From 7ec3d3d6fc158146a31f81eec710a05cc44d5e6c Mon Sep 17 00:00:00 2001 From: gamarin Date: Fri, 8 Mar 2019 22:24:50 +0100 Subject: [PATCH 03/13] update docs for mainnet --- README.md | 8 +- docs/.vuepress/config.js | 11 ++- docs/README.md | 5 +- docs/gaia/README.md | 8 +- docs/gaia/installation.md | 16 +-- docs/gaia/join-mainnet.md | 124 ++++++++++++++++++++++++ docs/gaia/join-testnet.md | 122 ++--------------------- docs/gaia/validators/validator-faq.md | 5 +- docs/gaia/validators/validator-setup.md | 120 +++++++++-------------- 9 files changed, 212 insertions(+), 207 deletions(-) create mode 100644 docs/gaia/join-mainnet.md diff --git a/README.md b/README.md index d23a1edc8..37b5c4101 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 669c2467e..e8ee111d6 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -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", diff --git a/docs/README.md b/docs/README.md index 09c96f9eb..7b1632437 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 diff --git a/docs/gaia/README.md b/docs/gaia/README.md index 488ac960c..eaf21a823 100644 --- a/docs/gaia/README.md +++ b/docs/gaia/README.md @@ -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) diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index 676044c3c..cfbab511a 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -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 latest testnet 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: build tags: netgo ledger -go version go1.11.5 linux/amd64 +go version go1.12 darwin/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) diff --git a/docs/gaia/join-mainnet.md b/docs/gaia/join-mainnet.md new file mode 100644 index 000000000..94c34126a --- /dev/null +++ b/docs/gaia/join-mainnet.md @@ -0,0 +1,124 @@ +# Join the mainnet + +::: tip +See the [launch](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 +``` + +::: 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 = "" +``` + +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). + +## 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). diff --git a/docs/gaia/join-testnet.md b/docs/gaia/join-testnet.md index df47f88bb..469abdd84 100644 --- a/docs/gaia/join-testnet.md +++ b/docs/gaia/join-testnet.md @@ -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 -``` +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 = "" -``` - -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! \ No newline at end of file diff --git a/docs/gaia/validators/validator-faq.md b/docs/gaia/validators/validator-faq.md index 2c159ab40..a303989df 100644 --- a/docs/gaia/validators/validator-faq.md +++ b/docs/gaia/validators/validator-faq.md @@ -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? diff --git a/docs/gaia/validators/validator-setup.md b/docs/gaia/validators/validator-setup.md index 7c5e7d03b..7a448900e 100644 --- a/docs/gaia/validators/validator-setup.md +++ b/docs/gaia/validators/validator-setup.md @@ -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,10 +24,10 @@ 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` thank you have! ::: ```bash @@ -38,86 +36,68 @@ gaiacli tx staking create-validator \ --pubkey=$(gaiad tendermint show-validator) \ --moniker="choose a moniker" \ --chain-id= \ - --from= \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ - --commission-max-change-rate="0.01" + --commission-max-change-rate="0.01" \ + --from= ``` -__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. +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. - -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 will need create a `gentx`: - -```bash -gaiad gentx \ - --amount \ - --commission-rate \ - --commission-max-rate \ - --commission-max-change-rate \ - --pubkey \ - --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. +::: 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. ::: -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. +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. -### Copy the Initial Genesis File and Process Genesis Transactions - -Fetch the `genesis.json` file into `gaiad`'s config directory. +Your `cosmosvalconspub` can be used to create a new validator by staking tokens. You can find your validator pubkey by running: ```bash -mkdir -p $HOME/.gaiad/config -curl https://raw.githubusercontent.com/cosmos/testnets/master/latest/genesis.json > $HOME/.gaiad/config/genesis.json +gaiad tendermint show-validator ``` -__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. +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`. +::: -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: +::: warning Note +Don't use more `uatom` thank you have! +::: ```bash -gaiad collect-gentxs +gaiacli tx staking create-validator \ + --amount=50000000uatom \ + --pubkey=$(gaiad tendermint show-validator) \ + --moniker="choose a moniker" \ + --chain-id= \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --generate-only > myUnsignedGentx.json ``` -__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. +::: 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. +::: -The previous command will collect all genesis transactions and finalise `genesis.json`. To verify the correctness of the configuration and start the node run: +After you generate your unsigned `gentx`, sign it. ```bash -gaiad start +gaiacli tx sign myUnsignedGentx.json --from > myGentx.json ``` +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 You can edit your validator's public description. This info is to identify your validator, and will be relied on by delegators to decide which validators to stake to. Make sure to provide input for every flag below, otherwise the field will default to empty (`--moniker` defaults to the machine name). @@ -187,23 +167,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 `` is the address of your validator account, and `` is the name of the validator account. You can find this info by running `gaiacli keys list`. - -```bash -gaiacli tx slashing unjail --chain-id= --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. From 1662d6b03792e19cd1a6e4ebd0d9ed8d76ee3d64 Mon Sep 17 00:00:00 2001 From: gamarin Date: Mon, 11 Mar 2019 18:55:13 +0100 Subject: [PATCH 04/13] finalize mainnet docs --- docs/gaia/delegator-guide-cli.md | 24 +++++++---- docs/gaia/gaiacli.md | 29 ++++++------- docs/gaia/join-mainnet.md | 28 +++++++++++++ docs/gaia/validators/validator-setup.md | 55 ++++++++++++++++++------- 4 files changed, 95 insertions(+), 41 deletions(-) diff --git a/docs/gaia/delegator-guide-cli.md b/docs/gaia/delegator-guide-cli.md index 26ae01abc..9813a5a05 100644 --- a/docs/gaia/delegator-guide-cli.md +++ b/docs/gaia/delegator-guide-cli.md @@ -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,6 +336,10 @@ 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: @@ -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: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =10000stake, =0.001stake +// ex value for flags: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =10000000uatom, =0.025uatom gaiacli tx staking delegate --from --gas auto --gas-prices // Withdraw all rewards -// ex value for flag: =0.001stake +// ex value for flag: =0.025uatom gaiacli tx distr withdraw-all-rewards --from --gas auto --gas-prices // 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: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =10000stake, =0.001stake +// ex value for flags: =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =10000000uatom, =0.025uatom gaiacli tx staking unbond --from --gas auto --gas-prices ``` @@ -434,13 +442,13 @@ At the end of the voting period, the proposal is accepted if there are more than ```bash // Submit a Proposal // =text/parameter_change/software_upgrade -// ex value for flag: =0.0001stake +// ex value for flag: =0.025uatom -gaiacli tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type --deposit=10stake --gas auto --gas-prices --from +gaiacli tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type --deposit=10000000uatom --gas auto --gas-prices --from // Increase deposit of a proposal // Retrieve proposalID from $gaiacli query gov proposals --status deposit_period -// ex value for parameter: =1stake +// ex value for parameter: =10000000uatom gaiacli tx gov deposit --gas auto --gas-prices --from @@ -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: =10000stake, =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =0.001stake, =cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg +// ex value for flags: =10000000uatom, =cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, =0.025uatom, =cosmos10snjt8dmpr5my0h76xj48ty80uzwhraqalu4eg gaiacli tx staking delegate --from --gas auto --gas-prices --generate-only > unsignedTX.json ``` diff --git a/docs/gaia/gaiacli.md b/docs/gaia/gaiacli.md index 198911f67..95af81ca2 100644 --- a/docs/gaia/gaiacli.md +++ b/docs/gaia/gaiacli.md @@ -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 #### 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 = 10000000uatom`. Here's how you can bond tokens to a testnet validator (_i.e._ delegate): ```bash gaiacli tx staking delegate \ - --amount=10steak \ + --amount=10000000uatom \ --validator= \ --from= \ --chain-id= @@ -366,7 +361,7 @@ 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/)! +Don't use more `uatom` thank you have! You can always get more by using the [Faucet](https://faucetcosmos.network/)! ::: ##### Query Delegations @@ -527,7 +522,7 @@ gaiacli tx gov submit-proposal \ --title= \ --description=<description> \ --type=<Text/ParameterChange/SoftwareUpgrade> \ - --deposit=<40steak> \ + --deposit="1000000uatom" \ --from=<name> \ --chain-id=<chain_id> ``` @@ -556,10 +551,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 +720,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 ``` diff --git a/docs/gaia/join-mainnet.md b/docs/gaia/join-mainnet.md index 94c34126a..e52492044 100644 --- a/docs/gaia/join-mainnet.md +++ b/docs/gaia/join-mainnet.md @@ -81,6 +81,34 @@ You can also ask for peers on the [Validators Riot Room](https://riot.im/app/#/r 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: diff --git a/docs/gaia/validators/validator-setup.md b/docs/gaia/validators/validator-setup.md index 7a448900e..17798021b 100644 --- a/docs/gaia/validators/validator-setup.md +++ b/docs/gaia/validators/validator-setup.md @@ -16,6 +16,28 @@ If you want to become a validator for the Hub's `mainnet`, you should [research You may want to skip the next section if you have already [set up a full-node](../join-mainnet.md). +::: 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 +``` + +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`. +::: + ## Create Your Validator Your `cosmosvalconspub` can be used to create a new validator by staking tokens. You can find your validator pubkey by running: @@ -32,13 +54,16 @@ Don't use more `uatom` thank 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> \ --commission-rate="0.10" \ --commission-max-rate="0.20" \ --commission-max-change-rate="0.01" \ + --min-self-delegation="1" \ + --gas="auto" \ + --gas-prices="0.025uatom" \ --from=<key_name> ``` @@ -46,6 +71,10 @@ gaiacli tx staking create-validator \ 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 +`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 @@ -75,27 +104,19 @@ Don't use more `uatom` thank you have! ::: ```bash -gaiacli tx staking create-validator \ - --amount=50000000uatom \ - --pubkey=$(gaiad tendermint show-validator) \ - --moniker="choose a moniker" \ - --chain-id=<chain_id> \ - --commission-rate="0.10" \ - --commission-max-rate="0.20" \ - --commission-max-change-rate="0.01" \ - --generate-only > myUnsignedGentx.json +gaiad gentx \ + --amount <amount_of_delegation_uatom> \ + --commission-rate <commission_rate> \ + --commission-max-rate <commission_max_rate> \ + --commission-max-change-rate <commission_max_change_rate> \ + --pubkey <consensus_pubkey> \ + --name <key_name> ``` ::: 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. ::: -After you generate your unsigned `gentx`, sign it. - -```bash -gaiacli tx sign myUnsignedGentx.json --from <key_name> > myGentx.json -``` - 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 @@ -111,6 +132,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" ``` From d563a264152181528b73c75f89261ae11e7dec58 Mon Sep 17 00:00:00 2001 From: gamarin <gautier@tendermint.com> Date: Mon, 11 Mar 2019 19:20:46 +0100 Subject: [PATCH 05/13] bez review --- docs/gaia/delegator-guide-cli.md | 2 +- docs/gaia/installation.md | 4 ++-- docs/gaia/validators/validator-setup.md | 22 ---------------------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/docs/gaia/delegator-guide-cli.md b/docs/gaia/delegator-guide-cli.md index 9813a5a05..6b2096be6 100644 --- a/docs/gaia/delegator-guide-cli.md +++ b/docs/gaia/delegator-guide-cli.md @@ -345,7 +345,7 @@ On Cosmos Hub mainnet, the accepted denom is `uatom`, where `1atom = 1.000.000ua 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. diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index cfbab511a..cd150b57b 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -48,8 +48,8 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 -git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 -vendor hash: +git commit: 06f741609bbce747643e9f1f2abf67040ad78e16 +vendor hash: decf1ff8b31df2243aa27bcd6e1a40df4d30be81 build tags: netgo ledger go version go1.12 darwin/amd64 ``` diff --git a/docs/gaia/validators/validator-setup.md b/docs/gaia/validators/validator-setup.md index 17798021b..d72f75f1c 100644 --- a/docs/gaia/validators/validator-setup.md +++ b/docs/gaia/validators/validator-setup.md @@ -16,28 +16,6 @@ If you want to become a validator for the Hub's `mainnet`, you should [research You may want to skip the next section if you have already [set up a full-node](../join-mainnet.md). -::: 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 -``` - -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`. -::: - ## Create Your Validator Your `cosmosvalconspub` can be used to create a new validator by staking tokens. You can find your validator pubkey by running: From 3f87671232bfd01166ec21c222ad5d206a92a945 Mon Sep 17 00:00:00 2001 From: Jack Zampolin <jack.zampolin@gmail.com> Date: Mon, 11 Mar 2019 14:57:04 -0700 Subject: [PATCH 06/13] Apply suggestions from code review Co-Authored-By: jackzampolin <jack.zampolin@gmail.com> --- docs/gaia/gaiacli.md | 4 ++-- docs/gaia/join-mainnet.md | 2 +- docs/gaia/validators/validator-setup.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/gaia/gaiacli.md b/docs/gaia/gaiacli.md index 95af81ca2..c4429cf6a 100644 --- a/docs/gaia/gaiacli.md +++ b/docs/gaia/gaiacli.md @@ -340,7 +340,7 @@ gaiacli query staking validator <account_cosmosval> #### Bond Tokens -On the Cosmos Hub mainnet, we delegate `uatom`, where `1atom = 10000000uatom`. 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 \ @@ -361,7 +361,7 @@ 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 `uatom` thank you have! You can always get more by using the [Faucet](https://faucetcosmos.network/)! +Don't use more `uatom` than you have! You can always get more by using the [Faucet](https://faucetcosmos.network/)! ::: ##### Query Delegations diff --git a/docs/gaia/join-mainnet.md b/docs/gaia/join-mainnet.md index e52492044..4bc6a2f68 100644 --- a/docs/gaia/join-mainnet.md +++ b/docs/gaia/join-mainnet.md @@ -1,7 +1,7 @@ # Join the mainnet ::: tip -See the [launch](https://github.com/cosmos/launch) for +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. ::: diff --git a/docs/gaia/validators/validator-setup.md b/docs/gaia/validators/validator-setup.md index d72f75f1c..199dbdd8d 100644 --- a/docs/gaia/validators/validator-setup.md +++ b/docs/gaia/validators/validator-setup.md @@ -27,7 +27,7 @@ gaiad tendermint show-validator To create your validator, just use the following command: ::: warning -Don't use more `uatom` thank you have! +Don't use more `uatom` than you have! ::: ```bash @@ -78,7 +78,7 @@ A `gentx` is a JSON file carrying a self-delegation. All genesis transactions ar ::: ::: warning Note -Don't use more `uatom` thank you have! +Don't use more `uatom` than you have! ::: ```bash From e111162f0c47793b00fb453b448a96d5c6cbf8ec Mon Sep 17 00:00:00 2001 From: Jack Zampolin <jack.zampolin@gmail.com> Date: Mon, 11 Mar 2019 14:57:49 -0700 Subject: [PATCH 07/13] Update docs/gaia/delegator-guide-cli.md --- docs/gaia/delegator-guide-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gaia/delegator-guide-cli.md b/docs/gaia/delegator-guide-cli.md index 6b2096be6..0859422d0 100644 --- a/docs/gaia/delegator-guide-cli.md +++ b/docs/gaia/delegator-guide-cli.md @@ -337,7 +337,7 @@ 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` +On Cosmos Hub mainnet, the accepted denom is `uatom`, where `1atom = 1,000,000uatom` ::: ### A note on gas and fees From 5b5960c5e9aedcd4f7d4fd8198f981a6e6a3e3a0 Mon Sep 17 00:00:00 2001 From: gamarin <gautier@tendermint.com> Date: Tue, 12 Mar 2019 18:31:23 +0100 Subject: [PATCH 08/13] fix version --- docs/gaia/installation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index cd150b57b..94ea9c801 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -48,10 +48,10 @@ $ gaiacli version --long ``` cosmos-sdk: 0.33.0 -git commit: 06f741609bbce747643e9f1f2abf67040ad78e16 -vendor hash: decf1ff8b31df2243aa27bcd6e1a40df4d30be81 +git commit: 7b4104aced52aa5b59a96c28b5ebeea7877fc4f0 +vendor hash: 5db0df3e24cf10545c84f462a24ddc61882aa58f build tags: netgo ledger -go version go1.12 darwin/amd64 +go version go1.12 linux/amd64 ``` ##### Build Tags From 9e446dfeb7befe60989b4a1f5e7910e4823d4242 Mon Sep 17 00:00:00 2001 From: gamarin <gautier@tendermint.com> Date: Wed, 13 Mar 2019 13:57:09 +0100 Subject: [PATCH 09/13] melekes review --- docs/gaia/gaiacli.md | 4 ---- docs/gaia/installation.md | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/gaia/gaiacli.md b/docs/gaia/gaiacli.md index c4429cf6a..ba24567d8 100644 --- a/docs/gaia/gaiacli.md +++ b/docs/gaia/gaiacli.md @@ -360,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 `uatom` than 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: diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index 94ea9c801..74d0ea30f 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -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-mainnet.md) 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 From 85b0733a6a1d7c336dabb16c838fd721fbf4d4e3 Mon Sep 17 00:00:00 2001 From: Christopher Goes <cwgoes@pluranimity.org> Date: Wed, 13 Mar 2019 15:30:48 +0100 Subject: [PATCH 10/13] Apply suggestions from code review Co-Authored-By: gamarin2 <gautier@tendermint.com> --- docs/gaia/delegator-guide-cli.md | 2 +- docs/gaia/join-mainnet.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/gaia/delegator-guide-cli.md b/docs/gaia/delegator-guide-cli.md index 0859422d0..03a3051d4 100644 --- a/docs/gaia/delegator-guide-cli.md +++ b/docs/gaia/delegator-guide-cli.md @@ -337,7 +337,7 @@ 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` +On Cosmos Hub mainnet, the accepted denom is `uatom` (micro-Atom), where `1atom = 1,000,000uatom` ::: ### A note on gas and fees diff --git a/docs/gaia/join-mainnet.md b/docs/gaia/join-mainnet.md index 4bc6a2f68..d2feece2e 100644 --- a/docs/gaia/join-mainnet.md +++ b/docs/gaia/join-mainnet.md @@ -90,7 +90,7 @@ On Cosmos Hub mainnet, the accepted denom is `uatom`, where `1atom = 1.000.000ua 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. From bd1b693bc6fbd340061c12aa9bb2c4f43daaf478 Mon Sep 17 00:00:00 2001 From: gamarin <gautier@tendermint.com> Date: Wed, 13 Mar 2019 15:32:51 +0100 Subject: [PATCH 11/13] chris review --- docs/gaia/gaiacli.md | 4 ++-- docs/gaia/validators/validator-setup.md | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/gaia/gaiacli.md b/docs/gaia/gaiacli.md index ba24567d8..dbbc05ebe 100644 --- a/docs/gaia/gaiacli.md +++ b/docs/gaia/gaiacli.md @@ -141,7 +141,7 @@ txs by `gasPrice` in the mempool, so providing higher fees or gas prices may yie e.g. ```bash -gaiacli tx send ... --fees=1000000uatom +gaiacli tx send ... --fees=50000uatom ``` or @@ -547,7 +547,7 @@ 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: `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: +In order for a proposal to be broadcasted to the network, the amount deposited must be above a `minDeposit` value (initial value: `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> "10000000uatom" \ diff --git a/docs/gaia/validators/validator-setup.md b/docs/gaia/validators/validator-setup.md index 199dbdd8d..117aacc00 100644 --- a/docs/gaia/validators/validator-setup.md +++ b/docs/gaia/validators/validator-setup.md @@ -58,8 +58,7 @@ You can confirm that you are in the validator set by using a third party explore ## Participate in genesis as a validator ::: 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. +The genesis ceremony for the Cosmos Hub mainnet is closed. Please skip to the next section. ::: If you want to participate in genesis as a validator, you need to justify that From f39cc0d548b6f1c8c8398ba48dade91a40e3b3e3 Mon Sep 17 00:00:00 2001 From: gamarin <gautier@tendermint.com> Date: Wed, 13 Mar 2019 15:37:26 +0100 Subject: [PATCH 12/13] typo fix --- docs/gaia/validators/validator-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gaia/validators/validator-setup.md b/docs/gaia/validators/validator-setup.md index 117aacc00..fdf7fad81 100644 --- a/docs/gaia/validators/validator-setup.md +++ b/docs/gaia/validators/validator-setup.md @@ -175,7 +175,7 @@ If you got jailed for downtime, you can get your voting power back to your valid gaiad start ``` -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) +Wait for your full node to catch up to the latest block. Then, you can [unjail your validator](#unjail-validator) Lastly, check your validator again to see if your voting power is back. From ce82e01ec416e6348192595e451bfd4e92eb5583 Mon Sep 17 00:00:00 2001 From: gamarin2 <gautier@tendermint.com> Date: Tue, 19 Mar 2019 00:58:11 +0100 Subject: [PATCH 13/13] Merge PR #3922: DOCS: gamarin/master docs update --- docs/gaia/delegator-guide-cli.md | 32 ++++++++++++++++++++------------ docs/gaia/installation.md | 1 + 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/gaia/delegator-guide-cli.md b/docs/gaia/delegator-guide-cli.md index 03a3051d4..a77914c1e 100644 --- a/docs/gaia/delegator-guide-cli.md +++ b/docs/gaia/delegator-guide-cli.md @@ -286,7 +286,7 @@ gaiacli config trust-node false Finally, let us set the `chain-id` of the blockchain we want to interact with: ```bash -gaiacli config chain-id gos-6 +gaiacli config chain-id cosmoshub-1 ``` ## Querying the state @@ -299,7 +299,7 @@ gaiacli config chain-id gos-6 ```bash // query account balances and other account-related information -gaiacli query account +gaiacli query account <yourAddress> // query the list of validators gaiacli query staking validators @@ -348,7 +348,7 @@ Transactions on the Cosmos Hub network need to include a transaction fee in orde 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. +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. For the remainder of this tutorial, we will use a `--gas-adjustment` of `1.5`. 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`. @@ -376,20 +376,20 @@ For mainnet, the recommended `gas-prices` is `0.025uatom`. // Bond a certain amount of Atoms to a given validator // ex value for flags: <validatorAddress>=cosmosvaloper18thamkhnj9wz8pa4nhnp9rldprgant57pk2m8s, <amountToBound>=10000000uatom, <gasPrice>=0.025uatom -gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorKeyName> --gas auto --gas-prices <gasPrice> +gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorKeyName> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice> // Withdraw all rewards // ex value for flag: <gasPrice>=0.025uatom -gaiacli tx distr withdraw-all-rewards --from <delegatorKeyName> --gas auto --gas-prices <gasPrice> +gaiacli tx distr withdraw-all-rewards --from <delegatorKeyName> --gas auto --gas-adjustment 1.5 --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>=10000000uatom, <gasPrice>=0.025uatom -gaiacli tx staking unbond <validatorAddress> <amountToUnbond> --from <delegatorKeyName> --gas auto --gas-prices <gasPrice> +gaiacli tx staking unbond <validatorAddress> <amountToUnbond> --from <delegatorKeyName> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice> ``` ::: warning @@ -444,19 +444,19 @@ At the end of the voting period, the proposal is accepted if there are more than // <type>=text/parameter_change/software_upgrade // ex value for flag: <gasPrice>=0.025uatom -gaiacli tx gov submit-proposal --title "Test Proposal" --description "My awesome proposal" --type <type> --deposit=10000000uatom --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-adjustment 1.5 --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>=10000000uatom -gaiacli tx gov deposit <proposalID> <deposit> --gas auto --gas-prices <gasPrice> --from <delegatorKeyName> +gaiacli tx gov deposit <proposalID> <deposit> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice> --from <delegatorKeyName> // Vote on a proposal // Retrieve proposalID from $gaiacli query gov proposals --status voting_period // <option>=yes/no/no_with_veto/abstain -gaiacli tx gov vote <proposalID> <option> --gas auto --gas-prices <gasPrice> --from <delegatorKeyName> +gaiacli tx gov vote <proposalID> <option> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice> --from <delegatorKeyName> ``` ### Signing transactions from an offline computer @@ -467,7 +467,15 @@ If you do not have a ledger device and want to interact with your private key on // Bond Atoms // 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 +gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorAddress> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice> --generate-only > unsignedTX.json +``` + +In order to sign, you will also need the `chain-id`, `account-number` and `sequence`. The `chain-id` is a unique identifier for the blockchain on which you are submitting the transaction. The `account-number` is an identifier generated when your account first receives funds. The `sequence` number is used to keep track of the number of transactions you have sent and prevent replay attacks. + +Get the chain-id from the genesis file (`cosmoshub-1`), and the two other fields using the account query: + +```bash +gaiacli query account <yourAddress> --chain-id cosmoshub-1 ``` Then, copy `unsignedTx.json` and transfer it (e.g. via USB) to the offline computer. If it is not done already, [create an account on the offline computer](#using-a-computer). For additional security, you can double check the parameters of your transaction before signing it using the following command: @@ -476,10 +484,10 @@ Then, copy `unsignedTx.json` and transfer it (e.g. via USB) to the offline compu cat unsignedTx.json ``` -Now, sign the transaction using the following command: +Now, sign the transaction using the following command. You will need the `chain-id`, `sequence` and `account-number` obtained earlier: ```bash -gaiacli tx sign unsignedTx.json --from <delegatorKeyName> > signedTx.json +gaiacli tx sign unsignedTx.json --from <delegatorKeyName> --offline --chain-id cosmoshub-1 --sequence <sequence> --account-number <account-number> > signedTx.json ``` Copy `signedTx.json` and transfer it back to the online computer. Finally, use the following command to broadcast the transaction: diff --git a/docs/gaia/installation.md b/docs/gaia/installation.md index 74d0ea30f..f35568ebb 100644 --- a/docs/gaia/installation.md +++ b/docs/gaia/installation.md @@ -11,6 +11,7 @@ mkdir -p $HOME/go/bin echo "export GOPATH=$HOME/go" >> ~/.bash_profile echo "export GOBIN=$GOPATH/bin" >> ~/.bash_profile echo "export PATH=$PATH:$GOBIN" >> ~/.bash_profile +source ~/.bash_profile ``` ::: tip