Expose keyring accounts in CLI (#2032)

* Expose keyring accounts in CLI

So, `--alice` will give you a node with `--key //Alice --name Alice`.

* Update readme
This commit is contained in:
Bastian Köcher
2019-03-18 18:15:18 +01:00
committed by Gav Wood
parent b513326ea7
commit 530c12b4dc
7 changed files with 146 additions and 52 deletions
+5 -1
View File
@@ -317,7 +317,7 @@ where
config.impl_commit = version.commit;
config.impl_version = version.version;
config.name = match cli.name {
config.name = match cli.name.or(cli.keyring.account.map(|a| a.to_string())) {
None => generate_node_name(),
Some(name) => name,
};
@@ -390,6 +390,10 @@ where
config.keys.push("//Alice".into());
}
if let Some(account) = cli.keyring.account {
config.keys.push(format!("//{}", account));
}
let rpc_interface: &str = if cli.rpc_external { "0.0.0.0" } else { "127.0.0.1" };
let ws_interface: &str = if cli.ws_external { "0.0.0.0" } else { "127.0.0.1" };