Skip to content

Feature/cosmos integration nico#1206

Closed
NicolasMahe wants to merge 32 commits intodevfrom
feature/cosmos-integration-nico
Closed

Feature/cosmos integration nico#1206
NicolasMahe wants to merge 32 commits intodevfrom
feature/cosmos-integration-nico

Conversation

@NicolasMahe
Copy link
Copy Markdown
Member

@NicolasMahe NicolasMahe commented Aug 7, 2019

To start the engine in validator mode: no new config 🎊 🍾

MESG_LOG_LEVEL=info ./dev

To start a another engine that connect to a validator one:

rm -R ~/.mesg2; MESG_TENDERMINT_P2P_SEEDS=97b0a26ff96fcd17f103a941cc5f60c7fe55d705@10.0.98.2:26656 MESG_TENDERMINT_VALIDATORPUBKEY=9CAC089727C943E534D58472294D3157915058A60B6A800BC66A3E8B33D142DA MESG_NAME=engine-1 MESG_SERVER_PORT=50053 MESG_PATH=~/.mesg2 MESG_LOG_LEVEL=info ./dev

don't forget to replace MESG_TENDERMINT_VALIDATORPUBKEY and MESG_TENDERMINT_P2P_SEEDS ;)

Comment thread tendermint/node.go Outdated
nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile())
if err != nil {
return nil, err
nodeKey := &p2p.NodeKey{
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@krhubert why removing loadOrGenNodeKey? The goal of this PR is to use a maximum of stuff already done by Cosmos SDK. We could implement our own system to store the node and validator private keys later on ;)

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.

You said that node key will be generated every time engine start, so why we want to load them? Using loadOrGen is misleading for other devs.

By generating directly pub key it's clear that the key is changing on every start.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The goal of this PR is simply to start tendermint with the most similar logic and code than
cosmos sdk. we can change the behavior later on.

Only the genesis is generated to avoid to add its hardcoded json version to the source code. But it brings some limitation and complicated when we add store to the cosmos app..

Comment thread config/config.go
// PubKeyEd25519 is type used to parse value provided by envconfig.
type PubKeyEd25519 ed25519.PubKeyEd25519

func (key *PubKeyEd25519) Decode(value string) error {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice fix ;)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe we could do a PR on tendermint repo to add this function ;)

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.

They use viper for receiving flags/args/envs and so I don't think so it would pass :/

@NicolasMahe
Copy link
Copy Markdown
Member Author

Commit e32d912 make it possible for a second tendermint node to connect to the validator and receive blocks 🎊

@NicolasMahe NicolasMahe closed this Aug 9, 2019
@NicolasMahe NicolasMahe deleted the feature/cosmos-integration-nico branch August 9, 2019 09:50
@NicolasMahe
Copy link
Copy Markdown
Member Author

closed in favor of #1211

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.

2 participants