Skip to content

Commit

Permalink
fix: fix proto file and generated code (#94)
Browse files Browse the repository at this point in the history
Updates index.proto to a valid proto3 syntax. Added UNSPECIFIED enum to PeerStoreRequest because enum first value must be 0 which would be breaking change

resolves #66
  • Loading branch information
mpetrunic authored Sep 14, 2022
1 parent 0a98092 commit 5c22052
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 111 deletions.
35 changes: 18 additions & 17 deletions packages/libp2p-daemon-protocol/src/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message Request {
PEERSTORE = 9;
}

required Type type = 1;
Type type = 1;

optional ConnectRequest connect = 2;
optional StreamOpenRequest streamOpen = 3;
Expand All @@ -32,7 +32,7 @@ message Response {
ERROR = 1;
}

required Type type = 1;
Type type = 1;
optional ErrorResponse error = 2;
optional StreamInfo streamInfo = 3;
optional IdentifyResponse identify = 4;
Expand All @@ -43,35 +43,35 @@ message Response {
}

message IdentifyResponse {
required bytes id = 1;
bytes id = 1;
repeated bytes addrs = 2;
}

message ConnectRequest {
required bytes peer = 1;
bytes peer = 1;
repeated bytes addrs = 2;
optional int64 timeout = 3;
}

message StreamOpenRequest {
required bytes peer = 1;
bytes peer = 1;
repeated string proto = 2;
optional int64 timeout = 3;
}

message StreamHandlerRequest {
required bytes addr = 1;
bytes addr = 1;
repeated string proto = 2;
}

message ErrorResponse {
required string msg = 1;
string msg = 1;
}

message StreamInfo {
required bytes peer = 1;
required bytes addr = 2;
required string proto = 3;
bytes peer = 1;
bytes addr = 2;
string proto = 3;
}

message DHTRequest {
Expand All @@ -87,7 +87,7 @@ message DHTRequest {
PROVIDE = 8;
}

required Type type = 1;
Type type = 1;
optional bytes peer = 2;
optional bytes cid = 3;
optional bytes key = 4;
Expand All @@ -103,13 +103,13 @@ message DHTResponse {
END = 2;
}

required Type type = 1;
Type type = 1;
optional PeerInfo peer = 2;
optional bytes value = 3;
}

message PeerInfo {
required bytes id = 1;
bytes id = 1;
repeated bytes addrs = 2;
}

Expand All @@ -120,15 +120,15 @@ message ConnManagerRequest {
TRIM = 2;
}

required Type type = 1;
Type type = 1;

optional bytes peer = 2;
optional string tag = 3;
optional int64 weight = 4;
}

message DisconnectRequest {
required bytes peer = 1;
bytes peer = 1;
}

message PSRequest {
Expand All @@ -139,7 +139,7 @@ message PSRequest {
SUBSCRIBE = 3;
}

required Type type = 1;
Type type = 1;
optional string topic = 2;
optional bytes data = 3;
}
Expand All @@ -160,11 +160,12 @@ message PSResponse {

message PeerstoreRequest {
enum Type {
UNSPECIFIED = 0;
GET_PROTOCOLS = 1;
GET_PEER_INFO = 2;
}

required Type type = 1;
Type type = 1;
optional bytes id = 2;
repeated string protos = 3;
}
Expand Down
Loading

0 comments on commit 5c22052

Please sign in to comment.