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
impl Tendermint
Sourcepub 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 = ()>)>
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:
- It is of no further use, and accordingly its state may be undefined
- The process terminates, so that the Tendermint process will be re-initialized from the disk before any further use
Sourcepub 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 = ()>)>
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§
impl Freeze for Tendermint
impl RefUnwindSafe for Tendermint
impl Send for Tendermint
impl Sync for Tendermint
impl Unpin for Tendermint
impl UnsafeUnpin for Tendermint
impl UnwindSafe for Tendermint
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more