-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathmessage.proto
36 lines (28 loc) · 1.34 KB
/
message.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
syntax = "proto3";
package graphsync.message.pb;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
message Message {
message Request {
int32 id = 1; // unique id set on the requester side
bytes root = 2; // a CID for the root node in the query
bytes selector = 3; // ipld selector to retrieve
map<string, bytes> extensions = 4; // aux information. useful for other protocols
int32 priority = 5; // the priority (normalized). default to 1
bool cancel = 6; // whether this cancels a request
bool update = 7; // whether this requests resumes a previous request
}
message Response {
int32 id = 1; // the request id
int32 status = 2; // a status code.
map<string, bytes> extensions = 3; // additional data
}
message Block {
bytes prefix = 1; // CID prefix (cid version, multicodec and multihash prefix (type + length)
bytes data = 2;
}
// the actual data included in this message
bool completeRequestList = 1; // This request list includes *all* requests, replacing outstanding requests.
repeated Request requests = 2 [(gogoproto.nullable) = false]; // The list of requests.
repeated Response responses = 3 [(gogoproto.nullable) = false]; // The list of responses.
repeated Block data = 4 [(gogoproto.nullable) = false]; // Blocks related to the responses
}