mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
42 lines
878 B
Protocol Buffer
42 lines
878 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
message Record {
|
|
bytes key = 1;
|
|
bytes value = 2;
|
|
string timeReceived = 5;
|
|
};
|
|
|
|
message Message {
|
|
enum MessageType {
|
|
PUT_VALUE = 0;
|
|
GET_VALUE = 1;
|
|
ADD_PROVIDER = 2;
|
|
GET_PROVIDERS = 3;
|
|
FIND_NODE = 4;
|
|
PING = 5;
|
|
}
|
|
|
|
enum ConnectionType {
|
|
NOT_CONNECTED = 0;
|
|
CONNECTED = 1;
|
|
CAN_CONNECT = 2;
|
|
CANNOT_CONNECT = 3;
|
|
}
|
|
|
|
message Peer {
|
|
bytes id = 1;
|
|
repeated bytes addrs = 2;
|
|
ConnectionType connection = 3;
|
|
optional bytes signedRecord = 4; // Envelope(PeerRecord) encoded
|
|
}
|
|
|
|
MessageType type = 1;
|
|
int32 clusterLevelRaw = 10;
|
|
bytes key = 2;
|
|
Record record = 3;
|
|
repeated Peer closerPeers = 8;
|
|
repeated Peer providerPeers = 9;
|
|
|
|
optional bytes senderRecord = 11; // Envelope(PeerRecord) encoded
|
|
}
|