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§
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.
Sourcefn state_private_key(
&self,
) -> &<TYPES::StateSignatureKey as StateSignatureKey>::StatePrivateKey
fn state_private_key( &self, ) -> &<TYPES::StateSignatureKey as StateSignatureKey>::StatePrivateKey
Get a reference to the light client signing key.