Skip to main content

Tendermint

Struct Tendermint 

Source
pub struct Tendermint;
Available on crate feature std only.
Expand description

The Tendermint process.

This is expected to drive the underlying blockchain, adding blocks to it as produced by itself and as received from an external sync loop (which is not implemented here).

Implementations§

Source§

impl Tendermint

Source

pub fn process<B: Send + Sync + Blockchain<Validator: Send + Sync + BorshSerialize + BorshDeserialize, ValidatorSet: Sync, SignatureScheme: SignatureScheme<Signature: Send + BorshSerialize + BorshDeserialize, AggregateSignature: Send + BorshSerialize + BorshDeserialize>, Genesis: Sync, Block: Send + Sync + BorshSerialize + BorshDeserialize + Block<Hash: Send + BorshSerialize + BorshDeserialize>, BlockProposal: Send>, S: Send + Sync + Signer<Validator = B::Validator, Signature = <B::SignatureScheme as SignatureScheme>::Signature, SignFuture: Send>, D: Send + for<'db> Db<Transaction<'db>: Send>, N: Send + Network<B::Validator, <B::SignatureScheme as SignatureScheme>::Signature, <B::SignatureScheme as SignatureScheme>::AggregateSignature, B::Block, Sleep: Send>>( blockchain: B, signer: S, db: D, network: N, proposal: B::Block, ) -> impl Send + Future<Output = (TendermintHandle<B>, impl Send + Future<Output = ()>)>

Initialize the Tendermint process.

The returned future will run until its corresponding channels are closed. The future is NOT cancel-safe, and will have an undefined state in memory if cancelled. It MUST be polled until either:

  1. It is of no further use, and accordingly its state may be undefined
  2. The process terminates, so that the Tendermint process will be re-initialized from the disk before any further use
Source

pub fn process_single_threaded<B: Blockchain<Validator: BorshSerialize + BorshDeserialize, SignatureScheme: SignatureScheme<Signature: BorshSerialize + BorshDeserialize, AggregateSignature: BorshSerialize + BorshDeserialize>, Block: BorshSerialize + BorshDeserialize + Block<Hash: BorshSerialize + BorshDeserialize>>, S: Signer<Validator = B::Validator, Signature = <B::SignatureScheme as SignatureScheme>::Signature>, D: Db, N: Network<B::Validator, <B::SignatureScheme as SignatureScheme>::Signature, <B::SignatureScheme as SignatureScheme>::AggregateSignature, B::Block>>( blockchain: B, signer: S, db: D, network: N, proposal: B::Block, ) -> impl Future<Output = (TendermintHandle<B>, impl Future<Output = ()>)>

A variant of Tendermint::process which supports !Send, !Sync arguments.

This is intended to enable support for single-threaded runtimes which do not require such bounds.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.