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§
sourcefn total_nodes(&self) -> NonZeroUsize
fn total_nodes(&self) -> NonZeroUsize
Total number of nodes in the network. Also known as n
.
sourcefn builder_timeout(&self) -> Duration
fn builder_timeout(&self) -> Duration
The maximum amount of time a leader can wait to get a block from a builder.
sourcefn public_key(&self) -> &TYPES::SignatureKey
fn public_key(&self) -> &TYPES::SignatureKey
Get a reference to the public key.
sourcefn private_key(&self) -> &<TYPES::SignatureKey as SignatureKey>::PrivateKey
fn private_key(&self) -> &<TYPES::SignatureKey as SignatureKey>::PrivateKey
Get a reference to the private key.