@@ -10,6 +10,7 @@ This document details the current specifications of WS2P v1 as they are already
*[Endpoint format](#endpoint-format)
*[Getting endpoints from other Duniter nodes](#getting-endpoints-from-other-duniter-nodes)
*[Priority of WS2P outcoming connections](#priority-of-ws2p-outcoming-connections)
*[Overview on the format of ws2p messages](#overview-on-the-format-of-ws2p-messages)
*[Establishing a WS2P connection](#establishing-a-ws2p-connection)
*[Rules for accepting an incoming connection](#rules-for-accepting-an-incoming-connection)
*[HEAD messages](#head-messages)
...
...
@@ -84,6 +85,13 @@ If the key is a member: +1
If the key is preferred/privileged: +2
If the key is the same as yourself: +4 (for multi-node)
## Overview on the format of ws2p messages
Most ws2p messages exist in two formats :
JSON: this is the format used to transmit the message through the websocket.
RAW: this is the format used to sign the message. Messages received in JSON must therefore be converted to raw format in order to verify the validity of their signature.
## Establishing a WS2P connection
After sorting all WS2P endpoints according to the criteria described in the previous section,
...
...
@@ -100,7 +108,7 @@ for each connection attempt, the process is as follows:
### CONNECT message
It's a JSON object :
JSON format :
{
auth: 'CONNECT',
...
...
@@ -119,6 +127,8 @@ RAW format of the example message above : `WS2P:CONNECT:g1:D9D2zaJoWYWveii1JRYLV