Various small improvements to service construction. (#6738)

* Remove service components and add build_network, build_offchain_workers etc

* Improve transaction pool api

* Remove commented out line

* Add PartialComponents

* Add BuildNetworkParams, documentation

* Remove unused imports in tests

* Apply suggestions from code review

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>

* Remove unused imports in node-bench

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
Ashley
2020-07-28 15:21:33 +02:00
committed by GitHub
parent 97f400f0f0
commit 9220b646d2
17 changed files with 401 additions and 326 deletions
+4 -4
View File
@@ -20,8 +20,8 @@ use crate::{chain_spec, service, Cli, Subcommand};
use node_executor::Executor;
use node_runtime::{Block, RuntimeApi};
use sc_cli::{Result, SubstrateCli, RuntimeVersion, Role, ChainSpec};
use sc_service::ServiceParams;
use crate::service::new_full_params;
use sc_service::PartialComponents;
use crate::service::new_partial;
impl SubstrateCli for Cli {
fn impl_name() -> String {
@@ -96,8 +96,8 @@ pub fn run() -> Result<()> {
Some(Subcommand::Base(subcommand)) => {
let runner = cli.create_runner(subcommand)?;
runner.run_subcommand(subcommand, |config| {
let (ServiceParams { client, backend, import_queue, task_manager, .. }, ..)
= new_full_params(config)?;
let PartialComponents { client, backend, task_manager, import_queue, ..}
= new_partial(&config)?;
Ok((client, backend, import_queue, task_manager))
})
}