pub struct AuthenticatedNetwork<E>where
E: Clock + GClock + ReasonablyRealtime + Rng + CryptoRng + Spawner + Storage + Metrics + RNetwork + Clone,{
pub public_key: PublicKey,
pub oracle: Oracle<PublicKey>,
/* private fields */
}Expand description
Authenticated P2P network for BFT consensus.
Fields§
§public_key: PublicKeyOur public key.
oracle: Oracle<PublicKey>The network oracle for peer management.
Implementations§
Source§impl<E> AuthenticatedNetwork<E>
impl<E> AuthenticatedNetwork<E>
Sourcepub async fn new(
context: E,
config: AuthenticatedP2pConfig,
participants: Vec<PublicKey>,
) -> (Self, ConsensusChannels<Sender<PublicKey>, Receiver<PublicKey>, impl Resolver<Key = Request<SimplexBlock>>>, Handle<()>)
pub async fn new( context: E, config: AuthenticatedP2pConfig, participants: Vec<PublicKey>, ) -> (Self, ConsensusChannels<Sender<PublicKey>, Receiver<PublicKey>, impl Resolver<Key = Request<SimplexBlock>>>, Handle<()>)
Creates and starts a new authenticated P2P network.
Returns the network handle and the consensus channels.
Sourcepub async fn update_participants(
&mut self,
epoch: u64,
participants: Vec<PublicKey>,
)
pub async fn update_participants( &mut self, epoch: u64, participants: Vec<PublicKey>, )
Update the set of authorized participants.
Auto Trait Implementations§
impl<E> Freeze for AuthenticatedNetwork<E>where
E: Freeze,
impl<E> !RefUnwindSafe for AuthenticatedNetwork<E>
impl<E> Send for AuthenticatedNetwork<E>
impl<E> Sync for AuthenticatedNetwork<E>
impl<E> Unpin for AuthenticatedNetwork<E>where
E: Unpin,
impl<E> !UnwindSafe for AuthenticatedNetwork<E>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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