forked from hyperledger-archives/burrow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpcevents.proto
128 lines (114 loc) · 4.37 KB
/
rpcevents.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
syntax = 'proto3';
option go_package = "github.com/hyperledger/burrow/rpc/rpcevents";
import "gogoproto/gogo.proto";
import "exec.proto";
package rpcevents;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.stable_marshaler_all) = true;
option (gogoproto.sizer_all) = true;
// Enable registration with golang/protobuf for the grpc-gateway.
option (gogoproto.goproto_registration) = true;
// Enable generation of XXX_MessageName methods for grpc-go/status.
option (gogoproto.messagename_all) = true;
//--------------------------------------------------
// Execution events
service ExecutionEvents {
// Get StreamEvents (including transactions) for a range of block heights
rpc Stream (BlocksRequest) returns (stream exec.StreamEvent);
// Get a particular TxExecution by hash
rpc Tx (TxRequest) returns (exec.TxExecution);
// GetEvents provides events streaming one block at a time - that is all events emitted in a particular block
// are guaranteed to be delivered in each GetEventsResponse
rpc Events (BlocksRequest) returns (stream EventsResponse);
}
message GetBlockRequest {
// Height of block required
uint64 Height = 1;
// Whether to wait for the block to become available
bool Wait = 2;
}
message TxRequest {
// Height of block required
bytes TxHash = 1 [(gogoproto.customtype) = "github.com/hyperledger/burrow/binary.HexBytes", (gogoproto.nullable) = false];
// Whether to wait for the block to become available
bool Wait = 2;
}
message BlocksRequest {
BlockRange BlockRange = 1;
// Specify a query on which to match the tags of events.
// Tag | Match type | Values
// -----------------------------------------
// All events
// -----------------------------------------
// TxType | String | "UnknownTx", "SendTx", "CallTx", "NameTx", "BondTx", "UnbondTx", "PermissionsTx", "GovernanceTx"
// TxHash | String | bytes
// EventType | String | "CallEvent", "LogEvent", "AccountInputEvent", "AccountOutputEvent"
// EventID | String | string
// Height | Integer | uint64
// Index | Integer | uint64
// MessageType | String | Go type name
// -----------------------------------------
// Log event
// -----------------------------------------
// Address | String | Address (hex)
// Log<0-4> | String | Word256 (hex)
// Log<0-4>Text | String | string (trimmed)
// -----------------------------------------
// Call event
// -----------------------------------------
// Origin | String | Address (hex)
// Callee | String | Address (hex)
// Caller | String | Address (hex)
// Value | Integer | uint64
// Gas | Integer | uint64
// StackDepth | Integer | uint64
// Exception | String | string
// -----------------------------------------
// Tx event (input/output)
// -----------------------------------------
// Exception | String | string
//
// For example:
// EventType = 'LogEvent' AND EventID CONTAINS 'bar' AND TxHash = '020304' AND Height >= 34 AND Index < 3 AND Address = 'DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF'
string Query = 2;
}
message EventsResponse {
uint64 Height = 1;
repeated exec.Event Events = 2;
}
message GetTxsRequest {
uint64 StartHeight = 1;
uint64 EndHeight = 2;
string Query = 3;
}
message GetTxsResponse {
uint64 Height = 1;
repeated exec.TxExecution TxExecutions = 2;
}
message Bound {
BoundType Type = 1;
uint64 Index = 2;
enum BoundType {
// Index is absolute index of an item
ABSOLUTE = 0;
// Index is an offset relative to last item
RELATIVE = 1;
// The first block
FIRST = 2;
// Ignore provided index and evaluate to latest index
LATEST = 3;
// Ignore provided index and stream new objects as they are generated
STREAM = 4;
}
}
// An inclusive range of blocks to include in output
message BlockRange {
// Bounds can be set to:
// absolute: block height
// relative: block height counting back from latest
// latest: latest block when call is processed
// stream: for End keep sending new blocks, for start same as latest
Bound Start = 1;
Bound End = 2;
}