From fe718e9be21252b7c1c112c530fd96966a0057f9 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Wed, 4 Jul 2018 23:54:22 +0100 Subject: [PATCH] Specify that leaf-ultrapeer length is only two bytes --- doc/wire-protocol.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/wire-protocol.md b/doc/wire-protocol.md index ab69639f..8e1a5d72 100644 --- a/doc/wire-protocol.md +++ b/doc/wire-protocol.md @@ -12,9 +12,13 @@ All traffic after the handshake is compressed using the same compression algorit ## Messages -After the handhsake follows a stream of messages. Messages can arrive in any order. Each message consists of 3 bytes - the most significant bit of the first message indicates if the payload is binary or JSON. The remaining 23 bits indicate the length of the message. +After the handhsake follows a stream of messages. Messages can arrive in any order. -The JSON payload has two mandatory top-level fields - type and version: +Between ultrapeers, each message consists of 3 bytes - the most significant bit of the first byte indicates if the payload is binary or JSON. The remaining 23 bits indicate the length of the message. + +Between leaf and ultrapeer, each message consists of 2 bytes unsigned payload length followed by the JSON payload. + +The JSON structure has two mandatory top-level fields - type and version: ``` {