Skip to content

feat: ignite chain genesis config option - #2950

Closed
aljo242 wants to merge 45 commits into
developfrom
feat/ignite-config-genesis
Closed

feat: ignite chain genesis config option#2950
aljo242 wants to merge 45 commits into
developfrom
feat/ignite-config-genesis

Conversation

@aljo242

@aljo242 aljo242 commented Oct 19, 2022

Copy link
Copy Markdown
Contributor

Closes #2852

Example:

ignite network chain publish github.com/aljo242/test --genesis-config ./docs/config_test.yml
Source code fetched
Blockchain set up
Chain's binary built
Blockchain initialized
Genesis initialized
✔ Network published 
⋆ Launch ID: 41 

@aljo242
aljo242 marked this pull request as ready for review October 19, 2022 19:06
Comment thread ignite/cmd/network_chain_publish.go Outdated
Comment thread ignite/services/chain/init.go
tbruyelle
tbruyelle previously approved these changes Oct 20, 2022

@tbruyelle tbruyelle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Co-authored-by: Jerónimo Albi <jeronimo.albi@tendermint.com>
@lubtd

lubtd commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

@aljo242 Got recently the info that it is still WIP, is it now ready for review?

@aljo242

aljo242 commented Oct 20, 2022

Copy link
Copy Markdown
Contributor Author

Still WIP - the custom genesis being built, but not populated on ignite network

@lubtd

lubtd commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

Still WIP - the custom genesis being built, but not populated on ignite network

What do you mean by not populated on Ignite Network?
InitialGenesis field is not set?

@lubtd lubtd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have some issue when using a genesis that contains accounts:

$ignite n chain publish https://github.com/tendermint/spn --genesis-config config.yml
⋆ Launch ID: 242

$ignite n chain show genesis 242
Source code fetched
Blockchain set up
Blockchain initialized
account already exists

It seems like accounts are initialized twice?

@lubtd

lubtd commented Oct 24, 2022

Copy link
Copy Markdown
Contributor

There is this issue when using a config.yml that doesn't contain a genesis field:

ignite n chain publish https://github.com/ignite/example --genesis-config config.yml
Source code fetched
Blockchain set up
Chain's binary built
Blockchain initialized
no genesis found in custom config

I think we should still be able to use the config file for initial genesis since we can also specify just initial genesis accounts in it

@aljo242

aljo242 commented Oct 24, 2022

Copy link
Copy Markdown
Contributor Author

I have some issue when using a genesis that contains accounts:

$ignite n chain publish https://github.com/tendermint/spn --genesis-config config.yml
⋆ Launch ID: 242

$ignite n chain show genesis 242
Source code fetched
Blockchain set up
Blockchain initialized
account already exists

It seems like accounts are initialized twice?

Yeah, this is happening during publish and then during another call of init. Should we enforce that all yaml config accounts do not show their mnemonic but do require an address?

@lubtd

lubtd commented Oct 24, 2022

Copy link
Copy Markdown
Contributor

Yeah, this is happening during publish and then during another call of init. Should we enforce that all yaml config accounts do not show their mnemonic but do require an address?

It makes sense in general as there shouldn't be account with public mnemonic for a published network.
However, I am not sure seeing why it would solve the issue, maybe I didn't get the issue

@aljo242

aljo242 commented Oct 24, 2022

Copy link
Copy Markdown
Contributor Author

Working now with:

ignite network chain publish github.com/aljo242/test --genesis-config config.yml
ignite n chain init 252

The config needs to have a valid SDK address and NOT include a mnemonic.

@aljo242
aljo242 requested a review from lubtd October 24, 2022 22:06
@lubtd

lubtd commented Oct 24, 2022

Copy link
Copy Markdown
Contributor

I added a config in ignite/example https://github.com/ignite/example/blob/master/genesis/gen.yml

It seems there is still an issue with the dialing peers that I raised above

Dialing peer address={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} module=p2p
6:15PM INF Reconnecting to peer addr={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} module=p2p
6:15PM INF Dialing peer address={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} module=p2p
6:15PM INF Error reconnecting to peer. Trying again addr={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} err="dial tcp 200.46.122.3:26656: connect: connection refused" module=p2p tries=0
6:15PM INF Dialing peer address={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} module=p2p
6:15PM ERR Error dialing peer err="dial tcp 200.46.122.3:26656: connect: connection refused" module=p2p
6:15PM INF Dialing peer address={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} module=p2p
6:15PM INF Error reconnecting to peer. Trying again addr={"id":"7671b6c5149e55942ccc484887c3a56dc11852e8","ip":"200.46.122.3","port":26656} err="dial tcp 200.46.122.3:26656: connect: connection refused" module=p2p tries=1

this is for the chain launch ID 253 that I published with

ignite n chain publish https://github.com/ignite/example --genesis-config genesis/gen.ym

For the chain 254 that I published without config, the network starts and produce blocks

ignite n chain publish https://github.com/ignite/example

There might still be some minimal side effects in the node config?

@aljo242

aljo242 commented Oct 25, 2022

Copy link
Copy Markdown
Contributor Author

I reverted all of the changes made to the node config. Will keep investigating.

@lubtd

lubtd commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

Any news on this @aljo242 ?

@aljo242

aljo242 commented Oct 31, 2022

Copy link
Copy Markdown
Contributor Author

Any news on this @aljo242 ?

Still working on this

@lubtd can you walk me through all of the steps you are taking to produce this error?

@aljo242 aljo242 self-assigned this Nov 1, 2022
return err
}

// reapply since overwritten with genesis config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add more details in the comments for this operation?
Why is it needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. This is needed because earlier, I am invoking c.chain.InitChain() which will populate the .toml files incorrectly. We decided to not add logic that would modify those functions internally, so I just need to call the same logic again, but with a different config than what we are getting from the network.

The issues we're having with this PR think that some of this related code needs refactored before this can be done cleanly

Comment thread ignite/services/chain/chain.go
@aljo242 aljo242 closed this Nov 4, 2022
@aljo242
aljo242 deleted the feat/ignite-config-genesis branch November 7, 2022 14:41
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.

network: support Ignite CLI config as initial genesis

4 participants