Skip to content
Snippets Groups Projects
Commit 0adc255d authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

wip tweaks before giving up

parent 35585c69
No related tags found
No related merge requests found
Pipeline #38384 waiting for manual action
...@@ -56,7 +56,7 @@ pub fn set_config( ...@@ -56,7 +56,7 @@ pub fn set_config(
// copied from grandpa config // copied from grandpa config
// /substrate/client/consensus/grandpa/src/lib.rs:212 // /substrate/client/consensus/grandpa/src/lib.rs:212
struct EndpointGossipConfig { pub struct EndpointGossipConfig {
/// The expected duration for a message to be gossiped across the network. /// The expected duration for a message to be gossiped across the network.
gossip_duration: std::time::Duration, gossip_duration: std::time::Duration,
/// Period (in blocks) to share endpoints again /// Period (in blocks) to share endpoints again
...@@ -67,14 +67,14 @@ struct EndpointGossipConfig { ...@@ -67,14 +67,14 @@ struct EndpointGossipConfig {
protocol_name: ProtocolName, protocol_name: ProtocolName,
} }
struct EndpointGossipParams<Network> { pub struct EndpointGossipParams<Network> {
config: EndpointGossipConfig, config: EndpointGossipConfig,
network: Network, network: Network,
notification_service: Box<dyn NotificationService>, notification_service: Box<dyn NotificationService>,
offchain_endpoint_tester: (), offchain_endpoint_tester: (),
} }
fn run_gossip_worker<Network>(params: EndpointGossipParams<Network>) { pub fn run_gossip_worker<Network>(params: EndpointGossipParams<Network>) {
let topic = "XXX"; let topic = "XXX";
// TODO network has no gossip engine, it is created in network bridge // TODO network has no gossip engine, it is created in network bridge
......
...@@ -150,6 +150,7 @@ pub fn new_partial<RuntimeApi, Executor>( ...@@ -150,6 +150,7 @@ pub fn new_partial<RuntimeApi, Executor>(
consensus_manual: bool, consensus_manual: bool,
duniter_config: crate::cli::DuniterConfigExtension, duniter_config: crate::cli::DuniterConfigExtension,
) -> Result< ) -> Result<
(
sc_service::PartialComponents< sc_service::PartialComponents<
FullClient<RuntimeApi, Executor>, FullClient<RuntimeApi, Executor>,
FullBackend, FullBackend,
...@@ -172,6 +173,8 @@ pub fn new_partial<RuntimeApi, Executor>( ...@@ -172,6 +173,8 @@ pub fn new_partial<RuntimeApi, Executor>(
Option<Telemetry>, Option<Telemetry>,
), ),
>, >,
crate::cli::DuniterConfigExtension,
),
ServiceError, ServiceError,
> >
where where
...@@ -279,7 +282,8 @@ where ...@@ -279,7 +282,8 @@ where
(queue, Some(handle)) (queue, Some(handle))
}; };
Ok(sc_service::PartialComponents { Ok((
sc_service::PartialComponents {
client, client,
backend, backend,
task_manager, task_manager,
...@@ -294,7 +298,9 @@ where ...@@ -294,7 +298,9 @@ where
grandpa_link, grandpa_link,
telemetry, telemetry,
), ),
}) },
duniter_config,
))
} }
/// Builds a new service for a full client. /// Builds a new service for a full client.
...@@ -316,7 +322,8 @@ where ...@@ -316,7 +322,8 @@ where
Executor: sc_executor::NativeExecutionDispatch + 'static, Executor: sc_executor::NativeExecutionDispatch + 'static,
Executor: sc_executor::sp_wasm_interface::HostFunctions + 'static, Executor: sc_executor::sp_wasm_interface::HostFunctions + 'static,
{ {
let sc_service::PartialComponents { let (
sc_service::PartialComponents {
client, client,
backend, backend,
mut task_manager, mut task_manager,
...@@ -325,7 +332,9 @@ where ...@@ -325,7 +332,9 @@ where
select_chain, select_chain,
transaction_pool, transaction_pool,
other: (block_import, babe_link, babe_worker_handle, grandpa_link, mut telemetry), other: (block_import, babe_link, babe_worker_handle, grandpa_link, mut telemetry),
} = new_partial::<RuntimeApi, Executor>( },
duniter_options,
) = new_partial::<RuntimeApi, Executor>(
&config, &config,
sealing.is_manual_consensus(), sealing.is_manual_consensus(),
duniter_options, duniter_options,
...@@ -714,7 +723,7 @@ where ...@@ -714,7 +723,7 @@ where
task_manager.spawn_handle().spawn( task_manager.spawn_handle().spawn(
"endpoint-gossip", "endpoint-gossip",
None, None,
crate::endpoint_gossip::run_gossip_worker(endpoint_gossip_params)?, crate::endpoint_gossip::run_gossip_worker(endpoint_gossip_params),
); );
// } // }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment