Skip to content

Commit bb1388b

Browse files
committed
zoobc/zoobc-core#603 fix conflicts
2 parents cdbf590 + 1820a4b commit bb1388b

File tree

7 files changed

+145
-12
lines changed

7 files changed

+145
-12
lines changed

documentation.swagger.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,30 @@
286286
}
287287
}
288288
},
289+
"/v1/escrow/GetEscrowTransactionRequest": {
290+
"get": {
291+
"tags": [
292+
"EscrowTransactionService"
293+
],
294+
"operationId": "GetEscrowTransaction",
295+
"parameters": [
296+
{
297+
"type": "string",
298+
"format": "int64",
299+
"name": "ID",
300+
"in": "query"
301+
}
302+
],
303+
"responses": {
304+
"200": {
305+
"description": "A successful response.",
306+
"schema": {
307+
"$ref": "#/definitions/modelEscrow"
308+
}
309+
}
310+
}
311+
}
312+
},
289313
"/v1/escrow/GetEscrowTransactionsRequest": {
290314
"post": {
291315
"tags": [
@@ -302,6 +326,33 @@
302326
}
303327
}
304328
},
329+
"/v1/file/FileDownload": {
330+
"get": {
331+
"tags": [
332+
"FileDownloadService"
333+
],
334+
"operationId": "FileDownload",
335+
"parameters": [
336+
{
337+
"type": "array",
338+
"items": {
339+
"type": "string"
340+
},
341+
"collectionFormat": "multi",
342+
"name": "FileChunkNames",
343+
"in": "query"
344+
}
345+
],
346+
"responses": {
347+
"200": {
348+
"description": "A successful response.",
349+
"schema": {
350+
"$ref": "#/definitions/modelFileDownloadResponse"
351+
}
352+
}
353+
}
354+
}
355+
},
305356
"/v1/host/GetHostInfo": {
306357
"get": {
307358
"tags": [
@@ -1111,6 +1162,24 @@
11111162
"EventApprovalEscrowTransaction"
11121163
]
11131164
},
1165+
"modelFileDownloadResponse": {
1166+
"type": "object",
1167+
"properties": {
1168+
"Failed": {
1169+
"type": "array",
1170+
"items": {
1171+
"type": "string"
1172+
}
1173+
},
1174+
"FileChunks": {
1175+
"type": "array",
1176+
"items": {
1177+
"type": "string",
1178+
"format": "byte"
1179+
}
1180+
}
1181+
}
1182+
},
11141183
"modelGenerateNodeKeyResponse": {
11151184
"type": "object",
11161185
"properties": {

model/escrow.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,9 @@ message GetEscrowTransactionsResponse {
4646
uint64 Total = 1 [ jstype = JS_STRING ];
4747
// Transaction transactions returned
4848
repeated Escrow Escrows = 2;
49+
}
50+
51+
// GetEscrowTransactionRequest represents GetEscrowTransaction parameter
52+
message GetEscrowTransactionRequest {
53+
int64 ID = 1 [jstype = JS_STRING];
4954
}

model/fileDownload.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
syntax = "proto3";
2+
3+
package model;
4+
option go_package = "github.com/zoobc/zoobc-core/common/model";
5+
6+
message FileDownloadResponse {
7+
repeated bytes FileChunks = 1;
8+
repeated string Failed = 2;
9+
}
10+
11+
// RequestFilesRequest a model request of requesting files to download from a peer
12+
message FileDownloadRequest {
13+
repeated string FileChunkNames = 1;
14+
}
15+

model/signature.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syntax = "proto3";
2+
3+
package model;
4+
option go_package = "github.com/zoobc/zoobc-core/common/model";
5+
6+
enum SignatureType {
7+
// in bytes: []byte{0,0,0,0}, using Ed25519 signature algorithm
8+
DefaultSignature = 0;
9+
// in bytes: []byte{1,0,0,0}, bitcoin uses a specific Koblitz curve secp256k1
10+
// Koblitz curves are a type of Elliptic Curve Digital Signature Algorithm
11+
BitcoinSignature = 1;
12+
}

service/escrow.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ service EscrowTransactionService {
1212
post: "/v1/escrow/GetEscrowTransactionsRequest"
1313
};
1414
}
15+
rpc GetEscrowTransaction(model.GetEscrowTransactionRequest) returns (model.Escrow) {
16+
option(google.api.http) = {
17+
get: "/v1/escrow/GetEscrowTransactionRequest"
18+
};
19+
}
1520
}

service/fileDownload.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax="proto3";
2+
3+
package service;
4+
5+
option go_package = "github.com/zoobc/zoobc-core/common/service";
6+
7+
import "model/fileDownload.proto";
8+
import "google/api/annotations.proto";
9+
10+
// FileDownloadService represent request on db Transaction
11+
service FileDownloadService {
12+
rpc FileDownload(model.FileDownloadRequest) returns (model.FileDownloadResponse) {
13+
option (google.api.http) = {
14+
get: "/v1/file/FileDownload"
15+
};
16+
}
17+
}

service/p2pCommunication.proto

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
syntax="proto3";
1+
syntax = "proto3";
22

33
package service;
44

@@ -10,18 +10,28 @@ import "model/empty.proto";
1010
import "model/block.proto";
1111
import "model/blockchain.proto";
1212
import "model/transaction.proto";
13+
import "model/fileDownload.proto";
1314

1415
service P2PCommunication {
15-
rpc GetPeerInfo(model.GetPeerInfoRequest) returns (model.Node) {}
16-
rpc GetMorePeers(model.Empty) returns (model.GetMorePeersResponse) {}
17-
rpc SendPeers(model.SendPeersRequest) returns (model.Empty) {}
18-
rpc SendBlock (model.SendBlockRequest) returns (model.SendBlockResponse) {}
19-
rpc SendTransaction (model.SendTransactionRequest) returns (model.SendTransactionResponse) {}
20-
rpc SendBlockTransactions (model.SendBlockTransactionsRequest) returns (model.SendBlockTransactionsResponse) {}
21-
rpc RequestBlockTransactions (model.RequestBlockTransactionsRequest) returns (model.Empty){}
16+
rpc GetPeerInfo(model.GetPeerInfoRequest) returns (model.Node) {}
17+
rpc GetMorePeers(model.Empty) returns (model.GetMorePeersResponse) {}
18+
rpc SendPeers(model.SendPeersRequest) returns (model.Empty) {}
19+
rpc SendBlock(model.SendBlockRequest) returns (model.SendBlockResponse) {}
20+
rpc SendTransaction(model.SendTransactionRequest)
21+
returns (model.SendTransactionResponse) {}
22+
rpc SendBlockTransactions(model.SendBlockTransactionsRequest)
23+
returns (model.SendBlockTransactionsResponse) {}
24+
rpc RequestBlockTransactions(model.RequestBlockTransactionsRequest)
25+
returns (model.Empty) {}
2226

23-
rpc GetCumulativeDifficulty(model.GetCumulativeDifficultyRequest) returns (model.GetCumulativeDifficultyResponse){}
24-
rpc GetCommonMilestoneBlockIDs(model.GetCommonMilestoneBlockIdsRequest) returns (model.GetCommonMilestoneBlockIdsResponse) {}
25-
rpc GetNextBlockIDs(model.GetNextBlockIdsRequest) returns (model.BlockIdsResponse) {}
26-
rpc GetNextBlocks(model.GetNextBlocksRequest) returns (model.BlocksData) {}
27+
rpc GetCumulativeDifficulty(model.GetCumulativeDifficultyRequest)
28+
returns (model.GetCumulativeDifficultyResponse) {}
29+
rpc GetCommonMilestoneBlockIDs(model.GetCommonMilestoneBlockIdsRequest)
30+
returns (model.GetCommonMilestoneBlockIdsResponse) {}
31+
rpc GetNextBlockIDs(model.GetNextBlockIdsRequest)
32+
returns (model.BlockIdsResponse) {}
33+
rpc GetNextBlocks(model.GetNextBlocksRequest) returns (model.BlocksData) {}
34+
35+
rpc RequestFileDownload(model.FileDownloadRequest)
36+
returns (model.FileDownloadResponse) {}
2737
}

0 commit comments

Comments
 (0)