Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add logs #60

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use anyhow::Result;
use holochain_types::dna::{hash_type::Agent, HoloHash};
use hpos_hc_connect::{hha_agent::CoreAppAgent, holo_config::Config};
use std::collections::HashMap;
use tracing::{debug, error, info};
use tracing::{debug, error, info, trace};
use types::hbs::{HbsClient, KycLevel};
use types::PublishedHappDetails;
use utils::{
Expand Down Expand Up @@ -38,12 +38,17 @@ pub async fn run(config: &Config) -> Result<()> {
debug!("Got host credentials from hbs {:?}", host_credentials);

let mut core_app = CoreAppAgent::spawn(Some(config)).await?;
trace!("Connected to core app interface.");

// Suspend happs that have overdue payments
let pending_transactions = core_app.get_pending_transactions().await?;
trace!("Got pending_transactions : {:?}", pending_transactions);

let suspended_happs = get_suspended_happs(pending_transactions);
trace!("Got suspended_happs : {:#?}", suspended_happs);

let published_happs = get_all_published_hosted_happs(&mut core_app).await?;
trace!("Got published_happs : {:#?}", published_happs);

// Get happ jurisdictions AND publisher jurisdiction for each happ
let mut published_happ_details: HashMap<String, PublishedHappDetails> = HashMap::new();
Expand Down Expand Up @@ -72,6 +77,11 @@ pub async fn run(config: &Config) -> Result<()> {
let jurisdiction = core_app
.get_publisher_jurisdiction(publisher_pubkey.clone())
.await?;
trace!(
"Got jurisdiction for publisher {:?} : {:?}",
publisher_pubkey,
jurisdiction
);
publisher_jurisdictions.insert(publisher_pubkey, jurisdiction.clone());
published_happ_details.insert(
happ.happ_id.clone().to_string(),
Expand Down
2 changes: 0 additions & 2 deletions src/types/hbs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ impl HbsClient {
)
.await?;

tracing::trace!("Signature: {:?}", signature);

let connection = Self::connect()?;
let mut headers = reqwest::header::HeaderMap::new();

Expand Down
1 change: 1 addition & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use holochain_types::dna::ActionHashB64;
use holochain_types::prelude::{holochain_serial, SerializedBytes};
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Clone)]
pub struct HappBundle {
pub happ_id: ActionHashB64,
pub bundle_url: String,
Expand Down
5 changes: 2 additions & 3 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ pub async fn install_holo_hosted_happs(
.await
.context("failed to get enabled hApps")?,
);
trace!("enabled_happ_ids {:?}", enabled_happ_ids);

let client = reqwest::Client::new();
trace!("enabled_happ_ids {:#?}", enabled_happ_ids);

// Iterate through the vec and
// Call http://localhost/api/v2/apps/hosted/install
Expand Down Expand Up @@ -379,6 +377,7 @@ pub async fn install_holo_hosted_happs(
preferences: preferences.clone(),
membrane_proofs: mem_proof.clone(),
};
let client = reqwest::Client::new();
let response = client
.post("http://localhost/api/v2/apps/hosted/install")
.json(&body)
Expand Down
Loading