Skip to content

Instantly share code, notes, and snippets.

@alexanderbez
Last active June 8, 2019 12:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderbez/5e87886221eb304b9e85ad4b167c99c8 to your computer and use it in GitHub Desktop.
Save alexanderbez/5e87886221eb304b9e85ad4b167c99c8 to your computer and use it in GitHub Desktop.
Gaia network upgrade (cosmoshub-1 => cosmoshub-2)

Gaia v0.34.0 Upgrade Instructions

The following document describes the necessary steps involved that a full node must take in order to upgrade from cosmoshub-1 to cosmoshub-2.

Preliminary

Given the acceptance of the transfers enablement proposal which encompasses the v0.34.0 release of the SDK, the Cosmos network, cosmoshub-1, will halt at block TODO and will upgrade to cosmoshub-2 using the v0.34.0 (0f7877c2) release of the SDK.

Since v0.33.x, the SDK has upgraded to use Golang's new module system. If you see any errors when building or installing relating to your $GOPATH, you must set the environment variable GO111MODULE=on before building or installing.

Steps

  1. The version of the SDK, v0.33.0, which currently all full nodes in the network run, contains a zero height export bug related to distribution. This bug has been fixed in a hotfix release v0.33.2 (dba33693).

    • Checkout and install the v0.33.2 release
    $ git checkout v0.33.2; make install
    • Verify the binary versions
    $ gaiacli version --long
    cosmos-sdk: 0.33.2
    git commit: dba33693c4b714db7c01eb3926edf780be12a8e5
    vendor hash: 9aaf52ef4de69f6422b4e43f397a544d7bc02fcd
    build tags: netgo ledger
    go version go1.12.1 darwin/amd64
    $ gaiad version --long
    cosmos-sdk: 0.33.2
    git commit: dba33693c4b714db7c01eb3926edf780be12a8e5
    vendor hash: 9aaf52ef4de69f6422b4e43f397a544d7bc02fcd
    build tags: netgo ledger
    go version go1.12.1 darwin/amd64
  2. Export existing state from cosmoshub-1.

    • Export genesis state to file
    $ gaiad export --for-zero-height --height=500000 > cosmoshub_1_genesis_export.json
  3. At this point you now have a valid exported genesis state. All further steps now require the v0.34.0 release of the SDK.

    • Checkout and install the v0.34.0 release
    $ git checkout v0.34.0; make install
    • Verify the binary versions
    $ gaiacli version --long
    cosmos-sdk: 0.34.0
    git commit: 0f7877c23b407e24e56056469e90fe6b8a78d84c
    vendor hash: b0ee613acca9a3a572b558d0481ec7baa008f732431392af81db3555c92c8dd7
    build tags: netgo ledger
    go version go1.12.1 darwin/amd64
    $ gaiad version --long
    cosmos-sdk: 0.34.0
    git commit: 0f7877c23b407e24e56056469e90fe6b8a78d84c
    vendor hash: b0ee613acca9a3a572b558d0481ec7baa008f732431392af81db3555c92c8dd7
    build tags: netgo ledger
    go version go1.12.1 darwin/amd64
  4. The exported genesis state generated in step (2) must now be modified to include the agreed upon parameter changes in the governance proposal.

$ python contrib/export/v0.33.x-to-v0.34.0.py cosmoshub_1_genesis_export.json \
  --chain-id=cosmoshub-2 --start-time=2019-04-22T17:00:00Z > genesis.json
  1. Reset state
$ gaiad unsafe-reset-all
  1. Restart the node!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment