pub struct BFT<N: Network> { /* private fields */ }Implementations§
Source§impl<N: Network> BFT<N>
impl<N: Network> BFT<N>
Sourcepub fn new(
account: Account<N>,
storage: Storage<N>,
ledger: Arc<dyn LedgerService<N>>,
ip: Option<SocketAddr>,
trusted_validators: &[SocketAddr],
dev: Option<u16>,
) -> Result<Self>
pub fn new( account: Account<N>, storage: Storage<N>, ledger: Arc<dyn LedgerService<N>>, ip: Option<SocketAddr>, trusted_validators: &[SocketAddr], dev: Option<u16>, ) -> Result<Self>
Initializes a new instance of the BFT.
Sourcepub async fn run(
&mut self,
consensus_sender: Option<ConsensusSender<N>>,
primary_sender: PrimarySender<N>,
primary_receiver: PrimaryReceiver<N>,
) -> Result<()>
pub async fn run( &mut self, consensus_sender: Option<ConsensusSender<N>>, primary_sender: PrimarySender<N>, primary_receiver: PrimaryReceiver<N>, ) -> Result<()>
Run the BFT instance.
Sourcepub fn ledger(&self) -> &Arc<dyn LedgerService<N>>
pub fn ledger(&self) -> &Arc<dyn LedgerService<N>>
Returns the ledger.
Sourcepub fn leader(&self) -> Option<Address<N>>
pub fn leader(&self) -> Option<Address<N>>
Returns the leader of the current even round, if one was present.
Sourcepub const fn leader_certificate(
&self,
) -> &Arc<RwLock<Option<BatchCertificate<N>>>> ⓘ
pub const fn leader_certificate( &self, ) -> &Arc<RwLock<Option<BatchCertificate<N>>>> ⓘ
Returns the certificate of the leader from the current even round, if one was present.
Source§impl<N: Network> BFT<N>
impl<N: Network> BFT<N>
Sourcepub fn num_unconfirmed_transmissions(&self) -> usize
pub fn num_unconfirmed_transmissions(&self) -> usize
Returns the number of unconfirmed transmissions.
Sourcepub fn num_unconfirmed_ratifications(&self) -> usize
pub fn num_unconfirmed_ratifications(&self) -> usize
Returns the number of unconfirmed ratifications.
Sourcepub fn num_unconfirmed_solutions(&self) -> usize
pub fn num_unconfirmed_solutions(&self) -> usize
Returns the number of solutions.
Sourcepub fn num_unconfirmed_transactions(&self) -> usize
pub fn num_unconfirmed_transactions(&self) -> usize
Returns the number of unconfirmed transactions.
Source§impl<N: Network> BFT<N>
impl<N: Network> BFT<N>
Sourcepub fn worker_transmission_ids(
&self,
) -> impl '_ + Iterator<Item = TransmissionID<N>>
pub fn worker_transmission_ids( &self, ) -> impl '_ + Iterator<Item = TransmissionID<N>>
Returns the worker transmission IDs.
Sourcepub fn worker_transmissions(
&self,
) -> impl '_ + Iterator<Item = (TransmissionID<N>, Transmission<N>)>
pub fn worker_transmissions( &self, ) -> impl '_ + Iterator<Item = (TransmissionID<N>, Transmission<N>)>
Returns the worker transmissions.
Sourcepub fn worker_solutions(
&self,
) -> impl '_ + Iterator<Item = (SolutionID<N>, Data<Solution<N>>)>
pub fn worker_solutions( &self, ) -> impl '_ + Iterator<Item = (SolutionID<N>, Data<Solution<N>>)>
Returns the worker solutions.
Sourcepub fn worker_transactions(
&self,
) -> impl '_ + Iterator<Item = (N::TransactionID, Data<Transaction<N>>)>
pub fn worker_transactions( &self, ) -> impl '_ + Iterator<Item = (N::TransactionID, Data<Transaction<N>>)>
Returns the worker transactions.
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for BFT<N>where
<N as Environment>::Field: Freeze,
<N as Environment>::Scalar: Freeze,
<N as Environment>::Projective: Freeze,
impl<N> !RefUnwindSafe for BFT<N>
impl<N> Send for BFT<N>
impl<N> Sync for BFT<N>
impl<N> Unpin for BFT<N>where
<N as Environment>::Field: Unpin,
<N as Environment>::Scalar: Unpin,
<N as Environment>::Projective: Unpin,
impl<N> !UnwindSafe for BFT<N>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more