[][src]Trait splinter::consensus::ConsensusEngine

pub trait ConsensusEngine: Send {
    fn name(&self) -> &str;
fn version(&self) -> &str;
fn additional_protocols(&self) -> Vec<(String, String)>;
fn run(
        &mut self,
        consensus_messages: Receiver<ConsensusMessage>,
        proposal_updates: Receiver<ProposalUpdate>,
        network_sender: Box<dyn ConsensusNetworkSender>,
        proposal_manager: Box<dyn ProposalManager>,
        startup_state: StartupState
    ) -> Result<(), ConsensusEngineError>; }

Consensus algorithms are implemented as consensus engines. The ConsensusEngine interface defines how consensus algorithms are identified (name, version, and supported protocols), as well as how they are run and what values are required for running.

Required methods

fn name(&self) -> &str

The name of the consensus engine

fn version(&self) -> &str

The version of the consensus engine

fn additional_protocols(&self) -> Vec<(String, String)>

Any additional name/version pairs this engine supports

fn run(
    &mut self,
    consensus_messages: Receiver<ConsensusMessage>,
    proposal_updates: Receiver<ProposalUpdate>,
    network_sender: Box<dyn ConsensusNetworkSender>,
    proposal_manager: Box<dyn ProposalManager>,
    startup_state: StartupState
) -> Result<(), ConsensusEngineError>

Run the consensus engine.

Loading content...

Implementors

impl ConsensusEngine for TwoPhaseEngine[src]

Loading content...