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

Bootnode to use the network directory #1378

Closed
AgeManning opened this issue Jul 22, 2020 · 0 comments
Closed

Bootnode to use the network directory #1378

AgeManning opened this issue Jul 22, 2020 · 0 comments

Comments

@AgeManning
Copy link
Member

Description

Lighthouse has a global datadir cli param. The beacon node uses this and creates a DATA_DIR/network directory and stores the identity key as well as the local ENR.

A new subcommand for lighthouse boot-node creates a discovery server but generates a new network identity and ENR each run. This is not conducive to spinning up testnets. We would like it also to read from the DATA_DIR/network directory and use the ENR and local identity key.

It may be an interesting exercise to see how the beacon_node does logic and duplicate it in the boot_node subcommand. I imagine we can borrow some of the functions used in the beacon_node for the boot node.

bors bot pushed a commit that referenced this issue 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 <[email protected]>
@ghost ghost added Networking A0 labels Sep 9, 2020
@ghost ghost closed this as completed Sep 9, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant