MCPcopy Create free account
hub / github.com/DataHighway-DHX/node / new_partial

Function new_partial

node/src/service.rs:62–181  ·  view source on GitHub ↗
(
    config: &Configuration,
)

Source from the content-addressed store, hash-verified

60type LightClient = sc_service::TLightClient<Block, RuntimeApi, Executor>;
61
62pub fn new_partial(
63 config: &Configuration,
64) -> Result<
65 sc_service::PartialComponents<
66 FullClient,
67 FullBackend,
68 FullSelectChain,
69 sp_consensus::DefaultImportQueue<Block, FullClient>,
70 sc_transaction_pool::FullPool<Block, FullClient>,
71 (
72 impl Fn(datahighway_rpc::DenyUnsafe, sc_rpc::SubscriptionTaskExecutor) -> datahighway_rpc::IoHandler,
73 (
74 sc_consensus_babe::BabeBlockImport<Block, FullClient, FullGrandpaBlockImport>,
75 sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
76 sc_consensus_babe::BabeLink<Block>,
77 ),
78 sc_finality_grandpa::SharedVoterState,
79 ),
80 >,
81 ServiceError,
82> {
83 let (client, backend, keystore_container, task_manager) =
84 sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
85 let client = Arc::new(client);
86
87 let select_chain = sc_consensus::LongestChain::new(backend.clone());
88
89 let transaction_pool = sc_transaction_pool::BasicPool::new_full(
90 config.transaction_pool.clone(),
91 config.role.is_authority().into(),
92 config.prometheus_registry(),
93 task_manager.spawn_handle(),
94 client.clone(),
95 );
96
97 let (grandpa_block_import, grandpa_link) =
98 sc_finality_grandpa::block_import(client.clone(), &(client.clone() as Arc<_>), select_chain.clone())?;
99 let justification_import = grandpa_block_import.clone();
100
101 let (block_import, babe_link) = sc_consensus_babe::block_import(
102 sc_consensus_babe::Config::get_or_compute(&*client)?,
103 grandpa_block_import,
104 client.clone(),
105 )?;
106
107 let inherent_data_providers = sp_inherents::InherentDataProviders::new();
108
109 let import_queue = sc_consensus_babe::import_queue(
110 babe_link.clone(),
111 block_import.clone(),
112 Some(Box::new(justification_import)),
113 client.clone(),
114 select_chain.clone(),
115 inherent_data_providers.clone(),
116 &task_manager.spawn_handle(),
117 config.prometheus_registry(),
118 sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
119 )?;

Callers 2

runFunction · 0.85
new_full_baseFunction · 0.85

Calls 2

new_fullFunction · 0.85
create_fullFunction · 0.85

Tested by

no test coverage detected