message.proto 1.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
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
11 12 13 14
    bytes selector = 2; // ipld selector to retrieve
    bytes extra = 3;    // aux information. useful for other protocols
    int32 priority = 4;	// the priority (normalized). default to 1
    bool  cancel = 5;   // whether this cancels a request
15 16 17 18 19
  }

  message Response {
    int32 id = 1;     // the request id
    int32 status = 2; // a status code.
20
    bytes extra = 3; // additional data
21 22
  }

23 24 25 26 27
  message Block {
  	bytes prefix = 1; // CID prefix (cid version, multicodec and multihash prefix (type + length)
  	bytes data = 2;
  }
  
28
  // the actual data included in this message
29 30 31 32 33
  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

34
}