ignite / cli

Ignite is a CLI tool and hub designed for constructing Proof of Stake Blockchains rooted in Cosmos-SDK
https://ignite.com
Other
1.26k stars 547 forks source link

`config.yml` upgrade erases the file when fails #3098

Closed fadeev closed 1 year ago

fadeev commented 2 years ago
ignite s chain example

Remove version from config.yml:

accounts:
  - name: alice
    coins: ['20000token', '200000000stake']
  - name: bob
    coins: ['10000token', '100000000stake']
validators:
  - name: alice
    bonded: '100000000stake'
client:
  openapi:
    path: 'docs/static/openapi.yml'
  typescript:
    path: 'ts-client'
  vuex:
    path: 'vue/src/store'
faucet:
  name: bob
  coins: ['5token', '100000stake']
config is not valid: validator 'name' is required

The problem is that this erases config.yml.

Ideally, if the upgrade process fails for any reason, it should revert back to the original state and print a link to a manual upgrade process.

Ignite CLI version:     v0.25.1
Ignite CLI build date:  2022-10-20T15:52:00Z
Ignite CLI source hash: cc393a9b59a8792b256432fafb472e5ac0738f7c
Cosmos SDK version:     v0.46.3
Your OS:                darwin
Your arch:              arm64
Your Node.js version:   v16.17.0
Your go version:        go version go1.18.3 darwin/arm64
Your uname -a:          Darwin Deniss-MBP.modem.local 22.1.0 Darwin Kernel Version 22.1.0: Mon Aug 29 20:11:49 PDT 2022; root:xnu-8792.40.74.0.1~20/RELEASE_ARM64_T6000 arm64
Your cwd:               /Users/fadeev/example
Is on Gitpod:           false
jeronimoalbi commented 1 year ago

I'm actually getting a slightly different error:

Error while loading chain's plugins: config is not valid: validator 'name' is required

The loading of CLI plugins happens before anything. The config file is be read during this process which happens before config file migration.

Some changes are needed because now we have to run config migration before the plugins are loaded. I'm going to work on that.

I guess the error now is slightly different because some plugin changes have been merged.