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

Docs update #4176

Merged
merged 6 commits into from
Apr 25, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
udate upgrade node doc
  • Loading branch information
gamarin2 committed Apr 23, 2019
commit dcdd5973502169b2453df241d2e56a4c5b631159
32 changes: 14 additions & 18 deletions docs/cosmos-hub/upgrade-node.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# Upgrade Your Node
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this guide needs a rethink and shouldn't block the rest of this PR. This should be a doc that describes the process for upgrading a network generically and explains each of the steps. This guide kinda jumps in at the mainnet upgrade and then has that content in less detail at the bottom of the doc.


<<<<<<< HEAD
This document describes the upgrade procedure of a `gaiad` full-node from a version <current_version> to a version <new_version>.
=======
::: warning
The detailed procedure to upgrade a mainnet node from `cosmoshub-1` to `cosmoshub-2` can be found [here](https://gist.github.com/alexanderbez/5e87886221eb304b9e85ad4b167c99c8).
:::

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

## Software Upgrade

Expand All @@ -28,44 +20,48 @@ See the [testnet repo](https://github.com/cosmos/testnets) for details on which

Your full node has been cleanly upgraded!

## Fetch new genesis
## 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)
:::

The procedure varies depending on the network you want to connect to.

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

Follow the [official upgrade guide](https://gist.github.com/alexanderbez/5e87886221eb304b9e85ad4b167c99c8).
### Fetching from a Trusted Source

### Public Testnet
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.

If you are joining a new public testnet, fetch the genesis from the appropriate testnet in the [testnet repo](https://github.com/cosmos/testnets). Save the new genesis as `new_genesis.json`. Then replace the old `genesis.json` with `new_genesis.json`
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
```

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

If you are running your own local testnet, you can either start with a brand new genesis using `gaiad init`, or export the state from you previous network as a new genesis. To do so, use the following command
### 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-marhsall 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-marhsall -> re-marshal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update


## Reset Data

:::warning
Expand Down