mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
Optional Discovery (#1280)
* Remove beacon-chain config file * Makes discovery optional * Remove unused dep
This commit is contained in:
@@ -61,7 +61,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("max_peers")
|
||||
Arg::with_name("max-peers")
|
||||
.long("max-peers")
|
||||
.help("The maximum number of peers.")
|
||||
.default_value("50")
|
||||
@@ -125,6 +125,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
without an ENR.")
|
||||
.takes_value(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("disable-discovery")
|
||||
.long("disable-discovery")
|
||||
.help("Disables the discv5 discovery protocol. The node will not search for new peers or participate in the discovery protocol.")
|
||||
.takes_value(false),
|
||||
)
|
||||
|
||||
/* REST API related arguments */
|
||||
.arg(
|
||||
Arg::with_name("http")
|
||||
|
||||
@@ -195,6 +195,11 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.network.discv5_config.enr_update = false;
|
||||
}
|
||||
|
||||
if cli_args.is_present("disable-discovery") {
|
||||
client_config.network.disable_discovery = true;
|
||||
slog::warn!(log, "Discovery is disabled. New peers will not be found");
|
||||
}
|
||||
|
||||
/*
|
||||
* Http server
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user