diff --git a/src/bin/brain.rs b/src/bin/brain.rs index 52b0547..25e4a0d 100644 --- a/src/bin/brain.rs +++ b/src/bin/brain.rs @@ -22,6 +22,7 @@ async fn main() { } env_logger::builder() .filter_level(log::LevelFilter::Trace) + .filter_module("rustls", log::LevelFilter::Debug) .filter_module("tungstenite", log::LevelFilter::Debug) .filter_module("tokio_tungstenite", log::LevelFilter::Debug) .init(); diff --git a/src/db/app.rs b/src/db/app.rs index 972749c..7e445a6 100644 --- a/src/db/app.rs +++ b/src/db/app.rs @@ -136,7 +136,7 @@ impl NewAppReq { pub async fn submit(self, db: &Surreal) -> Result<(), Error> { let locked_nano = self.locked_nano; - let tx_query = format!( " + let tx_query = format!(" BEGIN TRANSACTION; LET $account = $account_input; @@ -153,7 +153,6 @@ impl NewAppReq { }}; UPDATE $account SET tmp_locked += {locked_nano}; - RELATE $account ->$new_app_req @@ -164,8 +163,7 @@ impl NewAppReq { vcpus: {}, disk_size_gb: {}, locked_nano: {locked_nano}, price_per_unit: {}, error: '', }}; - COMMIT TRANSACTION; - ", + COMMIT TRANSACTION;", self.ports, self.memory_mb, self.vcpus, self.disk_size_gb, self.price_per_unit); log::trace!("submit_new_app_req query: {tx_query}"); @@ -346,7 +344,7 @@ impl ActiveApp { app_node: new_app_req.app_node, app_name: new_app_req.app_name, mapped_ports, - host_ipv4: String::new(), + host_ipv4: new_app_res.ip_address, vcpus: new_app_req.vcpus, memory_mb: new_app_req.memory_mb, disk_size_gb: new_app_req.disk_size_gb, diff --git a/src/grpc/types.rs b/src/grpc/types.rs index a9fe2a1..e75e3f2 100644 --- a/src/grpc/types.rs +++ b/src/grpc/types.rs @@ -291,7 +291,7 @@ impl From for AppContract { nano_per_minute: value.price_per_unit, locked_nano: value.locked_nano, collected_at: value.collected_at.to_rfc3339(), - hratls_pubkey: value.mr_enclave, + hratls_pubkey: value.hratls_pubkey, public_package_mr_enclave, app_name: value.app_name, }