Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aurexav committed May 22, 2023
1 parent bee6fcd commit 6ac22ff
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions node/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,28 +314,32 @@ where
hwbench.clone(),
)
.await
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;

let block_announce_validator =
cumulus_client_network::BlockAnnounceValidator::new(relay_chain_interface.clone(), para_id);
.map_err(|e| match e {
cumulus_relay_chain_interface::RelayChainError::ServiceError(
polkadot_service::Error::Sub(x),
) => x,
s => s.to_string().into(),
})?;

let force_authoring = parachain_config.force_authoring;
let validator = parachain_config.role.is_authority();
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let import_queue_service = import_queue.service();

let (network, system_rpc_tx, tx_handler_controller, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
sc_service::build_network(cumulus_client_service::BuildNetworkParams {
parachain_config: &parachain_config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
para_id,
spawn_handle: task_manager.spawn_handle(),
relay_chain_interface: relay_chain_interface.clone(),
import_queue,
block_announce_validator_builder: Some(Box::new(|_| {
Box::new(block_announce_validator)
})),
warp_sync: None,
})?;
})
.await?;

if parachain_config.offchain_worker.enabled {
sc_service::build_offchain_workers(
Expand Down Expand Up @@ -710,15 +714,16 @@ where
} = new_partial::<RuntimeApi, Executor>(&config, eth_rpc_config)?;

let (network, system_rpc_tx, tx_handler_controller, start_network) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
sc_service::build_network(cumulus_client_service::BuildNetworkParams {
parachain_config: &config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
para_id,
spawn_handle: task_manager.spawn_handle(),
relay_chain_interface: relay_chain_interface.clone(),
import_queue,
block_announce_validator_builder: None,
warp_sync: None,
})?;
})
.await?;

if config.offchain_worker.enabled {
let offchain_workers = Arc::new(sc_offchain::OffchainWorkers::new_with_options(
Expand Down

0 comments on commit 6ac22ff

Please sign in to comment.