node: increase default amount of peers

This commit is contained in:
ardocrat 2024-05-15 15:05:42 +03:00
parent 45f01a7ff3
commit 4324acb0f7

View file

@ -181,8 +181,14 @@ impl NodeConfig {
let mut default_config = GlobalConfig::for_chain(chain_type); let mut default_config = GlobalConfig::for_chain(chain_type);
default_config.update_paths(&Settings::get_base_path(sub_dir)); default_config.update_paths(&Settings::get_base_path(sub_dir));
let mut config = default_config.members.unwrap(); let mut config = default_config.members.unwrap();
// Generate random p2p and api ports.
Self::setup_default_ports(&mut config); Self::setup_default_ports(&mut config);
// Increase default amount of peers.
config.server.p2p_config.peer_max_outbound_count = Some(24);
config.server.p2p_config.peer_min_preferred_outbound_count = Some(18);
Settings::write_to_file(&config, path); Settings::write_to_file(&config, path);
config config
} }