(spec_factory),
+ ParseAndPrepare::CustomCommand(cmd) => return Ok(Some(cmd))
+ }?;
+
+ Ok(None)
+}
+
/// Create a `NodeKeyConfig` from the given `NodeKeyParams` in the context
/// of an optional network config storage directory.
fn node_key_config(params: NodeKeyParams, net_config_dir: &Option
)
@@ -292,8 +556,8 @@ fn parse_ed25519_secret(hex: &String) -> error::Result(
- options: &mut FactoryFullConfiguration,
+fn fill_transaction_pool_configuration(
+ options: &mut Configuration,
params: TransactionPoolParams,
) -> error::Result<()> {
// ready queue
@@ -366,18 +630,36 @@ fn input_keystore_password() -> Result {
.map_err(|e| format!("{:?}", e))
}
-fn create_run_node_config(
+/// Fill the password field of the given config instance.
+fn fill_config_keystore_password(
+ config: &mut service::Configuration,
+ cli: &RunCmd,
+) -> Result<(), String> {
+ config.keystore_password = if cli.password_interactive {
+ Some(input_keystore_password()?.into())
+ } else if let Some(ref file) = cli.password_filename {
+ Some(fs::read_to_string(file).map_err(|e| format!("{}", e))?.into())
+ } else if let Some(ref password) = cli.password {
+ Some(password.clone().into())
+ } else {
+ None
+ };
+
+ Ok(())
+}
+
+fn create_run_node_config(
cli: RunCmd, spec_factory: S, impl_name: &'static str, version: &VersionInfo
-) -> error::Result>
+) -> error::Result>
where
- F: ServiceFactory,
- S: FnOnce(&str) -> Result