pub fn run(self) -> Result<(), failure::Error> {
        let command = Command::from_args();

        if let StandardResult::Run(run_config) = command.execute()? {
            // Add builtin services to genesis config.
            let supervisor = Self::supervisor_service(&run_config);
            let genesis_config = GenesisConfigBuilder::with_consensus_config(
                run_config.node_config.public_config.consensus.clone(),
            )
            .with_artifact(Supervisor.artifact_id())
            .with_instance(supervisor)
            .with_artifact(ExplorerFactory.artifact_id())
            .with_instance(ExplorerFactory.default_instance())
            .build();

            let db_options = &run_config.node_config.private_config.database;
            let database = RocksDB::open(run_config.db_path, db_options)?;

            let node_config_path = run_config.node_config_path.to_string_lossy().to_string();
            let config_manager = DefaultConfigManager::new(node_config_path);
            let rust_runtime = self.rust_runtime;

            let mut node_builder =
                CoreNodeBuilder::new(database, run_config.node_config.into(), genesis_config)
                    .with_config_manager(config_manager)
                    .with_plugin(SystemApiPlugin)
                    .with_runtime_fn(|channel| rust_runtime.build(channel.endpoints_sender()));
            for runtime in self.external_runtimes {
                node_builder = node_builder.with_runtime(runtime);
            }
            node_builder.build().run()
        } else {
            Ok(())
        }
    }
/// Configures the node using parameters provided by user from stdin and then runs it.
///
/// Only Rust runtime is enabled.
Configures the node using parameters provided by user from stdin and then runs it.
Only Rust runtime is enabled.
Configures the node using parameters provided by user from stdin and then runs it . Only Rust runtime is enabled .
pub fn run(self) -> Result<(), failure::Error> {
        let command = Command::from_args();
        if let StandardResult::Run(run_config) = command.execute()? {
            // Add builtin services to genesis config.
            let supervisor = Self::supervisor_service(&run_config);
            let genesis_config = GenesisConfigBuilder::with_consensus_config(
                run_config.node_config.public_config.consensus.clone(),
            )
            .with_artifact(Supervisor.artifact_id())
            .with_instance(supervisor)
            .with_artifact(ExplorerFactory.artifact_id())
            .with_instance(ExplorerFactory.default_instance())
            .build();
            let db_options = &run_config.node_config.private_config.database;
            let database = RocksDB::open(run_config.db_path, db_options)?;
            let node_config_path = run_config.node_config_path.to_string_lossy().to_string();
            let config_manager = DefaultConfigManager::new(node_config_path);
            let rust_runtime = self.rust_runtime;
            let mut node_builder =
                CoreNodeBuilder::new(database, run_config.node_config.into(), genesis_config)
                    .with_config_manager(config_manager)
                    .with_plugin(SystemApiPlugin)
                    .with_runtime_fn(|channel| rust_runtime.build(channel.endpoints_sender()));
            for runtime in self.external_runtimes {
                node_builder = node_builder.with_runtime(runtime);
            }
            node_builder.build().run()
        } else {
            Ok(())
        }
    }
pub fn run ( self ) -> Result < ( ) , failure :: Error > { let command = Command :: from_args ( ) ; if let StandardResult :: Run ( run_config ) = command . execute ( ) ? { // Add builtin services to genesis config. let supervisor = Self :: supervisor_service ( & run_config ) ; let genesis_config = GenesisConfigBuilder :: with_consensus_config ( run_config . node_config . public_config . consensus . clone ( ) , ) . with_artifact ( Supervisor . artifact_id ( ) ) . with_instance ( supervisor ) . with_artifact ( ExplorerFactory . artifact_id ( ) ) . with_instance ( ExplorerFactory . default_instance ( ) ) . build ( ) ; let db_options = & run_config . node_config . private_config . database ; let database = RocksDB :: open ( run_config . db_path , db_options ) ? ; let node_config_path = run_config . node_config_path . to_string_lossy ( ) . to_string ( ) ; let config_manager = DefaultConfigManager :: new ( node_config_path ) ; let rust_runtime = self . rust_runtime ; let mut node_builder = CoreNodeBuilder :: new ( database , run_config . node_config . into ( ) , genesis_config ) . with_config_manager ( config_manager ) . with_plugin ( SystemApiPlugin ) . with_runtime_fn ( | channel | rust_runtime . build ( channel . endpoints_sender ( ) ) ) ; for runtime in self . external_runtimes { node_builder = node_builder . with_runtime ( runtime ) ; } node_builder . build ( ) . run ( ) } else { Ok ( ( ) ) } }
Configures the node using parameters provided by user from stdin and then runs it.
Configures the node using parameters provided by user from stdin and then runs it .
self
self