Optional Discovery (#1280)

* Remove beacon-chain config file

* Makes discovery optional

* Remove unused dep
This commit is contained in:
Age Manning
2020-06-23 13:45:40 +10:00
committed by GitHub
parent ea76faeeee
commit da6ab85e99
5 changed files with 101 additions and 60 deletions

View File

@@ -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")

View File

@@ -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
*/