-
Notifications
You must be signed in to change notification settings - Fork 624
/
query.proto
242 lines (209 loc) · 9.01 KB
/
query.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
syntax = "proto3";
package ibc.core.client.v1;
option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos/query/v1/query.proto";
import "ibc/core/client/v1/client.proto";
import "ibc/core/commitment/v1/commitment.proto";
import "google/protobuf/any.proto";
import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
// Query provides defines the gRPC querier service
service Query {
// ClientState queries an IBC light client.
rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) {
option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}";
}
// ClientStates queries all the IBC light clients of a chain.
rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) {
option (google.api.http).get = "/ibc/core/client/v1/client_states";
}
// ConsensusState queries a consensus state associated with a client state at
// a given height.
rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) {
option (google.api.http).get = "/ibc/core/client/v1/consensus_states/"
"{client_id}/revision/{revision_number}/"
"height/{revision_height}";
}
// ConsensusStates queries all the consensus state associated with a given
// client.
rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) {
option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}";
}
// ConsensusStateHeights queries the height of every consensus states associated with a given client.
rpc ConsensusStateHeights(QueryConsensusStateHeightsRequest) returns (QueryConsensusStateHeightsResponse) {
option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}/heights";
}
// Status queries the status of an IBC client.
rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) {
option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}";
}
// ClientParams queries all parameters of the ibc client submodule.
rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) {
option (google.api.http).get = "/ibc/core/client/v1/params";
}
// UpgradedClientState queries an Upgraded IBC light client.
rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) {
option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states";
}
// UpgradedConsensusState queries an Upgraded IBC consensus state.
rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) {
option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states";
}
// VerifyMembership queries an IBC light client for proof verification of a value at a given key path.
rpc VerifyMembership(QueryVerifyMembershipRequest) returns (QueryVerifyMembershipResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http) = {
post: "/ibc/core/client/v1/verify_membership"
body: "*"
};
}
}
// QueryClientStateRequest is the request type for the Query/ClientState RPC
// method
message QueryClientStateRequest {
// client state unique identifier
string client_id = 1;
}
// QueryClientStateResponse is the response type for the Query/ClientState RPC
// method. Besides the client state, it includes a proof and the height from
// which the proof was retrieved.
message QueryClientStateResponse {
// client state associated with the request identifier
google.protobuf.Any client_state = 1;
// merkle proof of existence
bytes proof = 2;
// height at which the proof was retrieved
ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
}
// QueryClientStatesRequest is the request type for the Query/ClientStates RPC
// method
message QueryClientStatesRequest {
// pagination request
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryClientStatesResponse is the response type for the Query/ClientStates RPC
// method.
message QueryClientStatesResponse {
// list of stored ClientStates of the chain.
repeated IdentifiedClientState client_states = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"];
// pagination response
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryConsensusStateRequest is the request type for the Query/ConsensusState
// RPC method. Besides the consensus state, it includes a proof and the height
// from which the proof was retrieved.
message QueryConsensusStateRequest {
// client identifier
string client_id = 1;
// consensus state revision number
uint64 revision_number = 2;
// consensus state revision height
uint64 revision_height = 3;
// latest_height overrides the height field and queries the latest stored
// ConsensusState
bool latest_height = 4;
}
// QueryConsensusStateResponse is the response type for the Query/ConsensusState
// RPC method
message QueryConsensusStateResponse {
// consensus state associated with the client identifier at the given height
google.protobuf.Any consensus_state = 1;
// merkle proof of existence
bytes proof = 2;
// height at which the proof was retrieved
ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
}
// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates
// RPC method.
message QueryConsensusStatesRequest {
// client identifier
string client_id = 1;
// pagination request
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryConsensusStatesResponse is the response type for the
// Query/ConsensusStates RPC method
message QueryConsensusStatesResponse {
// consensus states associated with the identifier
repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false];
// pagination response
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights
// RPC method.
message QueryConsensusStateHeightsRequest {
// client identifier
string client_id = 1;
// pagination request
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryConsensusStateHeightsResponse is the response type for the
// Query/ConsensusStateHeights RPC method
message QueryConsensusStateHeightsResponse {
// consensus state heights
repeated Height consensus_state_heights = 1 [(gogoproto.nullable) = false];
// pagination response
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC
// method
message QueryClientStatusRequest {
// client unique identifier
string client_id = 1;
}
// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC
// method. It returns the current status of the IBC client.
message QueryClientStatusResponse {
string status = 1;
}
// QueryClientParamsRequest is the request type for the Query/ClientParams RPC
// method.
message QueryClientParamsRequest {}
// QueryClientParamsResponse is the response type for the Query/ClientParams RPC
// method.
message QueryClientParamsResponse {
// params defines the parameters of the module.
Params params = 1;
}
// QueryUpgradedClientStateRequest is the request type for the
// Query/UpgradedClientState RPC method
message QueryUpgradedClientStateRequest {}
// QueryUpgradedClientStateResponse is the response type for the
// Query/UpgradedClientState RPC method.
message QueryUpgradedClientStateResponse {
// client state associated with the request identifier
google.protobuf.Any upgraded_client_state = 1;
}
// QueryUpgradedConsensusStateRequest is the request type for the
// Query/UpgradedConsensusState RPC method
message QueryUpgradedConsensusStateRequest {}
// QueryUpgradedConsensusStateResponse is the response type for the
// Query/UpgradedConsensusState RPC method.
message QueryUpgradedConsensusStateResponse {
// Consensus state associated with the request identifier
google.protobuf.Any upgraded_consensus_state = 1;
}
// QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method
message QueryVerifyMembershipRequest {
// client unique identifier.
string client_id = 1;
// the proof to be verified by the client.
bytes proof = 2;
// the height of the commitment root at which the proof is verified.
ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
// the commitment key path.
ibc.core.commitment.v1.MerklePath merkle_path = 4 [(gogoproto.nullable) = false];
// the value which is proven.
bytes value = 5;
// optional time delay
uint64 time_delay = 6;
// optional block delay
uint64 block_delay = 7;
}
// QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method
message QueryVerifyMembershipResponse {
// boolean indicating success or failure of proof verification.
bool success = 1;
}