Skip to content

Commit

Permalink
Merge pull request #377 from helium/andymck/service-provider-rewards
Browse files Browse the repository at this point in the history
Andymck/service provider rewards
  • Loading branch information
andymck authored Jan 5, 2024
2 parents 5e38bab + d3c28fd commit ed455af
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ pub mod services {
pub use admin_server::{Admin, AdminServer};
pub use authorization_client::AuthorizationClient;
pub use authorization_server::{Authorization, AuthorizationServer};
pub use carrier_service_client::CarrierServiceClient;
pub use carrier_service_server::{CarrierService, CarrierServiceServer};
pub use entity_client::EntityClient;
pub use entity_server::{Entity, EntityServer};
pub use gateway_client::GatewayClient;
Expand Down
24 changes: 24 additions & 0 deletions src/service/mobile_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,24 @@ message entity_verify_res_v1 {
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;
Expand Down Expand Up @@ -212,6 +230,12 @@ service entity {
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);
}

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.
Expand Down
31 changes: 31 additions & 0 deletions src/service/poc_mobile.proto
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,35 @@ message subscriber_reward {
uint64 discovery_location_amount = 2;
}

enum service_provider {
helium_mobile = 0;
}

message service_provider_reward {
// rewardable entity id of the service provider to which the reward will be
// credited
service_provider service_provider_id = 1;
/// Amount in bones rewarded
uint64 amount = 2;
}

enum unallocated_reward_type {
unallocated_reward_type_poc = 0;
unallocated_reward_type_discovery_location = 1;
unallocated_reward_type_mapper = 2;
unallocated_reward_type_service_provider = 3;
unallocated_reward_type_oracle = 4;
unallocated_reward_type_data = 5;
}

message unallocated_reward {
// the reward type representing a reward category to which an unallocated
// amount exists
unallocated_reward_type reward_type = 1;
/// Amount in bones unallocated
uint64 amount = 2;
}

message mobile_reward_share {
/// Unix timestamp in seconds of the start of the reward period
uint64 start_period = 1;
Expand All @@ -347,6 +376,8 @@ message mobile_reward_share {
radio_reward radio_reward = 3;
gateway_reward gateway_reward = 4;
subscriber_reward subscriber_reward = 5;
service_provider_reward service_provider_reward = 6;
unallocated_reward unallocated_reward = 7;
}
}

Expand Down

0 comments on commit ed455af

Please sign in to comment.