pub fn run<I, T, E>(args: I, exit: E, version: cli::VersionInfo) -> error::Result<()> where
	I: IntoIterator<Item = T>,
	T: Into<std::ffi::OsString> + Clone,
	E: IntoExit,
{
	cli::parse_and_execute::<service::Factory, NoCustom, NoCustom, _, _, _, _, _>(
		load_spec, &version, "substrate-node", args, exit,
		|exit, _custom_args, config| {
			info!("{}", version.name);
			info!("  version {}", config.full_version());
			info!("  by Parity Technologies, 2017-2019");
			info!("Chain specification: {}", config.chain_spec.name());
			info!("Node name: {}", config.name);
			info!("Roles: {:?}", config.roles);
			let runtime = RuntimeBuilder::new().name_prefix("main-tokio-").build()
				.map_err(|e| format!("{:?}", e))?;
			let executor = runtime.executor();
			match config.roles {
				ServiceRoles::LIGHT => run_until_exit(
					runtime,
					service::Factory::new_light(config, executor).map_err(|e| format!("{:?}", e))?,
					exit
				),
				_ => run_until_exit(
					runtime,
					service::Factory::new_full(config, executor).map_err(|e| format!("{:?}", e))?,
					exit
				),
			}.map_err(|e| format!("{:?}", e))
		}
	).map_err(Into::into).map(|_| ())
}
/// Parse command line arguments into service configuration.
Parse command line arguments into service configuration.
Parse command line arguments into service configuration .
pub fn run<I, T, E>(args: I, exit: E, version: cli::VersionInfo) -> error::Result<()> where
	I: IntoIterator<Item = T>,
	T: Into<std::ffi::OsString> + Clone,
	E: IntoExit,
{
	cli::parse_and_execute::<service::Factory, NoCustom, NoCustom, _, _, _, _, _>(
		load_spec, &version, "substrate-node", args, exit,
		|exit, _custom_args, config| {
			info!("{}", version.name);
			info!("  version {}", config.full_version());
			info!("  by Parity Technologies, 2017-2019");
			info!("Chain specification: {}", config.chain_spec.name());
			info!("Node name: {}", config.name);
			info!("Roles: {:?}", config.roles);
			let runtime = RuntimeBuilder::new().name_prefix("main-tokio-").build()
				.map_err(|e| format!("{:?}", e))?;
			let executor = runtime.executor();
			match config.roles {
				ServiceRoles::LIGHT => run_until_exit(
					runtime,
					service::Factory::new_light(config, executor).map_err(|e| format!("{:?}", e))?,
					exit
				),
				_ => run_until_exit(
					runtime,
					service::Factory::new_full(config, executor).map_err(|e| format!("{:?}", e))?,
					exit
				),
			}.map_err(|e| format!("{:?}", e))
		}
	).map_err(Into::into).map(|_| ())
}
pub fn run < I , T , E > ( args : I , exit : E , version : cli :: VersionInfo ) -> error :: Result < ( ) > where I : IntoIterator < Item = T > , T : Into < std :: ffi :: OsString > + Clone , E : IntoExit , { cli :: parse_and_execute :: < service :: Factory , NoCustom , NoCustom , _ , _ , _ , _ , _ > ( load_spec , & version , " " , args , exit , | exit , _custom_args , config | { info ! ( " " version name ) ; info ! ( " " config full_version ( ) ) ; info ! ( " " ) ; info ! ( " " config chain_spec name ( ) ) ; info ! ( " " config name ) ; info ! ( " " config roles ) ; let runtime = RuntimeBuilder :: new ( ) . name_prefix ( " " ) . build ( ) . map_err ( | e | format ! ( " " e ) ) ? ; let executor = runtime . executor ( ) ; match config . roles { ServiceRoles :: LIGHT => run_until_exit ( runtime , service :: Factory :: new_light ( config , executor ) . map_err ( | e | format ! ( " " e ) ) ? , exit ) , _ => run_until_exit ( runtime , service :: Factory :: new_full ( config , executor ) . map_err ( | e | format ! ( " " e ) ) ? , exit ) , } . map_err ( | e | format ! ( " " e ) ) } ) . map_err ( Into :: into ) . map ( | _ | ( ) ) }
Parse command line arguments into service configuration.
Parse command line arguments into service configuration .
args
I
exit
E
version
cli::VersionInfo
args
I
exit
E
version
cli::VersionInfo