cranberry

Форк
0
/
cranberry.proto 
99 строк · 1.8 Кб
1
syntax = "proto3";
2

3
option go_package = "grpc/";
4

5
service GossipService {
6
    rpc SendBlock(stream SendBlockMessage) returns (stream SendBlockMessage);
7
}
8

9
service CranberryService {
10
    rpc SendTx (SendTxRequest) returns (SendTxResponse);
11
    rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse);
12
    rpc AddPeer (AddPeerRequest) returns (AddPeerResponse);
13
    rpc PropagateTx(PropagateTxRequest) returns (PropagateTxResponse);
14
}
15
  
16
message SendTxRequest {
17
    Tx tx = 1;
18
    Signature signature = 2;
19
    bytes pubKey = 3;
20
} 
21
  
22
message SendTxResponse {
23
}
24

25
message SendBlockMessage {
26
    BlockContainer blockContainer = 1;
27
}
28
  
29
message GetBlockByHeightRequest {
30
    uint64 height = 1;
31
}
32
  
33
message GetBlockByHeightResponse {
34
    BlockContainer blockContainer = 1; 
35
}
36

37
message PropagateTxRequest {
38
    TxContainer txContainer = 1;
39
}
40

41
message PropagateTxResponse {
42
}
43

44
message AddPeerRequest {
45
    string name = 1;
46
    string addr = 2;
47
    uint32 port = 3;
48
} 
49

50
message AddPeerResponse {
51
}
52

53
message BlockContainer {
54
    string hash = 1;
55
    BlockHeader header = 2;
56
    repeated TxContainer txs = 3;
57
    repeated SignatureItem validatorSignatures = 4;
58
}
59

60
message SignatureItem {
61
    string addr = 1;
62
    Signature signature = 2;
63
}
64

65
message BlockHeader {
66
    string merkleRoot = 1;
67
    string prevHash = 2;
68
    uint64 height = 3;
69
}
70

71
message TxContainer {
72
    Tx tx = 1;
73
    string hash = 2;
74
    optional uint64 orderInBlock = 3;
75
    Signature signature = 4;
76
    bytes pubKey = 5;
77
}
78

79
message Tx {
80
    uint64 index = 1;
81
    string to = 2;
82
    uint64 amount = 3;
83
}
84

85
message Signature {
86
    bytes r = 1;
87
    bytes s = 2;
88
}
89

90
message Account {
91
    string addr = 1;
92
    bytes pubKey = 2;
93
    uint64 balance = 3;
94
}
95

96
message Validator {
97
    string addr = 1;
98
    bytes pubKey = 2;
99
}

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.