Skip to content

Commit

Permalink
mirror mobile metadata to iot metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgrunewald committed Apr 5, 2023
1 parent ceecb05 commit 97ba0bd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
3 changes: 3 additions & 0 deletions src/service/iot_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,11 @@ message gateway_metadata {
}

message gateway_info {
// The public key binary address and on-chain identity of the gateway
bytes address = 1;
// Whether or not the hotspot participates in PoC or only transfers data
bool is_full_hotspot = 2;
// The gateway's metadata as recorded on the blockchain
gateway_metadata metadata = 3;
}

Expand Down
45 changes: 25 additions & 20 deletions src/service/mobile_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,47 @@ package helium.mobile_config;
// - 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 hotspot_metadata {
// The public key binary address and on-chain identity of the hotspot
bytes address = 1;
// The res12 h3 index asserted address of the hotspot as a string
// where an unasserted hotspot returns an empty string
message gateway_metadata {
// The res12 h3 index asserted address of the gateway as a string
// where an unasserted gateway returns an empty string
string location = 2;
}

message hotspot_metadata_req_v1 {
// The public key address of the hotspot to look up
message gateway_info {
// 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;
}

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 hotspot_metadata_res_v1 {
hotspot_metadata metadata = 1;
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 hotspot_metadata_stream_req_v1 {
// max number of hotspot metadata in each message of the response stream
message gateway_info_stream_req_v1 {
// 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;
}

message hotspot_metadata_stream_res_v1 {
// a list of hotspot metadata numbering up to the request batch size
repeated hotspot_metadata hotspots = 1;
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
Expand Down Expand Up @@ -143,12 +148,12 @@ message admin_key_res_v1 {
// Service Definitions
// ------------------------------------------------------------------

service hotspot {
// Get metadata info for the specified hotspot
rpc metadata(hotspot_metadata_req_v1) returns (hotspot_metadata_res_v1);
// Get a stream of hotspot metadata
rpc metadata_stream(hotspot_metadata_stream_req_v1)
returns (stream hotspot_metadata_stream_res_v1);
service gateway {
// Get info for the specified gateway
rpc info(gateway_info_req_v1) returns (gateway_info_res_v1);
// Get a stream of gateway info
rpc info_stream(gateway_info_stream_req_v1)
returns (stream gateway_info_stream_res_v1);
}

service router {
Expand Down

0 comments on commit 97ba0bd

Please sign in to comment.