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

Make sure validator nodes can find each other #153

Merged
merged 4 commits into from
Nov 22, 2021
Merged

Conversation

pepyakin
Copy link
Contributor

For unknown reasons my nodes refuse connecting to each other. This is not only me though apprently #77. There was an attempt to fix that by @JesseAbram, however, it never really landed.

So I just went ahead and implemented @bkchr's suggestion (at least my interpretation of it): do not wait for the node to start up and just embed the keys into the chainspec.

Specifically, the config gets a new parameter for a node: nodeKey. This is a 32 byte hex encoded string, the same as you would put in --node-key parameter when running a substrate node. In fact, we pass the node key with that flag upon spawning the validator nodes. In case the config does not specify node key, we just generate it. Then that nodeKey we construct a peer id, and use that to generate the boot nodes list. The boot nodes list assumes localhost/127.0.0.1.

Since this PR adds new dependencies, I also updated the yarn.nix.

Generate them as well if needed
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Nice! :)

@pepyakin
Copy link
Contributor Author

as with my previous PR #153 seems like prettier is already broken.

@pepyakin pepyakin merged commit d62c028 into master Nov 22, 2021
@pepyakin pepyakin deleted the pep-bootnodes branch November 22, 2021 15:16
@jasl
Copy link

jasl commented Dec 13, 2021

In my case, relaychain (rococo-local) are always working great, I mean they can find each other, but after Polkadot 0.9.12, parachain are no longer find each other, even I port this PR for parachain

PS: Chain type of parachain are Live

UPDATE: I made a bug when I left the comment, after I fixed that, it looks parachain works, so I guess we need port this PR for parachain too

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.

3 participants