This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
forked from grpc-ecosystem/grpc-gateway
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '2f82ce89fcbebced73126885cf2feeda3463c73d' into develop
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
syntax = "proto3"; | ||
|
||
package protocol; | ||
|
||
|
||
option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file | ||
option java_outer_classname = "Message"; //Specify the class name of the generated Java file | ||
|
||
message Capability { | ||
string name = 1; | ||
int32 version = 2; | ||
} | ||
|
||
enum P2pMessageCode { | ||
HELLO = 0; | ||
DISCONNECT = 1; | ||
PING = 2; | ||
PONG = 3; | ||
GET_PEERS = 4; | ||
PEERS = 5; | ||
USER = 6; | ||
} | ||
|
||
enum ReasonCode { | ||
REQUESTED = 0; | ||
TCP_ERROR = 1; | ||
BAD_PROTOCOL = 2; | ||
USELESS_PEER = 3; | ||
TOO_MANY_PEERS = 4; | ||
DUPLICATE_PEER = 5; | ||
INCOMPATIBLE_PROTOCOL = 6; | ||
NULL_IDENTITY = 7; | ||
PEER_QUITING = 8; | ||
UNEXPECTED_IDENTITY = 9; | ||
LOCAL_IDENTITY = 10; | ||
PING_TIMEOUT = 11; | ||
USER_REASON = 12; | ||
UNKNOWN = 13; | ||
} | ||
|
||
message Peer { | ||
bytes address = 1; | ||
int32 port = 2; | ||
string peerId = 3; | ||
repeated Capability capabilities = 4; | ||
} | ||
|
||
message DisconnectMessage { | ||
ReasonCode reason = 1; | ||
} | ||
|
||
message HelloMessage { | ||
int32 p2pVersion = 1; | ||
string clientId = 2; | ||
repeated Capability capabilities = 3; | ||
int32 listenPort = 4; | ||
string peerId = 5; | ||
} | ||
|
||
message PeersMessage { | ||
repeated Peer peers = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters