Crate kaspa_p2p_lib

Crate kaspa_p2p_lib 

Source

Modules§

common
convert
echo
pb

Macros§

dequeue
Macro to indefinitely await a channel Receiver<pb::KaspadMessage>::recv call and expect a specific payload type (without a timeout). Usage:
dequeue_with_request_id
dequeue_with_timeout
Macro to await a channel Receiver<pb::KaspadMessage>::recv call with a default/specified timeout and expect a specific payload type. Usage:
make_message
Wraps an inner payload message into a valid KaspadMessage. Usage:
make_request
make_response
unwrap_message
Macro to extract a specific payload type from an Option<pb::KaspadMessage>. Usage:
unwrap_message_with_request_id

Structs§

Adaptor
The main object to create for managing a fully-fledged Kaspa P2P peer
Hub
Hub of active peers (represented as Router objects). Note that all public methods of this type are exposed through the Adaptor
IncomingRoute
KaspadHandshake
Implements the Kaspa peer-to-peer handshake protocol
Peer
PeerKey
PeerProperties
Router
A router object for managing the communication to a network peer. It is named a router because it’s responsible for internally routing messages to P2P flows based on registration and message types
SharedIncomingRoute

Enums§

ConnectionError
KaspadMessagePayloadType

Constants§

BLANK_ROUTE_ID

Traits§

ConnectionInitializer
The main entrypoint for external usage of the P2P library. An impl of this trait is expected on P2P server initialization and will be called on each new (in/out) P2P connection with a corresponding dedicated new router