pub fn run() -> sc_cli::Result<()> {
    let cli = Cli::from_args();
    std::println!("Hello, world!");

    match &cli.subcommand {
        Some(Subcommand::BuildSpec(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("BuildSpec!");
            runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
        },
        Some(Subcommand::CheckBlock(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("CheckBlock!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, import_queue, .. }
                    = new_partial(&config)?;
                Ok((cmd.run(client, import_queue), task_manager))
            })
        },
        Some(Subcommand::ExportBlocks(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("ExportBlocks!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, config.database), task_manager))
            })
        },
        Some(Subcommand::ExportState(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("ExportState!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, config.chain_spec), task_manager))
            })
        },
        Some(Subcommand::ImportBlocks(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("ImportBlocks!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, import_queue, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, import_queue), task_manager))
            })
        },
        Some(Subcommand::PurgeChain(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("PurgeChain!");
            runner.sync_run(|config| cmd.run(config.database))
        },
        Some(Subcommand::Revert(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("Revert!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, backend, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, backend), task_manager))
            })
        },
        Some(Subcommand::Benchmark(subcommand)) => {
            if cfg!(feature = "runtime-benchmarks") {
                let runner = cli.create_runner(subcommand)?;
                std::println!("Benchmark!");

                runner.sync_run(|config| subcommand.run::<Block, Executor>(config))
            } else {
                println!("Benchmarking wasn't enabled when building the node. \
                You can enable it with `--features runtime-benchmarks`.");
                Ok(())
            }
        },
        None => {
            let runner = cli.create_runner(&cli.run)?;
            std::println!("create_runner!");
            runner.run_node_until_exit(|config| async move {
                std::println!("{:?}", config);
                match config.role {
                    Role::Light => new_light(config),
                    _ => new_full(config),
                }.map_err(sc_cli::Error::Service)
            })
        }
    }
}
/// Parse and run command line arguments
Parse and run command line arguments
Parse and run command line arguments
pub fn run() -> sc_cli::Result<()> {
    let cli = Cli::from_args();
    std::println!("Hello, world!");
    match &cli.subcommand {
        Some(Subcommand::BuildSpec(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("BuildSpec!");
            runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
        },
        Some(Subcommand::CheckBlock(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("CheckBlock!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, import_queue, .. }
                    = new_partial(&config)?;
                Ok((cmd.run(client, import_queue), task_manager))
            })
        },
        Some(Subcommand::ExportBlocks(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("ExportBlocks!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, config.database), task_manager))
            })
        },
        Some(Subcommand::ExportState(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("ExportState!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, config.chain_spec), task_manager))
            })
        },
        Some(Subcommand::ImportBlocks(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("ImportBlocks!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, import_queue, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, import_queue), task_manager))
            })
        },
        Some(Subcommand::PurgeChain(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("PurgeChain!");
            runner.sync_run(|config| cmd.run(config.database))
        },
        Some(Subcommand::Revert(cmd)) => {
            let runner = cli.create_runner(cmd)?;
            std::println!("Revert!");
            runner.async_run(|config| {
                let PartialComponents { client, task_manager, backend, ..}
                    = new_partial(&config)?;
                Ok((cmd.run(client, backend), task_manager))
            })
        },
        Some(Subcommand::Benchmark(subcommand)) => {
            if cfg!(feature = "runtime-benchmarks") {
                let runner = cli.create_runner(subcommand)?;
                std::println!("Benchmark!");
                runner.sync_run(|config| subcommand.run::<Block, Executor>(config))
            } else {
                println!("Benchmarking wasn't enabled when building the node. \
                You can enable it with `--features runtime-benchmarks`.");
                Ok(())
            }
        },
        None => {
            let runner = cli.create_runner(&cli.run)?;
            std::println!("create_runner!");
            runner.run_node_until_exit(|config| async move {
                std::println!("{:?}", config);
                match config.role {
                    Role::Light => new_light(config),
                    _ => new_full(config),
                }.map_err(sc_cli::Error::Service)
            })
        }
    }
}
pub fn run ( ) -> sc_cli :: Result < ( ) > { let cli = Cli :: from_args ( ) ; std :: println ! ( " " ) ; match & cli . subcommand { Some ( Subcommand :: BuildSpec ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . sync_run ( | config | cmd . run ( config . chain_spec , config . network ) ) } , Some ( Subcommand :: CheckBlock ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . async_run ( | config | { let PartialComponents { client , task_manager , import_queue , .. } = new_partial ( & config ) ? ; Ok ( ( cmd . run ( client , import_queue ) , task_manager ) ) } ) } , Some ( Subcommand :: ExportBlocks ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . async_run ( | config | { let PartialComponents { client , task_manager , .. } = new_partial ( & config ) ? ; Ok ( ( cmd . run ( client , config . database ) , task_manager ) ) } ) } , Some ( Subcommand :: ExportState ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . async_run ( | config | { let PartialComponents { client , task_manager , .. } = new_partial ( & config ) ? ; Ok ( ( cmd . run ( client , config . chain_spec ) , task_manager ) ) } ) } , Some ( Subcommand :: ImportBlocks ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . async_run ( | config | { let PartialComponents { client , task_manager , import_queue , .. } = new_partial ( & config ) ? ; Ok ( ( cmd . run ( client , import_queue ) , task_manager ) ) } ) } , Some ( Subcommand :: PurgeChain ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . sync_run ( | config | cmd . run ( config . database ) ) } , Some ( Subcommand :: Revert ( cmd ) ) => { let runner = cli . create_runner ( cmd ) ? ; std :: println ! ( " " ) ; runner . async_run ( | config | { let PartialComponents { client , task_manager , backend , .. } = new_partial ( & config ) ? ; Ok ( ( cmd . run ( client , backend ) , task_manager ) ) } ) } , Some ( Subcommand :: Benchmark ( subcommand ) ) => { if cfg ! ( feature " " ) { let runner = cli . create_runner ( subcommand ) ? ; std :: println ! ( " " ) ; runner . sync_run ( | config | subcommand . run :: < Block , Executor > ( config ) ) } else { println ! ( " \
 " ) ; Ok ( ( ) ) } } , None => { let runner = cli . create_runner ( & cli . run ) ? ; std :: println ! ( " " ) ; runner . run_node_until_exit ( | config | async move { std :: println ! ( " " config ) ; match config . role { Role :: Light => new_light ( config ) , _ => new_full ( config ) , } . map_err ( sc_cli :: Error :: Service ) } ) } } }
Parse and run command line arguments
Parse and run command line arguments