Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Integrate all (dummy) subsystems with the Overseer #1374

Merged
merged 10 commits into from
Jul 9, 2020
24 changes: 19 additions & 5 deletions node/overseer/examples/minimal-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ use futures_timer::Delay;
use kv_log_macro as log;

use polkadot_primitives::parachain::{BlockData, PoVBlock};
use polkadot_overseer::Overseer;
use polkadot_overseer::{Overseer, AllSubsystems};

use polkadot_subsystem::{Subsystem, SubsystemContext, SpawnedSubsystem, FromOverseer};
use polkadot_subsystem::{
Subsystem, SubsystemContext, DummySubsystem,
SpawnedSubsystem, FromOverseer,
};
use polkadot_subsystem::messages::{
AllMessages, CandidateBackingMessage, CandidateValidationMessage
CandidateValidationMessage, CandidateBackingMessage, AllMessages,
};

struct Subsystem1;
Expand Down Expand Up @@ -127,10 +130,21 @@ fn main() {
Delay::new(Duration::from_secs(1)).await;
});

let all_subsystems = AllSubsystems {
candidate_validation: Subsystem2,
candidate_backing: Subsystem1,
candidate_selection: DummySubsystem,
statement_distribution: DummySubsystem,
availability_distribution: DummySubsystem,
bitfield_distribution: DummySubsystem,
provisioner: DummySubsystem,
runtime_api: DummySubsystem,
availability_store: DummySubsystem,
network_bridge: DummySubsystem,
};
let (overseer, _handler) = Overseer::new(
vec![],
Subsystem2,
Subsystem1,
all_subsystems,
spawner,
).unwrap();
let overseer_fut = overseer.run().fuse();
Expand Down
Loading