Enum ckb_network::SupportProtocols [−][src]
pub enum SupportProtocols {
Ping,
Discovery,
Identify,
Feeler,
DisconnectMessage,
Sync,
Relay,
Time,
Alert,
}Expand description
All supported protocols
The underlying network of CKB is flexible and complex. The flexibility lies in that it can support any number of protocols. Therefore, it is also relatively complex. Now, CKB has a bunch of protocols open by default, but not all protocols have to be open. In other words, if you want to interact with ckb nodes at the p2p layer, you only need to implement a few core protocols.
Core protocol: identify/discovery/sync/relay
Variants
Ping: as a health check for ping/pong
Discovery: used to communicate with any node with any known node address, to build a robust network topology as much as possible.
Identify: the first protocol opened when the nodes are interconnected, used to obtain the features, versions, and observation addresses supported by the other node.
Feeler: used to detect whether the address is valid.
Disconnect message: used to give the remote node a debug message when the node decides to disconnect. This message must be as quick as possible, otherwise the message may not be sent. So, use a separate protocol to support it.
Sync: ckb’s main communication protocol for synchronize all blocks.
Relay: ckb’s main communication protocol for synchronizing latest transactions and blocks.
Time: A protocol used for node pairing that warns if there is a large gap between the local time and the remote node.
Alert: A protocol reserved by the Nervos Foundation to publish network-wide announcements. Any information sent from the protocol is verified by multi-signature
Implementations
impl SupportProtocols[src]
impl SupportProtocols[src]pub fn protocol_id(&self) -> ProtocolId[src]
pub fn protocol_id(&self) -> ProtocolId[src]Protocol id
pub fn support_versions(&self) -> Vec<String>[src]
pub fn support_versions(&self) -> Vec<String>[src]Support versions
pub fn max_frame_length(&self) -> usize[src]
pub fn max_frame_length(&self) -> usize[src]Protocol message max length
pub fn flag(&self) -> BlockingFlag[src]
pub fn flag(&self) -> BlockingFlag[src]Blocking flag
pub fn build_meta_with_service_handle<SH: FnOnce() -> ProtocolHandle<Box<dyn ServiceProtocol + Send + Unpin + 'static>>>(
self,
service_handle: SH
) -> ProtocolMeta[src]
pub fn build_meta_with_service_handle<SH: FnOnce() -> ProtocolHandle<Box<dyn ServiceProtocol + Send + Unpin + 'static>>>(
self,
service_handle: SH
) -> ProtocolMeta[src]Builder with service handle
Trait Implementations
impl Clone for SupportProtocols[src]
impl Clone for SupportProtocols[src]fn clone(&self) -> SupportProtocols[src]
fn clone(&self) -> SupportProtocols[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for SupportProtocols[src]
impl Debug for SupportProtocols[src]impl Into<MetaBuilder> for SupportProtocols[src]
impl Into<MetaBuilder> for SupportProtocols[src]fn into(self) -> MetaBuilder[src]
fn into(self) -> MetaBuilder[src]Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for SupportProtocols
impl Send for SupportProtocols
impl Sync for SupportProtocols
impl Unpin for SupportProtocols
impl UnwindSafe for SupportProtocols
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,