Skip to content
Snippets Groups Projects
Commit 2e197728 authored by Pascal Engélibert's avatar Pascal Engélibert :bicyclist:
Browse files

Update protocol doc

parent e81dd740
No related branches found
No related tags found
No related merge requests found
Pipeline #5995 passed
...@@ -74,47 +74,97 @@ To unactivate proxy, set `client.proxy` to `null`. ...@@ -74,47 +74,97 @@ To unactivate proxy, set `client.proxy` to `null`.
## Protocols ## Protocols
### Peer list file ### Documents
#### Identity signature
A document which explicitly link a ĞMixer node which uses PUBKEY to another member pubkey.
sign(
ubjson(
{
"doctype": "gmixer/idtysig",
"docver": IDTYSIG_VERSION,
"pubkey": PUBKEY,
"sigtime": time()
}
)
)
#### Peer info
A document generated periodically by a node, then sent to other nodes.
{
"pubkey": PUBKEY,
"raw": sign(
ubjson(
{
"doctype": "gmixer/peer",
"docver": PEER_VERSION,
"currency": CURRENCY,
"pubkey": PUBKEY,
"sigtime": time(),
"host": [PUBLIC_ADDR, PUBLIC_PORT],
"idty": IDTY_PUBKEY,
"idtysig": IDTY_SIG,
"peers": [
{
"hash": PEER_HASH,
"up_in": True|False|None,
"up_out": True|False|None
},
...
]
}
)
)
}
#### Peer info file
A peer info file is useful for connecting a node to an existing network. It contains a list of peer infos. Format: UBJSON.
pubkey host port
...
Example: ### HTTP API
DCovzCEnQm9GUWe6mr8u42JR1JAuoj3HbQUGdCkfTzSr localhost 10951 URL is used like commandline arguments. Arguments are separated by slashes. Different commands can be set in the same request.
EiZ8LNJmtwCDQa8W8PcnB9n8Q7QreMHsB24kS14iV5vV 12.34.56.78 443
### HTTP API Command: **/json** send response in JSON instead of default UBJSON if possible (impossible if response contains binary values)
**Warning**: This doc is outdated! Command: **/peers** list known peers (excluding itself)
URL is used like commandline arguments. Arguments are separated by slashes. Different commands can be set in the same request. // response:
"peers": [
{
"raw": PEER_INFO,
"up_in": True|False|None,
"up_out": True|False|None
},
...
]
Command: **/list** list known peers (excluding itself) Command: **/info** give local peer info
// response: (clear json) // response:
"peers": [ "info": PEER_INFO
{ "pubkey": "DCovzCEnQm9GUWe6mr8u42JR1JAuoj3HbQUGdCkfTzSr", "localhost", "10951" },
...
]
Command: **/pubkey** get peer pubkey Command: **/pubkey** get peer pubkey
// response: (clear json) // response:
"pubkey": "ENSD6KikoZAcUVGBWJNKFREG2ryrGaHUD68GCYsiY2pK" "pubkey": PUBKEY
Command: **/version** get peer version Command: **/version** get peer version
// response: (clear json) // response:
"version": "0.1.0" "version": VERSION
Command: **/new** tell the peer about a new peer
Content: a peer info document
Command: **/new/_pubkey_** tell the peer about a new peer **ToDo**: check behind
// request: (encrypted then signed json) Command: **/getconfirm/_sender\_pubkey_/_in\_seed1_**
"pubkey": "EiZ8LNJmtwCDQa8W8PcnB9n8Q7QreMHsB24kS14iV5vV", // new peer pubkey
"host": "12.34.56.78", // new peer host
"port": "443", // new peer port
"time": 1551444674 // timestamp
Command: **/mix/_pubkey_/_amount_/_base_** mix a transaction Command: **/mix/_pubkey_/_amount_/_base_** mix a transaction
......
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