Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
0adc255d
Commit
0adc255d
authored
6 months ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
wip tweaks before giving up
parent
35585c69
Branches
hugo/endpoint-gossip
No related tags found
No related merge requests found
Pipeline
#38384
waiting for manual action
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
node/src/endpoint_gossip/mod.rs
+3
-3
3 additions, 3 deletions
node/src/endpoint_gossip/mod.rs
node/src/service.rs
+58
-49
58 additions, 49 deletions
node/src/service.rs
with
61 additions
and
52 deletions
node/src/endpoint_gossip/mod.rs
+
3
−
3
View file @
0adc255d
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
node/src/service.rs
+
58
−
49
View file @
0adc255d
...
@@ -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
),
);
);
// }
// }
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment