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

[ref] rework human-readable format for peers & heads

parent 43ef56ba
No related branches found
No related tags found
1 merge request!8WIP: WS2P v2
...@@ -393,15 +393,17 @@ Signed document declaring all the endpoints of a peer. ...@@ -393,15 +393,17 @@ Signed document declaring all the endpoints of a peer.
The document is represented by an array of bytes containing (peer_card_size + 2) bytes. The document is represented by an array of bytes containing (peer_card_size + 2) bytes.
to sign the document it is necessary to calculate the hash sha256 of this bytes array then to sign the hash obtained with the issuer's private key. to sign the document it is necessary to calculate the hash sha256 of this bytes array then to sign the hash obtained with the issuer's private key.
### Peer card BMA JSON format ### Peer card JSON format
This human-readable format will be used by all APIs that wish to provide peer cards in a human-readable format. For example, Client APIs.
{ {
"version": Number(VERSION), "version": Number(VERSION),
"currency": Number(CURRENCY_CODE), "currency": Number(CURRENCY_CODE),
"node_id": String(NODE_ID in base16), "node_id": String(NODE_ID in base16),
"algorithm": Number(ALGORITHM), "algorithm": String(name of pubkey/sig algorithm)
"pubkey": String(ISSUER_PUBLIC_KEY in base58), "pubkey": String(ISSUER_PUBLIC_KEY in base58),
"block": String(BLOCK_NUMBER ++ "-" ++ BLOCK_HASH in base16), "blockstamp": String(BLOCK_NUMBER ++ "-" ++ BLOCK_HASH in base16),
"endpoinds": Array([ "endpoinds": Array([
String(ENDPOINT_1 in endpoint utf8 format), String(ENDPOINT_1 in endpoint utf8 format),
String(ENDPOINT_2 in endpoint utf8 format), String(ENDPOINT_2 in endpoint utf8 format),
...@@ -416,9 +418,9 @@ Example : ...@@ -416,9 +418,9 @@ Example :
"version": 11, "version": 11,
"currency": 1, "currency": 1,
"node_id": "15af24db", "node_id": "15af24db",
"algorithm": 1, "algorithm": "Ed25519",
"pubkey": "D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx" "pubkey": "D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx"
"block": "128310-000002A569DCEED62227CAC0ABDFE6B2647B21B3193A40398CD12BC2A95C24D9", "blockstamp": "128310-000002A569DCEED62227CAC0ABDFE6B2647B21B3193A40398CD12BC2A95C24D9",
"endpoinds": [ "endpoinds": [
"WS2P 2 1 TLS 3 DEF LOW ABF 443 g1.durs.info ws2p" "WS2P 2 1 TLS 3 DEF LOW ABF 443 g1.durs.info ws2p"
], ],
...@@ -771,13 +773,15 @@ step := Number of head rebounds (unsigned field). ...@@ -771,13 +773,15 @@ step := Number of head rebounds (unsigned field).
#### HEAD v3 JSON format #### HEAD v3 JSON format
This human-readable format will be used by all APIs that wish to provide HEADs v3 in a human-readable format. For example, Client APIs.
{ {
"api_outgoing_conf": Number, "api_outgoing_conf": Number,
"api_incoming_conf": Number, "api_incoming_conf": Number,
"free_mirror_rooms": Number, "free_mirror_rooms": Number,
"low_priority_rooms": Number, "low_priority_rooms": Number,
"node_id": Number, "node_id": Number,
"algorithm": Number(pubkey.algorithm) "algorithm": String(name of pubkey/sig algorithm)
"pubkey": String(pubkey.pubkey_content in base58), "pubkey": String(pubkey.pubkey_content in base58),
"blockstamp": String(BlockId-BlockHash in base16), "blockstamp": String(BlockId-BlockHash in base16),
"software_name": String, "software_name": String,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment