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

refactor(chain): make config optional for init phase #3183

Merged
merged 26 commits into from
Dec 9, 2022

Conversation

lumtis
Copy link
Contributor

@lumtis lumtis commented Nov 28, 2022

Allow launching a chain with Ignite Network without a config.yml

This doesn't fix #3166

However:

We can't really fix the initial issue about config with no validator without changing the genesis validation logic. When config.yml exists, network commands will read it because it may contain instruction for the build process like the main entrypoint if several main exists.
The solution is to tolerate no validator for a config.yml, and could eventually make sense to consider because the fact that a config can contain information for building process mean that the minimal set content of a config can be used solely for this and so can contain no validator, which is used for experimenting the chain

The second issue --no-check that fails if the config is not valid, is because even if we don't interact with the chain locally when --no-check is provided, we still initialize a chain object that needs read the config to be initialized. The solution is to refactor the chain object in networkchain (separating the chain as information about source about the chain as a local source code)

Creating separate issues for the above so #3166 can be closed

@lumtis lumtis marked this pull request as ready for review November 29, 2022 02:52
@lumtis lumtis self-assigned this Nov 30, 2022
@lumtis lumtis requested a review from Pantani as a code owner December 2, 2022 20:59
jeronimoalbi
jeronimoalbi previously approved these changes Dec 5, 2022
@lumtis lumtis requested a review from jeronimoalbi December 7, 2022 19:44
jeronimoalbi
jeronimoalbi previously approved these changes Dec 8, 2022
tbruyelle
tbruyelle previously approved these changes Dec 8, 2022
@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #3183 (6783acc) into main (a645f1e) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3183      +/-   ##
==========================================
- Coverage   19.91%   19.91%   -0.01%     
==========================================
  Files         385      385              
  Lines       30460    30463       +3     
==========================================
  Hits         6066     6066              
- Misses      23810    23813       +3     
  Partials      584      584              
Impacted Files Coverage Δ
ignite/cmd/chain_init.go 0.00% <0.00%> (ø)
ignite/cmd/network_chain_init.go 0.00% <0.00%> (ø)
ignite/cmd/network_chain_prepare.go 0.00% <0.00%> (ø)
ignite/cmd/network_chain_show_genesis.go 0.00% <0.00%> (ø)
ignite/services/chain/chain.go 6.46% <0.00%> (+0.21%) ⬆️
ignite/services/chain/init.go 0.00% <0.00%> (ø)
ignite/services/chain/serve.go 0.00% <0.00%> (ø)
ignite/services/network/networkchain/init.go 0.00% <0.00%> (ø)
...nite/services/network/networkchain/networkchain.go 0.00% <0.00%> (ø)
... and 1 more

@lumtis lumtis dismissed stale reviews from tbruyelle and jeronimoalbi via 6783acc December 8, 2022 21:16
@lumtis lumtis merged commit 1f84fcf into main Dec 9, 2022
@lumtis lumtis deleted the network-no-read-config branch December 9, 2022 13:56
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
* init config optional

* option change

* fix validator

* fix chain

* changelog

* fix some errors

* fix keyring backend

* fix prepare

* Update ignite/services/chain/init.go

Co-authored-by: Jerónimo Albi <[email protected]>

* refactor error

* remove rpc address

* add init args

* thomas simplification

* comments

* fix keyring backend genesis show

Co-authored-by: Jerónimo Albi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish: config is not valid: at least one validator is required
5 participants