File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -140,9 +140,7 @@ pub fn run() -> sc_cli::Result<()> {
140
140
None => {
141
141
let runner = cli. create_runner ( & cli. run ) ?;
142
142
runner. run_node_until_exit ( |config| async move {
143
- service:: new_full :: < sc_network:: NetworkWorker < _ , _ > > ( config)
144
- . await
145
- . map_err ( sc_cli:: Error :: Service )
143
+ service:: new_full ( config) . await . map_err ( sc_cli:: Error :: Service )
146
144
} )
147
145
} ,
148
146
}
Original file line number Diff line number Diff line change 3
3
use crate :: data_sources:: DataSources ;
4
4
use crate :: inherent_data:: { CreateInherentDataConfig , ProposalCIDP , VerifierCIDP } ;
5
5
use crate :: rpc:: GrandpaDeps ;
6
+ use futures:: TryFutureExt ;
6
7
use partner_chains_db_sync_data_sources:: McFollowerMetrics ;
7
8
use partner_chains_db_sync_data_sources:: register_metrics_warn_errors;
8
9
use partner_chains_demo_runtime:: { self , RuntimeApi , opaque:: Block } ;
@@ -161,7 +162,20 @@ pub fn new_partial(
161
162
} )
162
163
}
163
164
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 > > (
165
179
config : Configuration ,
166
180
) -> Result < TaskManager , ServiceError > {
167
181
if let Some ( git_hash) = std:: option_env!( "EARTHLY_GIT_HASH" ) {
You can’t perform that action at this time.
0 commit comments