Store identification info about the remote (#1500)

* Store identification info about the remote

* Add node name on the wire

* Fix tests
This commit is contained in:
Pierre Krieger
2019-01-21 14:33:25 +01:00
committed by Gav Wood
parent 010e63116f
commit f67c2cc181
5 changed files with 142 additions and 34 deletions
+2 -1
View File
@@ -135,7 +135,7 @@ fn load_spec<F, G>(matches: &clap::ArgMatches, factory: F) -> Result<ChainSpec<G
fn base_path(matches: &clap::ArgMatches, version: &VersionInfo) -> PathBuf {
matches.value_of("base_path")
.map(|x| Path::new(x).to_owned())
.unwrap_or_else(||
.unwrap_or_else(||
app_dirs::get_app_root(
AppDataType::UserData,
&AppInfo {
@@ -305,6 +305,7 @@ where
config.network.public_addresses = Vec::new();
config.network.client_version = config.client_id();
config.network.node_name = config.name.clone();
config.network.use_secret = match matches.value_of("node_key").map(H256::from_str) {
Some(Ok(secret)) => Some(secret.into()),
Some(Err(err)) => bail!(create_input_err(format!("Error parsing node key: {}", err))),