pub struct NetworkIdentity {
pub moniker: String,
pub keypair: Keypair,
pub consensus_address: Option<String>,
}Expand description
Node identity bundling all node-specific information.
The consensus address is derived from the keypair in the current implementation where libp2p and consensus use the same key. In the future, when using separate keys (e.g., cc-signer for consensus), the address will be provided separately.
If consensus_address is None, the node will not advertise a validator address and cannot become a validator.
Fields§
§moniker: String§keypair: Keypair§consensus_address: Option<String>Implementations§
Source§impl NetworkIdentity
impl NetworkIdentity
Sourcepub fn new(
moniker: String,
keypair: Keypair,
consensus_address: Option<String>,
) -> NetworkIdentity
pub fn new( moniker: String, keypair: Keypair, consensus_address: Option<String>, ) -> NetworkIdentity
Create a new NodeIdentity.
§Arguments
moniker- Human-readable node identifierkeypair- libp2p keypair for network authenticationconsensus_address- Optional consensus address (Some = potential validator, None = full node)
In the current implementation where libp2p and consensus share the same key, the address is typically derived from the keypair before calling this method. In the future with cc-signer, the consensus address will be separate.
Trait Implementations§
Source§impl Clone for NetworkIdentity
impl Clone for NetworkIdentity
Source§fn clone(&self) -> NetworkIdentity
fn clone(&self) -> NetworkIdentity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NetworkIdentity
impl RefUnwindSafe for NetworkIdentity
impl Send for NetworkIdentity
impl Sync for NetworkIdentity
impl Unpin for NetworkIdentity
impl UnsafeUnpin for NetworkIdentity
impl UnwindSafe for NetworkIdentity
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage