cli
cli copied to clipboard
Can't publish chain if `config.yml` is wrong for Ignite CLI
Describe the bug
Ignite CLI config has been upgraded, therefore when using serve for a chain without the right config format, the command might file.
network commands currently read these config at several steps of the workflow like publish. This should be to test the chain is a right Cosmos SDK blockchain
Therefore, publish command might fail if the CLI and chain to be published don't use the same config format
ignite n chain publish https://github.com/ignite/example
✔ Source code fetched
✔ Blockchain set up
config is not valid: at least one validator is required
network commands should be less opinionated and should not require a config with a specific format. The requirement for a chain to be published on Ignite should be that the binary has the right API. To test chain validity we should serve the chain with default values for a sample validator without reading a config file
I think the config of the chain being published should be up to date with the version of the config known by the Ignite CLI binary being used to run the network commands. The version of the config should be "aligned" with the version of the CLI being used because the config must be read for building the blockchain app binary.
Updating the config locally after fetching the source code just to build the binary doesn't seem to be a good idea.
For sure at least we should handle the error and give a friendlier message like:
config version v3 is required to run the command and the current version is v2
We could also add the config version to ignite help.
Otherwise, it might be possible to use an interface to be able to read the build related values from any config version which might solve the issue but @lubtd I would like to know WDYT?
I think printing
config version v3 is required to run the command and the current version is v2
would be a perfect solution