[−][src]Enum ckb_network::SupportProtocols
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]
pub fn protocol_id(&self) -> ProtocolId
[src]
Protocol id
pub fn name(&self) -> String
[src]
Protocol name
pub fn support_versions(&self) -> Vec<String>
[src]
Support versions
pub fn max_frame_length(&self) -> usize
[src]
Protocol message max length
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]
self,
service_handle: SH
) -> ProtocolMeta
Builder with service handle
Trait Implementations
impl Clone for SupportProtocols
[src]
pub fn clone(&self) -> SupportProtocols
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SupportProtocols
[src]
impl Into<MetaBuilder> for SupportProtocols
[src]
pub fn into(self) -> MetaBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for SupportProtocols
[src]
impl Send for SupportProtocols
[src]
impl Sync for SupportProtocols
[src]
impl Unpin for SupportProtocols
[src]
impl UnwindSafe for SupportProtocols
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,