Unverified Commit 3487a93c authored by Pierre Krieger's avatar Pierre Krieger Committed by GitHub
Browse files

Companion PR to delaying network startup to after initialization (#1547)

parent 9c04ebb5
Pipeline #103173 failed with stages
in 9 minutes and 16 seconds
......@@ -335,7 +335,7 @@ fn new_full<RuntimeApi, Executor>(
let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
let (network, network_status_sinks, system_rpc_tx) =
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
client: client.clone(),
......@@ -512,6 +512,8 @@ fn new_full<RuntimeApi, Executor>(
)?;
}
network_starter.start_network();
Ok((task_manager, client))
}
......@@ -574,7 +576,7 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<TaskManager
let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
let (network, network_status_sinks, system_rpc_tx) =
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
client: client.clone(),
......@@ -612,6 +614,8 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<TaskManager
system_rpc_tx,
})?;
network_starter.start_network();
Ok(task_manager)
}
......
......@@ -294,7 +294,7 @@ pub fn new_full<RuntimeApi, Executor>(
let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
let (network, network_status_sinks, system_rpc_tx) =
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
client: client.clone(),
......@@ -555,6 +555,8 @@ pub fn new_full<RuntimeApi, Executor>(
)?;
}
network_starter.start_network();
handles.polkadot_network = Some(polkadot_network_service);
Ok((task_manager, client, handles, network, rpc_handlers))
}
......@@ -620,7 +622,7 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(TaskManage
let finality_proof_provider =
GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
let (network, network_status_sinks, system_rpc_tx) =
let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
client: client.clone(),
......@@ -658,6 +660,8 @@ fn new_light<Runtime, Dispatch>(mut config: Configuration) -> Result<(TaskManage
system_rpc_tx,
})?;
network_starter.start_network();
Ok((task_manager, rpc_handlers))
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment