-
Notifications
You must be signed in to change notification settings - Fork 0
/
grpcClient.proto
51 lines (43 loc) · 1.06 KB
/
grpcClient.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
syntax = "proto3";
option go_package = "trustedStorage/grpsServer";
import "google/protobuf/empty.proto";
message CreateTx {
bytes senderAddress = 1;
bytes data = 2;
bytes pubKey = 3;
bytes signature = 4;
int64 nonce = 5;
bytes cid = 6;
}
message CreateResponse {
string response = 1;
}
message User {
bytes senderAddress = 1;
}
message Transaction {
bytes txHash = 1;
}
message Document {
bytes documentHash = 1;
}
message BlockHeader {
uint64 version = 1;
bytes HashPrevBlock = 2;
//HashMerkleRoot []byte
int64 Time = 3;
}
message Block {
uint64 blocksize = 1;
BlockHeader blockheader = 2;
uint64 TxCounter = 3;
repeated CreateTx transactions = 4;
}
service Invoicer {
rpc AddTxToBlockchain(CreateTx) returns (CreateResponse);
rpc GetLastBlock(google.protobuf.Empty) returns (CreateResponse);
rpc GetBlockchain(google.protobuf.Empty) returns (CreateResponse);
rpc GetUserTxHistory(User) returns (CreateResponse);
rpc GetTxByHash(Transaction) returns (CreateResponse);
rpc FindDocumentByHash(Document) returns (CreateResponse);
}