P2PMessage¶
Purpose¶
A signed message sent between peers.
Type¶
Reception:
Record with fields:
src
: NodeIdentity
Source peer
dst
: NodeIdentity
Destination peer
msg
: enum { EngineMessageV1, RelayMessageV1 }
Encapsulated message
sig
: Signature
Signature over the above fields by src
Triggers:
Behavior¶
The Router verifies the signature, and if valid, it processes the contained EngineMessage or RelayMessage. Otherwise discards the message, and disconnects from the peer by sending a DisconnectRequest message to Transport.
Message flow¶
sequenceDiagram
%% --8<-- [start:sequence]
Transport -) Router: P2PMessage
Router -) Any Local Engine: EngineMessage
%% --8<-- [end:sequence]