Skip to main content

Module handshake

Module handshake 

Source

StructsΒ§

HandshakeParams
Non-IO inputs to the handshake.
VerAckMsg
Answers a Version message; ack=false means the sender rejected the remote version/protocol mix.
VerMsg
Version-exchange message. Both sides send one.
WireVersion
A version and the versions it accepts, as sent on the wire.

FunctionsΒ§

handshake
Run the handshake on split reader/writer. Returns the remote peer ID and the set of protocols both sides support.
mutual_match πŸ”’
True when each side accepts the other side’s version. Both sides run the same check, so they agree on the result.
protocols_intersection πŸ”’
Compute the intersection of protocols both sides support with compatible versions. Returns the list of shared protocol IDs.
send_verack πŸ”’
Sends a Verack message.
send_vermsg πŸ”’
validate_verack_msg πŸ”’
Validates the given verack msg from the peer that sent pid’s VerMsg.
validate_version_msg πŸ”’
Validates the given version msg. Returns the remote peer ID and the negotiated protocol set.

Type AliasesΒ§

HandshakeWriter
Writer type for the handshake.
NegotiatedProtocols
Negotiated protocol set from a successful handshake.