-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathmobile_config.proto
417 lines (371 loc) · 12.5 KB
/
mobile_config.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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
syntax = "proto3";
package helium.mobile_config;
import "hex_boosting.proto";
import "service_provider.proto";
import "reward_manifest.proto";
// ------------------------------------------------------------------
// Message Definitions
// ------------------------------------------------------------------
// == Field Notes ==
//
// - Every message including a `signature` field will need to be signed over the
// complete message, with the `signature` field set to an empty value.
// Requests are expected to be signed by the client to validate authorization
// to make the request and responses are signed by the mobile_config server to
// ensure validity of the data returned
//
// - Keypair fields are binary encoded public keys, Rust encoding example here:
// https://github.com/helium/helium-crypto-rs/blob/main/src/public_key.rs#L347-L354
message wifi_deployment_info {
// antenna id
uint32 antenna = 1;
// The height of the hotspot above ground level in whole meters
uint32 elevation = 2;
uint32 azimuth = 3;
uint32 mechanical_down_tilt = 4;
uint32 electrical_down_tilt = 5;
}
message cbrs_deployment_info {
repeated cbrs_radio_deployment_info cbrs_radios_deployment_info = 1;
}
message cbrs_radio_deployment_info {
// CBSD_ID
string radio_id = 1;
// The asserted elevation of the gateway above ground level in whole meters
uint32 elevation = 2;
}
message gateway_metadata {
option deprecated = true;
// The res12 h3 index asserted address of the gateway as a string
// where an unasserted gateway returns an empty string
string location = 2;
}
message gateway_metadata_v2 {
// The res12 h3 index asserted address of the gateway as a string
// where an unasserted gateway returns an empty string
string location = 2;
oneof deployment_info {
wifi_deployment_info wifi_deployment_info = 3;
cbrs_deployment_info cbrs_deployment_info = 4;
}
}
message gateway_info {
option deprecated = true;
// The public key binary address and on-chain identity of the gateway
bytes address = 1;
// The gateway metadata as recorded on the blockchain
gateway_metadata metadata = 2;
// the asserted device type of the gateway
device_type device_type = 3;
}
message gateway_info_v2 {
// The public key binary address and on-chain identity of the gateway
bytes address = 1;
// The gateway metadata as recorded on the blockchain
gateway_metadata_v2 metadata = 2;
// the asserted device type of the gateway
device_type device_type = 3;
// The unix epoch timestamp (in seconds)
// when the gateway was first added to the database.
uint64 created_at = 4;
// The unix epoch timestamp (in seconds)
// when the gateway parameters (highly possible) were changed in the database.
uint64 updated_at = 5;
}
message gateway_info_req_v1 {
// The public key address of the gateway to look up
bytes address = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
bytes signature = 3;
}
message gateway_info_batch_req_v1 {
// List of public key addresses of gateways to look up
repeated bytes addresses = 1;
// max number of gateway info records in each message of the response stream
uint32 batch_size = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message gateway_info_res_v1 {
gateway_info info = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message gateway_info_res_v2 {
gateway_info_v2 info = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message gateway_info_stream_req_v1 {
option deprecated = true;
// max number of gateway info records in each message of the response stream
uint32 batch_size = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
bytes signature = 3;
// Device types that will be returned in the response
// Returns all devices if empty
repeated device_type device_types = 4;
}
message gateway_info_stream_req_v2 {
// max number of gateway info records in each message of the response stream
uint32 batch_size = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
bytes signature = 3;
// Device types that will be returned in the response
// Returns all devices if empty
repeated device_type device_types = 4;
// The Unix epoch timestamp (in seconds).
// Filters the response based on the last time gateway parameter(s) was
// updated. Use 0 to fetch all gateways.
uint64 min_updated_at = 5;
}
message gateway_info_stream_res_v1 {
// a list of gateway info numbering up to the request batch size
repeated gateway_info gateways = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message gateway_info_stream_res_v2 {
// a list of gateway info numbering up to the request batch size
repeated gateway_info_v2 gateways = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message entity_verify_req_v1 {
// binary identifier of the entity
bytes entity_id = 1;
// pubkey binary of the requestor signing keypair
bytes signer = 2;
bytes signature = 3;
}
message entity_verify_res_v1 {
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the requestor signing keypair
bytes signer = 3;
bytes signature = 4;
}
message carrier_key_to_entity_req_v1 {
// string representation of the helium pubkey of the carrier
string pubkey = 1;
// pubkey binary of the requestor signing keypair
bytes signer = 2;
bytes signature = 3;
}
message carrier_key_to_entity_res_v1 {
// unix epoch timestamp in seconds
uint64 timestamp = 1;
// string representing the entity key
string entity_key = 2;
// pubkey binary of the requestor signing keypair
bytes signer = 3;
bytes signature = 4;
}
enum admin_key_role {
// administrative operator key
administrator = 0;
// routing infrastructure key for routing streams
router = 1;
// keys for verifying requests from other oracles
oracle = 2;
// carrier authorizing keys for signing mobile subscriber activity
carrier = 3;
// propagation calculation service of a mobile carrier
pcs = 4;
}
enum network_key_role {
mobile_carrier = 0;
mobile_router = 1;
// Keys from the Propagation Calculation Service
mobile_pcs = 2;
}
enum device_type {
cbrs = 0;
wifi_indoor = 1;
wifi_outdoor = 2;
wifi_data_only = 3;
}
message authorization_verify_req_v1 {
// the pubkey binary of the authorized entity being verified
bytes pubkey = 1;
// the associated role being verified for the key
network_key_role role = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
// Signature over the request by the requesting oracle
bytes signature = 4;
}
message authorization_verify_res_v1 {
// unix epoch timestamp in seconds
uint64 timestamp = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
// Signature over the response by the config service
bytes signature = 3;
}
message authorization_list_req_v1 {
// role of the keys being requested
network_key_role role = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
// Signature over the request by the requesting oracle
bytes signature = 3;
}
message authorization_list_res_v1 {
// List of public key binaries of all registered entities by requested role
repeated bytes pubkeys = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
// Signature over the response by the config service
bytes signature = 4;
}
message admin_add_key_req_v1 {
bytes pubkey = 1;
admin_key_role role = 2;
// unix epoch timestamp in seconds
uint64 timestamp = 3;
// pubkey binary of the signing keypair
bytes signer = 4;
// Signature of the request message signed by an admin key
// already registered to the config service
bytes signature = 5;
}
message admin_remove_key_req_v1 {
bytes pubkey = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
// Signature of the request message signed by an admin key
// already registered to the config service
bytes signature = 4;
admin_key_role role = 5;
}
message admin_key_res_v1 {
// unix epoch timestamp in seconds
uint64 timestamp = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
// Signature over the response by the config service
bytes signature = 3;
}
message boosted_hex_info_stream_req_v1 {
// max number of boosted hex info records in each message of the response
// stream
uint32 batch_size = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
bytes signature = 3;
}
message boosted_hex_modified_info_stream_req_v1 {
// max number of boosted hex info records in each message of the response
// stream
uint32 batch_size = 1;
// return only those records which were modified after the specified timestamp
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message boosted_hex_info_stream_res_v1 {
// a list of boosted hex info
repeated boosted_hex_info_v1 hexes = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}
message carrier_incentive_promotion_list_req_v1 {
// unix epoch timestamp in seconds
uint64 timestamp = 1;
bytes signer = 2;
bytes signature = 3;
}
message carrier_incentive_promotion_list_res_v1 {
bytes signer = 1;
bytes signature = 2;
repeated service_provider_promotions service_provider_promotions = 3;
}
// ------------------------------------------------------------------
// Service Definitions
// ------------------------------------------------------------------
service gateway {
// Get info for the specified gateway
rpc info(gateway_info_req_v1) returns (gateway_info_res_v1) {
option deprecated = true;
}
// Get info for a batch of gateways specified by public key
rpc info_batch(gateway_info_batch_req_v1)
returns (stream gateway_info_stream_res_v1) {
option deprecated = true;
}
// Get a stream of gateway info
rpc info_stream(gateway_info_stream_req_v1)
returns (stream gateway_info_stream_res_v1) {
option deprecated = true;
}
// V2
// Get info for the specified gateway (V2)
rpc info_v2(gateway_info_req_v1) returns (gateway_info_res_v2);
// Get a stream of gateway info (V2)
rpc info_stream_v2(gateway_info_stream_req_v2)
returns (stream gateway_info_stream_res_v2);
// Get info for a batch of gateways specified by public key (V2)
rpc info_batch_v2(gateway_info_batch_req_v1)
returns (stream gateway_info_stream_res_v2);
}
service entity {
// Verify the rewardable entity (mobile subscriber) is registered to the chain
rpc verify(entity_verify_req_v1) returns (entity_verify_res_v1);
}
service carrier_service {
// Retrieve an entity key for the specified helium pubkey
rpc key_to_entity(carrier_key_to_entity_req_v1)
returns (carrier_key_to_entity_res_v1);
rpc list_incentive_promotions(carrier_incentive_promotion_list_req_v1)
returns (carrier_incentive_promotion_list_res_v1);
}
service authorization {
// Submit a pubkey binary and network key role for an authorized entity on the
// mobile network to verify if it is registered with the given role.
// `mobile_router` keys have data transfer burn authority while
// `mobile_carrier` keys have subscriber activity report signing authority
rpc verify(authorization_verify_req_v1) returns (authorization_verify_res_v1);
// Retrieve a list of all registered pubkey binaries registered to the config
// service with the requested role
rpc list(authorization_list_req_v1) returns (authorization_list_res_v1);
}
service admin {
// Authorize a public key for validating trusted rpcs
rpc add_key(admin_add_key_req_v1) returns (admin_key_res_v1);
// Deauthorize a public key for validating trusted rpcs
rpc remove_key(admin_remove_key_req_v1) returns (admin_key_res_v1);
}
service hex_boosting {
// Get a stream of hex boost info
rpc info_stream(boosted_hex_info_stream_req_v1)
returns (stream boosted_hex_info_stream_res_v1);
// Get a stream of modified hex boost info since the specified timestamp
rpc modified_info_stream(boosted_hex_modified_info_stream_req_v1)
returns (stream boosted_hex_info_stream_res_v1);
}