mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Add a flag to disable peer scoring (#4135)
## Issue Addressed N/A ## Proposed Changes Adds a flag for disabling peer scoring. This is useful for local testing and testing small networks for new features.
This commit is contained in:
@@ -233,6 +233,14 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
.help("Disables the discv5 discovery protocol. The node will not search for new peers or participate in the discovery protocol.")
|
||||
.takes_value(false),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("disable-peer-scoring")
|
||||
.long("disable-peer-scoring")
|
||||
.help("Disables peer scoring in lighthouse. WARNING: This is a dev only flag is only meant to be used in local testing scenarios \
|
||||
Using this flag on a real network may cause your node to become eclipsed and see a different view of the network")
|
||||
.takes_value(false)
|
||||
.hidden(true),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("trusted-peers")
|
||||
.long("trusted-peers")
|
||||
|
||||
@@ -1008,6 +1008,10 @@ pub fn set_network_config(
|
||||
.collect::<Result<Vec<Multiaddr>, _>>()?;
|
||||
}
|
||||
|
||||
if cli_args.is_present("disable-peer-scoring") {
|
||||
config.disable_peer_scoring = true;
|
||||
}
|
||||
|
||||
if let Some(trusted_peers_str) = cli_args.value_of("trusted-peers") {
|
||||
config.trusted_peers = trusted_peers_str
|
||||
.split(',')
|
||||
|
||||
Reference in New Issue
Block a user