Document HostCache protocol

This commit is contained in:
Zlatin Balevsky
2018-07-12 04:48:31 +01:00
parent 04afbb6158
commit ec1ebb97fa

View File

@ -140,4 +140,22 @@ Search results are sent in "results" type connection from the responder to the o
```
* The "hashList" list contains the list of hashes that correspond to the pieces of the file
* The "altlocs" list contains list of alternate locations in b64 format that Alice thinks may also have the file.
* The "pieceSize" field is the size of the each individual file piece (except possibly the last) in powers of 2
* The "pieceSize" field is the size of the each individual file piece (except possibly the last) in powers of 2
# HostCache protocol
### Node to HostCache
Nodes send a "Ping" message to the hostcache, enriched with a boolean "leaf" field indicating whether the node is a leaf or not:
```
{
type: "Ping",
version: 1,
leaf: true
}
```
### HostCache to Node
The HostCache replies with a "Pong" message.