From d5c1d6f30049657d11ed49a99247a5b6ff4cdc8d Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Mon, 29 Jul 2019 16:08:37 +0800 Subject: [PATCH 1/3] add sendblock Service --- service/p2pCommunication.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/p2pCommunication.proto b/service/p2pCommunication.proto index 5c5e38c..7af0836 100644 --- a/service/p2pCommunication.proto +++ b/service/p2pCommunication.proto @@ -7,9 +7,11 @@ option go_package = "github.com/zoobc/zoobc-core/common/service"; import "model/peer.proto"; import "model/node.proto"; import "model/empty.proto"; +import "model/block.proto"; service P2PCommunication { rpc GetPeerInfo(model.GetPeerInfoRequest) returns (model.Node) {} rpc GetMorePeers(model.Empty) returns (model.GetMorePeersResponse) {} rpc SendPeers(model.SendPeersRequest) returns (model.Empty) {} + rpc SendBlock (model.Block) returns (model.Empty) {} } From f97742f91856a1b193f08cd4000bb5704d596032 Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Tue, 30 Jul 2019 19:02:25 +0800 Subject: [PATCH 2/3] add SendTransaction in P2PCommunication service --- service/p2pCommunication.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/p2pCommunication.proto b/service/p2pCommunication.proto index 7af0836..99c07c2 100644 --- a/service/p2pCommunication.proto +++ b/service/p2pCommunication.proto @@ -8,10 +8,12 @@ import "model/peer.proto"; import "model/node.proto"; import "model/empty.proto"; import "model/block.proto"; +import "model/transaction.proto"; service P2PCommunication { rpc GetPeerInfo(model.GetPeerInfoRequest) returns (model.Node) {} rpc GetMorePeers(model.Empty) returns (model.GetMorePeersResponse) {} rpc SendPeers(model.SendPeersRequest) returns (model.Empty) {} rpc SendBlock (model.Block) returns (model.Empty) {} + rpc SendTransaction (model.Transaction) returns (model.Empty) {} } From cad4cc95d6e12196d572d29c26f3352733df47bf Mon Sep 17 00:00:00 2001 From: sukrawidhyawan Date: Wed, 31 Jul 2019 08:04:12 +0800 Subject: [PATCH 3/3] p2pCommunication: update sendTransaction req --- documentation.swagger.json | 4 ++-- model/host.proto | 2 +- model/transaction.proto | 6 ++++++ service/p2pCommunication.proto | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/documentation.swagger.json b/documentation.swagger.json index b2c2215..2f30a33 100644 --- a/documentation.swagger.json +++ b/documentation.swagger.json @@ -11,7 +11,7 @@ ], "swagger": "2.0", "info": { - "title": "service/account.proto", + "title": "service/accountBalance.proto", "version": "version not set" }, "paths": { @@ -754,7 +754,7 @@ }, "modelHost": { "type": "object", - "title": "Host represent", + "title": "Host represent node and listed peers information", "properties": { "BlacklistedPeers": { "type": "object", diff --git a/model/host.proto b/model/host.proto index 87c910b..aaa7ed2 100644 --- a/model/host.proto +++ b/model/host.proto @@ -7,7 +7,7 @@ option go_package = "github.com/zoobc/zoobc-core/common/model"; import "model/node.proto"; import "model/peer.proto"; -// Host represent +// Host represent data sructure node and listed peers in node it's self message Host { Node Info = 1; map ResolvedPeers = 2; diff --git a/model/transaction.proto b/model/transaction.proto index f619b4d..6351323 100644 --- a/model/transaction.proto +++ b/model/transaction.proto @@ -84,6 +84,12 @@ message GetTransactionsResponse { repeated Transaction Transactions = 3; } +// SendTransaction request in p2pCommunication service +message SendTransactionRequest { + bytes TransactionBytes = 1; +} + +// TODO: Currently not yet used. Should we delete it? message PostUnconfirmedTransactionRequest { Transaction Transaction = 1; uint32 ArrivalTimestamp = 2; diff --git a/service/p2pCommunication.proto b/service/p2pCommunication.proto index 99c07c2..924d042 100644 --- a/service/p2pCommunication.proto +++ b/service/p2pCommunication.proto @@ -15,5 +15,5 @@ service P2PCommunication { rpc GetMorePeers(model.Empty) returns (model.GetMorePeersResponse) {} rpc SendPeers(model.SendPeersRequest) returns (model.Empty) {} rpc SendBlock (model.Block) returns (model.Empty) {} - rpc SendTransaction (model.Transaction) returns (model.Empty) {} + rpc SendTransaction (model.SendTransactionRequest) returns (model.Empty) {} }