From ca59ee900e2611553abebbf3a9f8feacab52228e Mon Sep 17 00:00:00 2001 From: sasaxie Date: Wed, 21 Mar 2018 15:45:16 +0800 Subject: [PATCH] move p2p message --- core/Discover.proto | 38 -------------------------------------- core/Tron.proto | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/core/Discover.proto b/core/Discover.proto index ed8d00cb0d0..cc795db63ff 100644 --- a/core/Discover.proto +++ b/core/Discover.proto @@ -6,44 +6,6 @@ package protocol; option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file option java_outer_classname = "Discover"; //Specify the class name of the generated Java file -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; -} - -message DisconnectMessage { - ReasonCode reason = 1; -} - -message HelloMessage { - int32 p2pVersion = 1; - string clientId = 2; - int32 listenPort = 4; - string peerId = 5; -} - -message PeersMessage { - repeated Peer peers = 1; -} - message Endpoint { bytes address = 1; int32 port = 2; diff --git a/core/Tron.proto b/core/Tron.proto index 83c46358491..8a86eebcce9 100644 --- a/core/Tron.proto +++ b/core/Tron.proto @@ -179,3 +179,31 @@ message Items { repeated BlockHeader block_headers = 3; repeated Transaction transactions = 4; } + +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 DisconnectMessage { + ReasonCode reason = 1; +} + +message HelloMessage { + int32 p2pVersion = 1; + string clientId = 2; + int32 listenPort = 4; + string peerId = 5; +}