P2PMessage¶
Purpose¶
A signed message sent between peers.
Type¶
Reception:
Record with fields:
-
src
: NodeIdentitySource peer
-
dst
: NodeIdentityDestination peer
-
msg
: enum { EngineMessageV1, RelayMessageV1 }Encapsulated message
-
sig
: SignatureSignature over the above fields by
src
Triggers:
Behaviour¶
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]