Skip to content

Commit

Permalink
use latest proto definitions, fix misc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Nov 22, 2024
1 parent 7b049a6 commit 86a37fb
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 91 deletions.
51 changes: 17 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ sqlx = { git = "https://github.com/launchbadge/sqlx.git", rev = "42dd78fe931df65
# Patching for beacon must point directly to the crate, it will not look in the
# repo for sibling crates.
#
# [patch.'https://github.com/helium/proto']
# helium-proto = { path = "../../proto" }
[patch.'https://github.com/helium/proto']
helium-proto = { path = "../../proto" }
# beacon = { path = "../../proto" }
8 changes: 4 additions & 4 deletions iot_config/src/client/sub_dao_client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{call_with_retry, ClientError, Settings};
use crate::sub_dao_epoch_reward_info::ResolvedSubDaoEpochRewardInfo;
use file_store::traits::MsgVerify;
use helium_crypto::{Keypair, PublicKey, PublicKeyBinary, Sign};
use helium_crypto::{Keypair, PublicKey, Sign};
use helium_proto::{
services::{
sub_dao::{self, SubDaoEpochRewardInfoReqV1},
Expand Down Expand Up @@ -39,7 +39,7 @@ pub trait SubDaoEpochRewardInfoResolver: Clone + Send + Sync + 'static {

async fn resolve_info(
&self,
sub_dao: &PublicKeyBinary,
sub_dao: &str,
epoch: u64,
) -> Result<Option<ResolvedSubDaoEpochRewardInfo>, Self::Error>;
}
Expand All @@ -50,11 +50,11 @@ impl SubDaoEpochRewardInfoResolver for SubDaoClient {

async fn resolve_info(
&self,
sub_dao: &PublicKeyBinary,
sub_dao: &str,
epoch: u64,
) -> Result<Option<ResolvedSubDaoEpochRewardInfo>, Self::Error> {
let mut request = SubDaoEpochRewardInfoReqV1 {
sub_dao_pubkey: sub_dao.clone().into(),
sub_dao_address: sub_dao.into(),
epoch,
signer: self.signing_key.public_key().into(),
signature: vec![],
Expand Down
13 changes: 11 additions & 2 deletions iot_config/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ use anyhow::{Error, Result};
use clap::Parser;
use futures::future::LocalBoxFuture;
use futures_util::TryFutureExt;
use helium_proto::services::iot_config::{AdminServer, GatewayServer, OrgServer, RouteServer};
use helium_proto::services::{
iot_config::{AdminServer, GatewayServer, OrgServer, RouteServer},
sub_dao::SubDaoServer,
};
use iot_config::sub_dao_service::SubDaoService;
use iot_config::{
admin::AuthCache, admin_service::AdminService, db_cleaner::DbCleaner,
gateway_service::GatewayService, org, org_service::OrgService, region_map::RegionMapReader,
Expand Down Expand Up @@ -72,7 +76,7 @@ impl Daemon {

let gateway_svc = GatewayService::new(
settings,
metadata_pool,
metadata_pool.clone(),
region_map.clone(),
auth_cache.clone(),
delegate_key_cache,
Expand All @@ -98,6 +102,8 @@ impl Daemon {
region_updater,
)?;

let subdao_svc = SubDaoService::new(settings, auth_cache.clone(), metadata_pool)?;

let listen_addr = settings.listen;
let pubkey = settings
.signing_keypair()
Expand All @@ -111,6 +117,7 @@ impl Daemon {
route_svc,
org_svc,
admin_svc,
subdao_svc,
};

let db_cleaner = DbCleaner::new(pool.clone(), settings.deleted_entry_retention);
Expand All @@ -130,6 +137,7 @@ pub struct GrpcServer {
route_svc: RouteService,
org_svc: OrgService,
admin_svc: AdminService,
subdao_svc: SubDaoService,
}

impl ManagedTask for GrpcServer {
Expand All @@ -146,6 +154,7 @@ impl ManagedTask for GrpcServer {
.add_service(OrgServer::new(self.org_svc))
.add_service(RouteServer::new(self.route_svc))
.add_service(AdminServer::new(self.admin_svc))
.add_service(SubDaoServer::new(self.subdao_svc))
.serve(self.listen_addr)
.map_err(Error::from);

Expand Down
Loading

0 comments on commit 86a37fb

Please sign in to comment.