Skip to content

Commit 0ea2809

Browse files
committed
add gRPCs from bip300301_enforcer/proto
1 parent 8277a6b commit 0ea2809

File tree

1 file changed

+98
-16
lines changed

1 file changed

+98
-16
lines changed

proto/cusf/mainchain/v1/mainchain.proto

+98-16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
syntax = "proto3";
44
package cusf.mainchain.v1;
55

6+
import "google/protobuf/wrappers.proto";
7+
68
enum AddressType {
79
ADDRESS_TYPE_UNSPECIFIED = 0;
810
ADDRESS_TYPE_DEFAULT = 1;
@@ -61,6 +63,13 @@ message BlockInfo {
6163
optional bytes bmm_commitment = 3;
6264
}
6365

66+
enum AckBundlesTag {
67+
ACK_BUNDLES_TAG_UNSPECIFIED = 0;
68+
ACK_BUNDLES_TAG_REPEAT_PREVIOUS = 1;
69+
ACK_BUNDLES_TAG_LEADING_BY_50 = 2;
70+
ACK_BUNDLES_TAG_UPVOTES = 3;
71+
}
72+
6473
service MainchainService {
6574
rpc BroadcastWithdrawalBundle(BroadcastWithdrawalBundleRequest)
6675
returns (BroadcastWithdrawalBundleResponse);
@@ -80,25 +89,30 @@ service MainchainService {
8089
returns (GetBmmHStarCommitmentsResponse);
8190
rpc GetChainInfo(GetChainInfoRequest) returns (GetChainInfoResponse);
8291
rpc GetChainTip(GetChainTipRequest) returns (GetChainTipResponse);
92+
rpc GetCoinbasePSBT(GetCoinbasePSBTRequest) returns (GetCoinbasePSBTResponse);
93+
rpc GetCtip(GetCtipRequest) returns (GetCtipResponse);
94+
rpc GetSidechainProposals(GetSidechainProposalsRequest)
95+
returns (GetSidechainProposalsResponse);
96+
rpc GetSidechains(GetSidechainsRequest) returns (GetSidechainsResponse);
8397
rpc GetTwoWayPegData(GetTwoWayPegDataRequest)
8498
returns (GetTwoWayPegDataResponse);
8599
rpc SubscribeEvents(SubscribeEventsRequest)
86100
returns (stream SubscribeEventsResponse);
87101
}
88102

89103
message BroadcastWithdrawalBundleRequest {
90-
uint32 sidechain_id = 1;
91-
bytes transaction = 2;
104+
google.protobuf.UInt32Value sidechain_id = 1;
105+
google.protobuf.BytesValue transaction = 2;
92106
}
93107
message BroadcastWithdrawalBundleResponse {
94108
}
95109

96110
message CreateBmmCriticalDataTransactionRequest {
97-
uint32 sidechain_id = 1;
98-
uint64 value_sats = 2;
99-
uint32 height = 3;
100-
bytes critical_hash = 4;
101-
bytes prev_bytes = 5;
111+
google.protobuf.UInt32Value sidechain_id = 1;
112+
google.protobuf.UInt64Value value_sats = 2;
113+
google.protobuf.UInt32Value height = 3;
114+
google.protobuf.BytesValue critical_hash = 4;
115+
google.protobuf.BytesValue prev_bytes = 5;
102116
}
103117
message CreateBmmCriticalDataTransactionResponse {
104118
bytes txid = 1;
@@ -123,30 +137,30 @@ message CreateNewAddressResponse {
123137
}
124138

125139
message GenerateBlocksRequest {
126-
uint32 blocks = 1;
140+
google.protobuf.UInt32Value blocks = 1;
127141
}
128142
message GenerateBlocksResponse {
129143
}
130144

131145
message GetBlockHeaderInfoRequest {
132-
bytes block_hash = 1;
146+
google.protobuf.BytesValue block_hash = 1;
133147
}
134148
message GetBlockHeaderInfoResponse {
135149
BlockHeaderInfo header_info = 1;
136150
}
137151

138152
message GetBlockInfoRequest {
139-
bytes block_hash = 1;
140-
uint32 sidechain_id = 2;
153+
google.protobuf.BytesValue block_hash = 1;
154+
google.protobuf.UInt32Value sidechain_id = 2;
141155
}
142156
message GetBlockInfoResponse {
143157
BlockHeaderInfo header_info = 1;
144158
BlockInfo block_info = 2;
145159
}
146160

147161
message GetBmmHStarCommitmentsRequest {
148-
bytes block_hash = 1;
149-
uint32 sidechain_id = 2;
162+
google.protobuf.BytesValue block_hash = 1;
163+
google.protobuf.UInt32Value sidechain_id = 2;
150164
}
151165
message GetBmmHStarCommitmentsResponse {
152166
message BlockNotFoundError {
@@ -173,10 +187,78 @@ message GetChainTipResponse {
173187
BlockHeaderInfo block_header_info = 1;
174188
}
175189

190+
message GetCoinbasePSBTRequest {
191+
message ProposeSidechain {
192+
google.protobuf.UInt32Value sidechain_number = 1;
193+
google.protobuf.BytesValue data = 2;
194+
}
195+
message AckSidechain {
196+
google.protobuf.UInt32Value sidechain_number = 1;
197+
google.protobuf.BytesValue data_hash = 2;
198+
}
199+
message ProposeBundle {
200+
google.protobuf.UInt32Value sidechain_number = 1;
201+
google.protobuf.BytesValue bundle_txid = 2;
202+
}
203+
message AckBundles {
204+
AckBundlesTag tag = 1;
205+
repeated uint32 upvotes = 2;
206+
}
207+
208+
209+
repeated ProposeSidechain propose_sidechains = 1;
210+
repeated AckSidechain ack_sidechains = 2;
211+
repeated ProposeBundle propose_bundles = 3;
212+
AckBundles ack_bundles = 4;
213+
}
214+
message GetCoinbasePSBTResponse {
215+
bytes psbt = 1;
216+
}
217+
218+
message GetCtipRequest {
219+
google.protobuf.UInt32Value sidechain_number = 1;
220+
}
221+
message GetCtipResponse {
222+
message Ctip {
223+
bytes txid = 1;
224+
uint32 vout = 2;
225+
uint64 value = 3;
226+
uint64 sequence_number = 4;
227+
}
228+
optional Ctip ctip = 1;
229+
}
230+
231+
message GetSidechainProposalsRequest {
232+
}
233+
message GetSidechainProposalsResponse {
234+
message SidechainProposal {
235+
uint32 sidechain_number = 1;
236+
bytes data = 2;
237+
bytes data_hash = 3;
238+
uint32 vote_count = 4;
239+
uint32 proposal_height = 5;
240+
uint32 proposal_age = 6;
241+
}
242+
repeated SidechainProposal sidechain_proposals = 1;
243+
}
244+
245+
message GetSidechainsRequest {
246+
}
247+
message GetSidechainsResponse {
248+
message SidechainInfo {
249+
uint32 sidechain_number = 1;
250+
bytes data = 2;
251+
uint32 vote_count = 3;
252+
uint32 proposal_height = 4;
253+
uint32 activation_height = 5;
254+
}
255+
repeated SidechainInfo sidechains = 1;
256+
}
257+
176258
message GetTwoWayPegDataRequest {
177-
uint32 sidechain_id = 1;
259+
google.protobuf.UInt32Value sidechain_id = 1;
178260
optional bytes start_block_hash = 2;
179-
bytes end_block_hash = 3;
261+
google.protobuf.BytesValue end_block_hash = 3;
180262
}
181263
message GetTwoWayPegDataResponse {
182264
message ResponseItem {
@@ -187,7 +269,7 @@ message GetTwoWayPegDataResponse {
187269
}
188270

189271
message SubscribeEventsRequest {
190-
uint32 sidechain_id = 1;
272+
google.protobuf.UInt32Value sidechain_id = 1;
191273
}
192274
message SubscribeEventsResponse {
193275
message Event {

0 commit comments

Comments
 (0)