Skip to content

Commit

Permalink
Merge branch 'master' into release/v0.33.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzampolin authored Apr 2, 2019
2 parents d0152b3 + ce82e01 commit 32327e8
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 284 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
sidebar: [
{
title: "Overview",
collapsable: false,
collapsable: true,
children: [
"/intro/",
"/intro/sdk-app-architecture",
Expand All @@ -35,24 +35,25 @@ 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",
"/gaia/validators/validator-faq",
"/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",
Expand All @@ -74,7 +75,7 @@ module.exports = {
},
{
title: "Clients",
collapsable: false,
collapsable: true,
children: [
"/clients/",
"/clients/cli",
Expand Down
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions docs/gaia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
56 changes: 36 additions & 20 deletions docs/gaia/delegator-guide-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -336,20 +336,28 @@ 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` (micro-Atom), 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.
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`.
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
Expand All @@ -366,22 +374,22 @@ 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>
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.001stake
// 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>=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>
gaiacli tx staking unbond <validatorAddress> <amountToUnbond> --from <delegatorKeyName> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice>
```
::: warning
Expand Down Expand Up @@ -434,21 +442,21 @@ 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-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>=1stake
// 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
Expand All @@ -457,9 +465,17 @@ 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-adjustment 1.5 --gas-prices <gasPrice> --generate-only > unsignedTX.json
```
gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorAddress> --gas auto --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:
Expand All @@ -468,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:
Expand Down
31 changes: 11 additions & 20 deletions docs/gaia/gaiacli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=50000uatom
```

or

```bash
gaiacli tx send ... --gas-prices=0.000001stake
gaiacli tx send ... --gas-prices=0.025uatom
```

### Account
Expand Down Expand Up @@ -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>
Expand All @@ -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:
Expand Down Expand Up @@ -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>
```
Expand Down Expand Up @@ -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 (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> <200steak> \
gaiacli tx gov deposit <proposal_id> "10000000uatom" \
--from=<name> \
--chain-id=<chain_id>
```
Expand Down Expand Up @@ -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
```
Expand Down
Loading

0 comments on commit 32327e8

Please sign in to comment.