go-libp2p-pubsub/pb/rpc.proto

84 lines
1.8 KiB
Protocol Buffer
Raw Normal View History

2018-07-13 13:20:11 +00:00
syntax = "proto2";
package pubsub.pb;
2016-09-10 15:14:17 +00:00
message RPC {
2016-09-11 03:47:12 +00:00
repeated SubOpts subscriptions = 1;
repeated Message publish = 2;
2016-09-10 15:14:17 +00:00
2016-09-11 03:47:12 +00:00
message SubOpts {
optional bool subscribe = 1; // subscribe or unsubcribe
optional string topicid = 2;
}
2018-02-19 15:24:19 +00:00
2018-08-08 17:54:14 +00:00
optional ControlMessage control = 3;
2016-09-10 15:14:17 +00:00
}
message Message {
optional bytes from = 1;
2016-09-10 15:14:17 +00:00
optional bytes data = 2;
2016-09-11 03:47:12 +00:00
optional bytes seqno = 3;
repeated string topicIDs = 4;
optional bytes signature = 5;
optional bytes key = 6;
2016-09-10 15:14:17 +00:00
}
2018-02-19 15:24:19 +00:00
message ControlMessage {
2018-08-08 17:54:14 +00:00
repeated ControlIHave ihave = 1;
repeated ControlIWant iwant = 2;
repeated ControlGraft graft = 3;
repeated ControlPrune prune = 4;
2018-02-19 15:24:19 +00:00
}
message ControlIHave {
2018-08-08 17:54:14 +00:00
optional string topicID = 1;
repeated string messageIDs = 2;
2018-02-19 15:24:19 +00:00
}
message ControlIWant {
2018-08-08 17:54:14 +00:00
repeated string messageIDs = 1;
2018-02-19 15:24:19 +00:00
}
message ControlGraft {
2018-08-08 17:54:14 +00:00
optional string topicID = 1;
2018-02-19 15:24:19 +00:00
}
message ControlPrune {
2018-08-08 17:54:14 +00:00
optional string topicID = 1;
repeated PeerInfo peers = 2;
2020-05-06 17:07:42 +00:00
optional uint64 backoff = 3;
}
message PeerInfo {
optional bytes peerID = 1;
2020-01-22 15:23:47 +00:00
optional bytes signedPeerRecord = 2;
2018-02-19 15:24:19 +00:00
}
2016-09-11 03:47:12 +00:00
message TopicDescriptor {
optional string name = 1;
optional AuthOpts auth = 2;
optional EncOpts enc = 3;
message AuthOpts {
optional AuthMode mode = 1;
repeated bytes keys = 2; // root keys to trust
enum AuthMode {
NONE = 0; // no authentication, anyone can publish
KEY = 1; // only messages signed by keys in the topic descriptor are accepted
WOT = 2; // web of trust, certificates can allow publisher set to grow
}
}
message EncOpts {
optional EncMode mode = 1;
repeated bytes keyHashes = 2; // the hashes of the shared keys used (salted)
enum EncMode {
NONE = 0; // no encryption, anyone can read
SHAREDKEY = 1; // messages are encrypted with shared key
WOT = 2; // web of trust, certificates can allow publisher set to grow
}
}
}