Trait 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 state_private_key(
        &self,
    ) -> &<TYPES::StateSignatureKey as StateSignatureKey>::StatePrivateKey;
    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 state_private_key( &self, ) -> &<TYPES::StateSignatureKey as StateSignatureKey>::StatePrivateKey

Get a reference to the light client signing 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§