Enum diem_config::config::PeerRole
source · pub enum PeerRole {
Validator,
PreferredUpstream,
Upstream,
ValidatorFullNode,
Downstream,
Known,
Unknown,
}
Expand description
Represents the Role that a peer plays in the network ecosystem rather than the type of node. Determines how nodes are connected to other nodes, and how discovery views them.
Rules for upstream nodes via Peer Role:
Validator -> Always upstream if not Validator else P2P PreferredUpstream -> Always upstream, overriding any other discovery ValidatorFullNode -> Always upstream for incoming connections (including other ValidatorFullNodes) Upstream -> Upstream, if no ValidatorFullNode or PreferredUpstream. Useful for initial seed discovery Downstream -> Downstream, defining a controlled downstream that I always want to connect Known -> A known peer, but it has no particular role assigned to it Unknown -> Undiscovered peer, likely due to a non-mutually authenticated connection always downstream
Variants§
Trait Implementations§
source§impl<'de> Deserialize<'de> for PeerRole
impl<'de> Deserialize<'de> for PeerRole
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Ord for PeerRole
impl Ord for PeerRole
source§impl PartialEq<PeerRole> for PeerRole
impl PartialEq<PeerRole> for PeerRole
source§impl PartialOrd<PeerRole> for PeerRole
impl PartialOrd<PeerRole> for PeerRole
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for PeerRole
impl Eq for PeerRole
impl StructuralEq for PeerRole
impl StructuralPartialEq for PeerRole
Auto Trait Implementations§
impl RefUnwindSafe for PeerRole
impl Send for PeerRole
impl Sync for PeerRole
impl Unpin for PeerRole
impl UnwindSafe for PeerRole
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.