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

[Merged by Bors] - reuse beacon_node methods for initializing network configs in boot_node #1520

Closed

Conversation

blacktemplar
Copy link
Contributor

Issue Addressed

#1378

Proposed Changes

Boot node reuses code from beacon_node to initialize network config. This also enables using the network directory to store/load the enr and the private key.

Additional Info

Note that before this PR the port cli arguments were off (the argument was named enr-port but used as boot-node-enr-port).
Therefore as port always the cli port argument was used (for both enr and listening). Now the enr-port argument can be used to overwrite the listening port as the public port others should connect to.

Last but not least note, that this restructuring reuses ethlibp2p::NetworkConfig that has many more options than the ones used in the boot node. For example the network config has an own discv5_config field that gets never used in the boot node and instead another Discv5Config gets created later in the boot node process.

Copy link
Member

@AgeManning AgeManning left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Handy to make some of these internals more modular and public.

@AgeManning AgeManning added the ready-for-merge This PR is ready to merge. label Aug 21, 2020
@AgeManning
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 21, 2020
…de (#1520)

## Issue Addressed

#1378

## Proposed Changes

Boot node reuses code from beacon_node to initialize network config. This also enables using the network directory to store/load the enr and the private key.

## Additional Info

Note that before this PR the port cli arguments were off (the argument was named `enr-port` but used as `boot-node-enr-port`).
Therefore as port always the cli port argument was used (for both enr and listening). Now the enr-port argument can be used to overwrite the listening port as the public port others should connect to.

Last but not least note, that this restructuring reuses `ethlibp2p::NetworkConfig` that has many more options than the ones used in the boot node. For example the network config has an own `discv5_config` field that gets never used in the boot node and instead another `Discv5Config` gets created later in the boot node process.

Co-authored-by: Age Manning <Age@AgeManning.com>
@bors bors bot changed the title reuse beacon_node methods for initializing network configs in boot_node [Merged by Bors] - reuse beacon_node methods for initializing network configs in boot_node Aug 21, 2020
@bors bors bot closed this Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants