Update waku.md (#68)

This commit is contained in:
Dean Eigenmann 2019-12-05 14:37:39 +01:00 committed by Oskar Thorén
parent 3d4b696add
commit c85a2d8aa7
1 changed files with 34 additions and 32 deletions

30
waku.md
View File

@ -78,18 +78,20 @@ Using [Augmented Backus-Naur form (ABNF)](https://tools.ietf.org/html/rfc5234) w
; Packet codes 0 - 127 are reserved for Waku protocol ; Packet codes 0 - 127 are reserved for Waku protocol
packet-code = 1*3DIGIT packet-code = 1*3DIGIT
; limit ip is the number of accepted packets per s for an IP ; rate limits
limit-ip = 1*DIGIT limit-ip = 1*DIGIT
; limit peerid is the number of accepted packets per s for a peer id
limit-peerid = 1*DIGIT limit-peerid = 1*DIGIT
; limit topic is the number of accepted packets per s for a topic
limit-topic = 1*DIGIT limit-topic = 1*DIGIT
rate-limts = "[" limit-ip limit-peerid limit-topic "]" rate-limits = "[" limit-ip limit-peerid limit-topic "]"
status = "[" version pow-requirement [ bloom-filter ] [ light-node ] [confirmations-enabled] [rate-limits] "]" light-node = BIT
status = "["
version pow-requirement
[ bloom-filter ] [ light-node ]
[confirmations-enabled] [rate-limits]
"]"
; version is "an integer (as specified in RLP)" ; version is "an integer (as specified in RLP)"
version = DIGIT version = DIGIT
@ -106,8 +108,6 @@ pow-requirement = pow
; bloom filter is "a byte array" ; bloom filter is "a byte array"
bloom-filter = *OCTET bloom-filter = *OCTET
light-node = BIT
waku-envelope = "[" expiry ttl topic data nonce "]" waku-envelope = "[" expiry ttl topic data nonce "]"
; 4 bytes (UNIX time in seconds) ; 4 bytes (UNIX time in seconds)
@ -129,20 +129,22 @@ nonce = 8OCTET
messages = 1*waku-envelope messages = 1*waku-envelope
; mail server / client specific
p2p-request = waku-envelope p2p-request = waku-envelope
p2p-message = 1*waku-envelope p2p-message = 1*waku-envelope
; packet-format needs to be paired with its corresponding
; packet-format
packet-format = "[" packet-code packet-format "]" packet-format = "[" packet-code packet-format "]"
required-packet = 0 status / 1 messages / 2 pow-requirement / 3 bloom-filter required-packet = 0 status /
1 messages /
2 pow-requirement /
3 bloom-filter
optional-packet = 126 p2p-request / 127 p2p-message optional-packet = 126 p2p-request / 127 p2p-message
; packet-format needs to be paired with its corresponding packet-format
packet = "[" required-packet [ optional-packet ] "]" packet = "[" required-packet [ optional-packet ] "]"
packet-format = "[" packet-code packet-format "]"
``` ```
All primitive types are RLP encoded. Note that, per RLP specification, integers are encoded starting from `0x00`. All primitive types are RLP encoded. Note that, per RLP specification, integers are encoded starting from `0x00`.