File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ pub fn run() -> sc_cli::Result<()> {
140140 None => {
141141 let runner = cli. create_runner ( & cli. run ) ?;
142142 runner. run_node_until_exit ( |config| async move {
143- service:: new_full :: < sc_network :: NetworkWorker < _ , _ > > ( config)
143+ service:: new_full ( config)
144144 . await
145145 . map_err ( sc_cli:: Error :: Service )
146146 } )
Original file line number Diff line number Diff line change 33use crate :: data_sources:: DataSources ;
44use crate :: inherent_data:: { CreateInherentDataConfig , ProposalCIDP , VerifierCIDP } ;
55use crate :: rpc:: GrandpaDeps ;
6+ use futures:: TryFutureExt ;
67use partner_chains_db_sync_data_sources:: McFollowerMetrics ;
78use partner_chains_db_sync_data_sources:: register_metrics_warn_errors;
89use partner_chains_demo_runtime:: { self , RuntimeApi , opaque:: Block } ;
@@ -161,7 +162,20 @@ pub fn new_partial(
161162 } )
162163}
163164
164- pub async fn new_full < Network : sc_network:: NetworkBackend < Block , <Block as BlockT >:: Hash > > (
165+ pub async fn new_full ( config : Configuration ) -> Result < TaskManager , ServiceError > {
166+ let task_manager = match config. network . network_backend {
167+ sc_network:: config:: NetworkBackendType :: Libp2p => {
168+ new_full_base :: < sc_network:: NetworkWorker < _ , _ > > ( config) . await ?
169+ } ,
170+ sc_network:: config:: NetworkBackendType :: Litep2p => {
171+ new_full_base :: < sc_network:: Litep2pNetworkBackend > ( config) . await ?
172+ } ,
173+ } ;
174+
175+ Ok ( task_manager)
176+ }
177+
178+ pub async fn new_full_base < Network : sc_network:: NetworkBackend < Block , <Block as BlockT >:: Hash > > (
165179 config : Configuration ,
166180) -> Result < TaskManager , ServiceError > {
167181 if let Some ( git_hash) = std:: option_env!( "EARTHLY_GIT_HASH" ) {
You can’t perform that action at this time.
0 commit comments