Skip to content
Snippets Groups Projects
Unverified Commit 14fa87be authored by Éloïs's avatar Éloïs
Browse files

add headV2 api field details

parent a7b7d5c7
No related branches found
No related tags found
1 merge request!4RFC 4 : Duniter WS2P API v1
...@@ -34,10 +34,11 @@ WS2P is exclusively based on websocket technology. ...@@ -34,10 +34,11 @@ WS2P is exclusively based on websocket technology.
### Endpoint format ### Endpoint format
In the peer card : `WS2P uuid host port path` In the peer card : `API uuid host port path`
Resolved in* : `ws://host:port/path` Resolved in* : `ws://host:port/path`
*If the port is `443`, the `wss://` protocol will be used. *If the port is `443`, the `wss://` protocol will be used.
api := Field indicating api type. The only two types are `WS2P` and `WS2PTOR`.
uuid := Random sequence of 8 hexadecimal characters. (This uuid, coupled with the public key, makes it possible to identify a Duniter node in a unique way.) uuid := Random sequence of 8 hexadecimal characters. (This uuid, coupled with the public key, makes it possible to identify a Duniter node in a unique way.)
host := Domain name or ipv4 or ipv6 (it is not possible to declare both an ipv4 and an ipv6, for this it is necessary to use a domain name.) host := Domain name or ipv4 or ipv6 (it is not possible to declare both an ipv4 and an ipv6, for this it is necessary to use a domain name.)
port := Mandatory. Must be an integer. (_By convention, port 20900 is used for currency g1-test and port 20901 for currency g1._) port := Mandatory. Must be an integer. (_By convention, port 20900 is used for currency g1-test and port 20901 for currency g1._)
...@@ -243,16 +244,16 @@ Accepted since duniter-ts **v1.6.9**, relayed fully since duniter-ts **v1.6.15** ...@@ -243,16 +244,16 @@ Accepted since duniter-ts **v1.6.9**, relayed fully since duniter-ts **v1.6.15**
_Nodes with versions lower than 1.6.15 bounce a degraded version of the head, only `message` and `sig` fields are relayed._ _Nodes with versions lower than 1.6.15 bounce a degraded version of the head, only `message` and `sig` fields are relayed._
{ {
message : "WS2P:HEAD:1:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX, message : "API:HEAD:1:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX,
sig : "TPh2A3NS8cHj8yrJk1Yeldx2H6bPEp46cFAGZXKfxJcNgXL2sWrlirhIOlp8pkUFSrwDawWY1zO1jlgUqMvlAg==", sig : "TPh2A3NS8cHj8yrJk1Yeldx2H6bPEp46cFAGZXKfxJcNgXL2sWrlirhIOlp8pkUFSrwDawWY1zO1jlgUqMvlAg==",
messageV2: "WS2P:HEAD:2:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX:FREE_MEMBER_ROOM:FREE_MIRROR_ROOM", messageV2: "API:HEAD:2:PUBKEY:BLOCKSTAMP:WS2PID:SOFTWARE:SOFT_VERSION:POW_PREFIX:FREE_MEMBER_ROOM:FREE_MIRROR_ROOM",
sigV2: "ta1lRrWsjGcYHcLdS75JgEW5B8ByRetFVUVVpakKNJBirhRe8HcYUHEOM7xj/+gUQGGOit6Gm5Q/lsvfsngWAQ==", sigV2: "ta1lRrWsjGcYHcLdS75JgEW5B8ByRetFVUVVpakKNJBirhRe8HcYUHEOM7xj/+gUQGGOit6Gm5Q/lsvfsngWAQ==",
step: 0 step: 0
} }
#### message & messageV2 fields #### message & messageV2 fields
API = `WS2P` API := field indicating the network layer type and giving some information about the Network configuration. (See section "API field" for details)
MESSAGE_TYPE = `HEAD` MESSAGE_TYPE = `HEAD`
PUBKEY := public key of the issuer node of this head PUBKEY := public key of the issuer node of this head
BLOCKSTAMP = `blockNumber-Hash` BLOCKSTAMP = `blockNumber-Hash`
...@@ -263,6 +264,24 @@ POW_PREFIX := nonce prefix for proof of work (manually fixed by the user) ...@@ -263,6 +264,24 @@ POW_PREFIX := nonce prefix for proof of work (manually fixed by the user)
FREE_MEMBER_ROOM := Number of incoming connection requests that can still be accepted from member nodes (FREE_MIROR_ROOM - Number of incoming connections established by non-priority mirror nodes). FREE_MEMBER_ROOM := Number of incoming connection requests that can still be accepted from member nodes (FREE_MIROR_ROOM - Number of incoming connections established by non-priority mirror nodes).
FREE_MIROR_ROOM := An integer indicating the number of incoming connections that the node can still receive. FREE_MIROR_ROOM := An integer indicating the number of incoming connections that the node can still receive.
##### API field
general scheme : `WS2P[PrivateConf][PublicConf]`
We have 4 types of WS2P Private:
OCA : clear all
OTM : tor mixed
OTA : tor all
OTS : tor strict
And two types of WS2P Public :
IC clear endpoint
IT tor endpoint
The WS2P Private conf is prefixed with an O and the ws2p public conf with an I, so the classic nodes will be of type `WS2POCAIC`.
If WS2P Public is disabled, the [PublicConf] part is absent : `WS2POCA`
#### sig & sigv2 fields #### sig & sigv2 fields
sig: ed25519 signature of the message field in base64. sig: ed25519 signature of the message field in base64.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment