Trait hotshot_types::traits::consensus_api::ConsensusApi

source ·
pub trait ConsensusApi<TYPES: NodeType, I: NodeImplementation<TYPES>>: Send + Sync {
    // Required methods
    fn total_nodes(&self) -> NonZeroUsize;
    fn builder_timeout(&self) -> Duration;
    fn public_key(&self) -> &TYPES::SignatureKey;
    fn private_key(&self) -> &<TYPES::SignatureKey as SignatureKey>::PrivateKey;
    fn send_event<'life0, 'async_trait>(
        &'life0 self,
        event: Event<TYPES>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The API that tasks use to talk to the system TODO we plan to drop this https://github.com/EspressoSystems/HotShot/issues/2294

Required Methods§

source

fn total_nodes(&self) -> NonZeroUsize

Total number of nodes in the network. Also known as n.

source

fn builder_timeout(&self) -> Duration

The maximum amount of time a leader can wait to get a block from a builder.

source

fn public_key(&self) -> &TYPES::SignatureKey

Get a reference to the public key.

source

fn private_key(&self) -> &<TYPES::SignatureKey as SignatureKey>::PrivateKey

Get a reference to the private key.

source

fn send_event<'life0, 'async_trait>( &'life0 self, event: Event<TYPES>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Notify the system of an event within hotshot-consensus.

Implementors§