From e6175e628530f3b3b44bbab2b7345a47e4e9b568 Mon Sep 17 00:00:00 2001 From: jeffgrunewald Date: Wed, 5 Apr 2023 10:33:48 -0400 Subject: [PATCH] mirror mobile metadata to iot metadata --- src/lib.rs | 4 +-- src/service/iot_config.proto | 3 +++ src/service/mobile_config.proto | 45 ++++++++++++++++++--------------- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index fa2ef045..80acf354 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,8 +30,8 @@ pub mod services { pub mod mobile_config { include!(concat!(env!("OUT_DIR"), "/helium.mobile_config.rs")); pub use admin_server::{Admin, AdminServer}; - pub use hotspot_client::HotspotClient; - pub use hotspot_server::{Hotspot, HotspotServer}; + pub use gateway_client::GatewayClient; + pub use gateway_server::{Gateway, GatewayServer}; pub use router_client::RouterClient; pub use router_server::{Router, RouterServer}; } diff --git a/src/service/iot_config.proto b/src/service/iot_config.proto index 45b81fbe..d8d868f8 100644 --- a/src/service/iot_config.proto +++ b/src/service/iot_config.proto @@ -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; } diff --git a/src/service/mobile_config.proto b/src/service/mobile_config.proto index 320757e0..e6ec23b0 100644 --- a/src/service/mobile_config.proto +++ b/src/service/mobile_config.proto @@ -17,24 +17,29 @@ 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 @@ -42,17 +47,17 @@ message hotspot_metadata_res_v1 { 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 @@ -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 {