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

cmd, p2p, trie: load p2p data from genesis #369

Merged
merged 9 commits into from
Nov 5, 2019
Merged

Conversation

noot
Copy link
Contributor

@noot noot commented Nov 1, 2019

Changes

  • added ProtocolId to p2p config, set it in p2p.NewService
  • changed the previous global ProtocolPrefix to DefaultProtocolId which is used if the protocol ID in the config is empty
  • added updating of the p2p config in makeNode to use the p2p info that was loaded from genesis
  • changed bootnodes field in trie genesis struct to be [][]byte since []string wasn't working (will open an issue about this)

Tests:

go test ./cmd/... ./p2p/...

Issues:

closes #228

Copy link
Member

@ansermino ansermino left a comment

Choose a reason for hiding this comment

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

There's no need to update the config in the config package. You can just pass the genesis data into createP2PService and use it to construct the config in p2p. The configs in config match one-to-one with the toml config which is broken by this PR

common/common.go Show resolved Hide resolved
cmd/gossamer/configcmd.go Outdated Show resolved Hide resolved
polkadb/dbService.go Outdated Show resolved Hide resolved
@noot
Copy link
Contributor Author

noot commented Nov 4, 2019

@ansermino I have returned the config package to its former state and updated createP2pService to directly use the genesis data

@noot noot requested a review from ansermino November 5, 2019 15:54
@noot noot merged commit baa3bb8 into development Nov 5, 2019
@noot noot deleted the noot/genesis-p2p branch November 5, 2019 20:37
ryanchristo pushed a commit that referenced this pull request Jun 24, 2020
* added ProtocolId to p2p config, set it in p2p.NewService
* changed the previous global ProtocolPrefix to DefaultProtocolId which is used if the protocol ID in the config is empty
* added updating of the p2p config in makeNode to use the p2p info that was loaded from genesis
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.

load p2p protocolPrefix, bootNodes from genesis
4 participants