Enum ckb_network::SupportProtocols[][src]

pub enum SupportProtocols {
    Ping,
    Discovery,
    Identify,
    Feeler,
    DisconnectMessage,
    Sync,
    Relay,
    RelayV2,
    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

Ping: as a health check for ping/pong

Discovery

Discovery: used to communicate with any node with any known node address, to build a robust network topology as much as possible.

Identify

Identify: the first protocol opened when the nodes are interconnected, used to obtain the features, versions, and observation addresses supported by the other node.

RFC

Feeler

Feeler: used to detect whether the address is valid.

RFC Eclipse Attacks on Bitcoin’s Peer-to-Peer Network

DisconnectMessage

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

Sync: ckb’s main communication protocol for synchronize all blocks.

RFC

Relay

Relay: ckb’s main communication protocol for synchronizing latest transactions and blocks.

RFC

RelayV2

New Relay

Time

Time: A protocol used for node pairing that warns if there is a large gap between the local time and the remote node.

Alert

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

Protocol id

Protocol name

Support versions

Protocol message max length

Blocking flag

Builder with service handle

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

TODO(doc): @quake

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.