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 branches found
No related tags found
No related merge requests found
Pipeline #38384 waiting for manual action
......@@ -56,7 +56,7 @@ pub fn set_config(
// copied from grandpa config
// /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.
gossip_duration: std::time::Duration,
/// Period (in blocks) to share endpoints again
......@@ -67,14 +67,14 @@ struct EndpointGossipConfig {
protocol_name: ProtocolName,
}
struct EndpointGossipParams<Network> {
pub struct EndpointGossipParams<Network> {
config: EndpointGossipConfig,
network: Network,
notification_service: Box<dyn NotificationService>,
offchain_endpoint_tester: (),
}
fn run_gossip_worker<Network>(params: EndpointGossipParams<Network>) {
pub fn run_gossip_worker<Network>(params: EndpointGossipParams<Network>) {
let topic = "XXX";
// TODO network has no gossip engine, it is created in network bridge
......
......@@ -150,6 +150,7 @@ pub fn new_partial<RuntimeApi, Executor>(
consensus_manual: bool,
duniter_config: crate::cli::DuniterConfigExtension,
) -> Result<
(
sc_service::PartialComponents<
FullClient<RuntimeApi, Executor>,
FullBackend,
......@@ -172,6 +173,8 @@ pub fn new_partial<RuntimeApi, Executor>(
Option<Telemetry>,
),
>,
crate::cli::DuniterConfigExtension,
),
ServiceError,
>
where
......@@ -279,7 +282,8 @@ where
(queue, Some(handle))
};
Ok(sc_service::PartialComponents {
Ok((
sc_service::PartialComponents {
client,
backend,
task_manager,
......@@ -294,7 +298,9 @@ where
grandpa_link,
telemetry,
),
})
},
duniter_config,
))
}
/// Builds a new service for a full client.
......@@ -316,7 +322,8 @@ where
Executor: sc_executor::NativeExecutionDispatch + 'static,
Executor: sc_executor::sp_wasm_interface::HostFunctions + 'static,
{
let sc_service::PartialComponents {
let (
sc_service::PartialComponents {
client,
backend,
mut task_manager,
......@@ -325,7 +332,9 @@ where
select_chain,
transaction_pool,
other: (block_import, babe_link, babe_worker_handle, grandpa_link, mut telemetry),
} = new_partial::<RuntimeApi, Executor>(
},
duniter_options,
) = new_partial::<RuntimeApi, Executor>(
&config,
sealing.is_manual_consensus(),
duniter_options,
......@@ -714,7 +723,7 @@ where
task_manager.spawn_handle().spawn(
"endpoint-gossip",
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 to comment