Skip to content
Snippets Groups Projects
Commit 2d13ff34 authored by Éloïs's avatar Éloïs
Browse files

Update 0004_ws2p_v1.md

parent eb0df0a8
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,9 @@ This document details the current specifications of ws2p v1 as they are already
* [Contents](#contents)
* [What is WS2P ?](#what-is-ws2p)
* [Establishing a WS2P connection](#establishing-a-aws2p-connection)
* [Getting endpoints from other Duniter nodes](#getting-endpoints-from-other-duniter-nodes)
* [Priority of WS2P connections](#priority-of-ws2p-connections)
* [Establishing a WS2P connection](#establishing-a-ws2p-connection)
* [HEAD messages](head-messages)
* [Document sharing stream](#document-sharing-stream)
......@@ -18,8 +20,39 @@ WS2P is the inter-node network layer, it is the only guarantor of synchronizatio
WS2P is the network part of the duniter protocol, so any duniter implementation must integrate the WS2P network layer in order to work.
WS2P WS2P is exclusively based on websocket.
## Getting endpoints from other Duniter nodes
Initially, duniter is totally agnostic, it doesn't know any node.
The first access points of other nodes are obtained during the synchronization step.
Currently, the synchronization process is fully managed by api bma,
but this synchronization process adds peers records of the network nodes known by the node on which the user has chosen to synchronize to Duniter's database.
When Duniter starts up, the WS2P module accesses the peer records stored in Duniter's database following synchronization.
## Priority of WS2P connections
The WS2P module does not attempt to connect randomly to any node among those of which it knows a WS2P access point,
it classifies them according to the following criteria :
###1st criterion: the network layer
If the node is configured to use an X network layer, then all nodes that accept a connection through this X network layer will have priority.
Currently, only the TOR network layer is implemented.
_Note: the first criterion takes precedence over the second one._
###2nd criterion: priority score
The priority score of a node depends on its public key and is calculated as follows :
by default the priority score is zero
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)
## Establishing a WS2P connection
## HEAD messages
## Document sharing stream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment