Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch Release v0.34.2 (develop) #4185

Merged
merged 18 commits into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @rigelrozanski @alexanderbez @jackzampolin @alessio
* @rigelrozanski @alexanderbez @jackzampolin @alessio @cwgoes
1 change: 0 additions & 1 deletion .pending/breaking/gaia/4053-Add-inv-che

This file was deleted.

This file was deleted.

51 changes: 26 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# Changelog

* [0.34.0](#0340)
alexanderbez marked this conversation as resolved.
Show resolved Hide resolved
* [Breaking Changes](#breaking-changes)
* [Gaia](#gaia)
* [Gaia CLI](#gaia-cli)
* [SDK](#sdk)
* [Tendermint](#tendermint)
* [New features](#new-features)
* [SDK](#sdk-1)
* [Gaia](#gaia-1)
* [Gaia CLI](#gaia-cli-1)
* [Gaia REST API](#gaia-rest-api)
* [Improvements](#improvements)
* [Gaia](#gaia-2)
* [Gaia CLI](#gaia-cli-2)
* [SDK](#sdk-2)
* [Bug Fixes](#bug-fixes)
* [Gaia](#gaia-3)
* [Gaia CLI](#gaia-cli-3)
* [SDK](#sdk-3)
* [0.33.2](#0332)
* [Improvements](#improvements-1)
* [Tendermint](#tendermint-1)
* [0.33.1](#0331)
* [Bug Fixes](#bug-fixes-1)
* [Gaia](#gaia-4)
## 0.34.2

### Improvements

#### SDK

* [\#4135](https://github.com/cosmos/cosmos-sdk/pull/4135) Add further clarification
to generate only usage.

### Bug Fixes

#### SDK

* [\#4135](https://github.com/cosmos/cosmos-sdk/pull/4135) Fix `NewResponseFormatBroadcastTxCommit`
* [\#4053](https://github.com/cosmos/cosmos-sdk/issues/4053) Add `--inv-check-period`
flag to gaiad to set period at which invariants checks will run.
* [\#4099](https://github.com/cosmos/cosmos-sdk/issues/4099) Update the /staking/validators endpoint to support
status and pagination query flags.

## 0.34.1

### Bug Fixes

#### Gaia

* [#4163](https://github.com/cosmos/cosmos-sdk/pull/4163) Fix v0.33.x export script to port gov data correctly.

## 0.34.0

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ breaking changes.

## Cosmos Hub Mainnet

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).
To run a full-node for the mainnet of the Cosmos Hub, first [install `gaia`](./docs/cosmos-hub/installation.md), then follow [the guide](./docs/cosmos-hub/join-mainnet.md).

For status updates and genesis file, see the
[launch repo](https://github.com/cosmos/launch).
Expand Down
35 changes: 34 additions & 1 deletion contrib/export/v0.33.x-to-v0.34.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ def process_raw_genesis(genesis, parsed_args):
},
}

# default tm value
# migrate governance state as the internal structure of proposals has changed
migrate_gov_data(genesis['app_state']['gov'])

# default Tendermint block time (ms)
genesis['consensus_params']['block']['time_iota_ms'] = '1000'

# proposal #1 updates
Expand All @@ -36,6 +39,36 @@ def process_raw_genesis(genesis, parsed_args):
return genesis


def migrate_gov_data(gov_data):
for p in gov_data['proposals']:
# get Amino type and value
t = p['type']
v = p['value']

del p['type']
del p['value']

assert t == 'gov/TextProposal', 'invalid proposal type: {t}'
assert p == {}, 'expected proposal to be empty after deleting contents'

p['proposal_content'] = {
'type': t,
'value': {
'title': v['title'],
'description': v['description']
}
}

p['proposal_id'] = v['proposal_id']
p['proposal_status'] = v['proposal_status']
p['final_tally_result'] = v['final_tally_result']
p['submit_time'] = v['submit_time']
p['deposit_end_time'] = v['deposit_end_time']
p['total_deposit'] = v['total_deposit']
p['voting_start_time'] = v['voting_start_time']
p['voting_end_time'] = v['voting_end_time']


if __name__ == '__main__':
parser = lib.init_default_argument_parser(
prog_desc='Convert genesis.json from v0.33.x to v0.34.0',
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
collapsable: true,
children: [
"/intro/",
"/intro/sdk-app-architecture",
"/intro/sdk-design",
"/intro/ocap"
]
},
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

## 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).
- [Join the mainnet](./cosmos-hub/join-mainnet.md) of the Cosmos Hub.
- [Join the latest public testnet](./cosmos-hub/join-testnet.md) of the Cosmos Hub.
- [Start your own `gaia` testnet](./cosmos-hub/deploy-testnet.md).

## Creating a new SDK project

Expand Down
30 changes: 24 additions & 6 deletions docs/cosmos-hub/delegator-guide-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Please exercise extreme caution!
[**Download the binaries**]
Not available yet.

[**Install from source**](https://cosmos.network/docs/gaia/installation.html)
[**Install from source**](https://cosmos.network/docs/cosmos-hub/installation.html)

::: tip
`gaiacli` is used from a terminal. To open the terminal, follow these steps:
Expand Down 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-mainnet.html).
You will find the tutorial on how to install `gaiad` [here](https://cosmos.network/docs/cosmos-hub/installation.html), and the guide to run a full-node [here](https://cosmos.network/docs/cosmos-hub/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 cosmoshub-1
gaiacli config chain-id cosmoshub-2
```

## Querying the State
Expand Down Expand Up @@ -358,6 +358,24 @@ The transaction `fees` are the product of `gas` and `gasPrice`. As a user, you h
For mainnet, the recommended `gas-prices` is `0.025uatom`.
:::

### Sending Tokens

::: tip
**Before you can bond atoms and withdraw rewards, you need to [set up `gaiacli`](#setting-up-gaiacli) and [create an account](#creating-an-account)**
:::

::: warning
**Note: These commands need to be run on an online computer. It is more secure to perform them commands using a Ledger Nano S device. For the offline procedure, click [here](#signing-transactions-from-an-offline-computer).**
:::

```bash
// Send a certain amount of tokens to an address
// Ex value for parameters (do not actually use these values in your tx!!): <to_address>=cosmos16m93fezfiezhvnjajzrfyszml8qm92a0w67ntjhd3d0 <amount>=1000000uatom
// Ex value for flags: <gasPrice>=0.025uatom

gaiacli tx send <to_address> <amount> --from <yourKeyName> --gas auto --gas-adjustment 1.5 --gas-prices <gasPrice>
```

### Bonding Atoms and Withdrawing Rewards

::: tip
Expand Down Expand Up @@ -480,10 +498,10 @@ gaiacli tx staking delegate <validatorAddress> <amountToBond> --from <delegatorA

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:
Get the chain-id from the genesis file (`cosmoshub-2`), and the two other fields using the account query:

```bash
gaiacli query account <yourAddress> --chain-id cosmoshub-1
gaiacli query account <yourAddress> --chain-id cosmoshub-2
```

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 @@ -495,7 +513,7 @@ cat unsignedTx.json
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> --offline --chain-id cosmoshub-1 --sequence <sequence> --account-number <account-number> > signedTx.json
gaiacli tx sign unsignedTx.json --from <delegatorKeyName> --offline --chain-id cosmoshub-2 --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
2 changes: 1 addition & 1 deletion docs/cosmos-hub/deploy-testnet.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Deploy Your Own Testnet
# Deploy Your Own Gaia Testnet

This document describes 3 ways to setup a network of `gaiad` nodes, each serving a different usecase:

Expand Down
36 changes: 25 additions & 11 deletions docs/cosmos-hub/gaiacli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,41 @@

## Gaia CLI

::: tip Note
If you receive this error message:
`gaiacli` is the tool that enables you to interact with the node that runs on the Cosmos Hub network, whether you run it yourself or not. Let us set it up properly. In order to install it, follow the [installation procedure](./installation.md).

### Setting up gaiacli

The main command used to set up `gaiacli` is the following:

```bash
Must specify these options: --chain-id when --trust-node is false
gaiacli config <flag> <value>
```

you must choose whether you wish to verify lite client proofs. If you trust the node which you are querying, you can simply pass `--trust-node=true` - otherwise you'll need to specify `--chain-id`.
:::
It allows you to set a default value for each given flag.

`gaiacli` is the command line interface to manage accounts and transactions on Cosmos testnets.
Its configuration file resides in `$HOME/.gaiacli/config/config.toml` and can be edited either
by hand or via the `gaiacli config` command:
First, set up the address of the full-node you want to connect to:

```bash
gaiacli config chain-id gaia-9004
gaiacli config node <host>:<port

// example: gaiacli config node https://77.87.106.33:26657
```

For more information on the command usage, refer to its help screen: `gaiacli config --help`.
If you run your own full-node, just use `tcp://localhost:26657` as the address.

Then, let us set the default value of the `--trust-node` flag:

Here is a list of useful `gaiacli` commands, including usage examples.
```bash
gaiacli config trust-node true

// Set to true if you trust the full-node you are connecting to, false otherwise
```

Finally, let us set the `chain-id` of the blockchain we want to interact with:

```bash
gaiacli config chain-id cosmoshub-2
```

### Keys

Expand Down
93 changes: 93 additions & 0 deletions docs/cosmos-hub/upgrade-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Upgrade Your Node

This document describes the upgrade procedure of a `gaiad` full-node to a new version.

## Software Upgrade

First, stop your instance of `gaiad`. Next, upgrade the software:

```bash
cd $GOPATH/src/github.com/cosmos/cosmos-sdk
git fetch --all && git checkout <new_version>
make tools install
```

::: tip
*NOTE*: If you have issues at this step, please check that you have the latest stable version of GO installed.
:::

See the [testnet repo](https://github.com/cosmos/testnets) for details on which version is needed for which public 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!

## Ugrade Genesis File

:::warning
If the new version you are upgrading to has breaking changes, you will have to restart your chain. If it is not breaking, you can skip to [Restart](#restart)
:::

To upgrade the genesis file, you can either fetch it from a trusted source or export it locally.

### Fetching from a Trusted Source

If you are joining the mainnet, fetch the genesis from the [mainnet repo](https://github.com/cosmos/launc). If you are joining a public testnet, fetch the genesis from the appropriate testnet in the [testnet repo](https://github.com/cosmos/testnets). Otherwise, fetch it from your trusted source.

Save the new genesis as `new_genesis.json`. Then replace the old `genesis.json` with `new_genesis.json`

```bash
cd $HOME/.gaiad/config
cp -f genesis.json new-_enesis.json
mv new_genesis.json genesis.json
```

Then, go to the [reset data](#reset-data) section.

### Exporting State to a New Genesis Locally

If you were running a node in the previous version of the network and want to build your new genesis locally from a state of this previous network, use the following command:

```bash
cd $HOME/.gaiad/config
gaiad export --for-zero-height --height=<export-height> > new_genesis.json
```

The command above take a state at a certain height `<export-height>` and turns it into a new genesis file that can be used to start a new network.

Then, replace the old `genesis.json` with `new_genesis.json`.

```bash
cp -f genesis.json new-_enesis.json
mv new_genesis.json genesis.json
```

At this point, you might want to run a script to update the exported genesis into a genesis that is compatible with your new version. For example, the attributes of a the `Account` type changed, a script should query encoded account from the account store, unmarshall them, update their type, re-marshal and re-store them. You can find an example of such script [here](https://github.com/cosmos/cosmos-sdk/blob/develop/contrib/export/v0.33.x-to-v0.34.0.py).

## Reset Data

:::warning
If the version <new_version> you are upgrading to is not breaking from the previous one, you should not reset the data. If it is not breaking, you can skip to [Restart](#restart)
:::

::: warning
If you are running a **validator node** on the mainnet, always be careful when doing `gaiad unsafe-reset-all`. You should never use this command if you are not switching `chain-id`.
:::

::: danger IMPORTANT
Make sure that every node has a unique `priv_validator.json`. Do not copy the `priv_validator.json` from an old node to multiple new nodes. Running two nodes with the same `priv_validator.json` will cause you to get slashed due to double sign !
:::

First, remove the outdated files and reset the data. **If you are running a validator node, make sure you understand what you are doing before resetting**.

```bash
gaiad unsafe-reset-all
```

Your node is now in a pristine state while keeping the original `priv_validator.json` and `config.toml`. If you had any sentry nodes or full nodes setup before, your node will still try to connect to them, but may fail if they haven't also been upgraded.

## Restart

To restart your node, just type:

```bash
gaiad start
```
2 changes: 1 addition & 1 deletion docs/cosmos-hub/validators/validator-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Your validator is active if the following command returns anything:
gaiacli query tendermint-validator-set | grep "$(gaiad tendermint show-validator)"
```

You should also be able to see your validator on the [Explorer](https://explorecosmos.network/validators). You are looking for the `bech32` encoded `address` in the `~/.gaiad/config/priv_validator.json` file.
You should now see your validator in one of the Cosmos Hub explorers. You are looking for the `bech32` encoded `address` in the `~/.gaiad/config/priv_validator.json` file.

::: warning Note
To be in the validator set, you need to have more total voting power than the 100th validator.
Expand Down
Loading