Correct listening addresses and associated log
This commit is contained in:
parent
7b6a653d05
commit
2871ad5055
@ -5,6 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
types = { path = "../eth2/types" }
|
||||
client = { path = "client" }
|
||||
version = { path = "version" }
|
||||
clap = "2.32.0"
|
||||
|
@ -7,6 +7,7 @@ use std::fs;
|
||||
use std::net::IpAddr;
|
||||
use std::net::SocketAddr;
|
||||
use std::path::PathBuf;
|
||||
use types::multiaddr::Protocol;
|
||||
use types::multiaddr::ToMultiaddr;
|
||||
use types::ChainSpec;
|
||||
|
||||
@ -62,6 +63,11 @@ impl ClientConfig {
|
||||
if let Some(port_str) = args.value_of("port") {
|
||||
if let Ok(port) = port_str.parse::<u16>() {
|
||||
config.net_conf.listen_port = port;
|
||||
// update the listening multiaddrs
|
||||
for address in &mut config.net_conf.listen_addresses {
|
||||
address.pop();
|
||||
address.append(Protocol::Tcp(port));
|
||||
}
|
||||
} else {
|
||||
error!(log, "Invalid port"; "port" => port_str);
|
||||
return Err("Invalid port");
|
||||
|
@ -14,7 +14,7 @@ pub fn run_beacon_node(config: ClientConfig, log: slog::Logger) -> error::Result
|
||||
.map_err(|e| format!("{:?}", e))?;
|
||||
|
||||
// Log configuration
|
||||
info!(log, "";
|
||||
info!(log, "Listening on {:?}", &config.net_conf.listen_addresses;
|
||||
"data_dir" => &config.data_dir.to_str(),
|
||||
"port" => &config.net_conf.listen_port);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user