Skip to content

Commit 105f7af

Browse files
committed
add RPC for streaming events
1 parent 3d0bfa3 commit 105f7af

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

proto/sidechain.proto

+21-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ service Sidechain {
1515
rpc GetUtxoSet(GetUtxoSetRequest) returns (GetUtxoSetResponse);
1616
rpc GetWithdrawalBundle(GetWithdrawalBundleRequest)
1717
returns (GetWithdrawalBundleResponse);
18+
19+
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream EventResponse);
1820
}
1921

2022
message SubmitTransactionRequest {
@@ -59,12 +61,16 @@ message WithdrawalBundleEvent {
5961
WithdrawalBundleEventType withdrawal_bundle_event_type = 2;
6062
}
6163

62-
message ConnectMainBlockRequest {
64+
message MainBlockInfo {
6365
repeated Deposit deposits = 1;
6466
optional WithdrawalBundleEvent withdrawal_bundle_event = 2;
6567
repeated bytes bmm_hashes = 3;
6668
uint32 block_height = 4;
6769
bytes block_hash = 5;
70+
bytes prev_block_hash = 6;
71+
}
72+
message ConnectMainBlockRequest {
73+
MainBlockInfo main_block_info = 1;
6874
}
6975
message ConnectMainBlockResponse {
7076
}
@@ -88,3 +94,17 @@ message GetWithdrawalBundleRequest {
8894
message GetWithdrawalBundleResponse {
8995
bytes bundle = 1;
9096
}
97+
98+
message SubscribeEventsRequest {
99+
}
100+
message ConnectMainBlockEvent {
101+
MainBlockInfo main_block_info = 1;
102+
}
103+
message Event {
104+
oneof event {
105+
ConnectMainBlockEvent connect_block = 1;
106+
}
107+
}
108+
message EventResponse {
109+
Event event = 1;
110+
}

0 commit comments

Comments
 (0)