diff --git a/.updater/latest.json b/.updater/latest.json index a4cbc0995..0d6333d62 100644 --- a/.updater/latest.json +++ b/.updater/latest.json @@ -1,19 +1,19 @@ { - "version": "0.1.13", + "version": "0.1.16", "notes": "Tari Universe - See the assets to download this version and install", - "pub_date": "2024-08-03T07:56:29.007Z", + "pub_date": "2024-08-05T20:15:15.500Z", "platforms": { "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFd4QTNrbVpkZy82Y2xsbitud01adGJXdFk3UTB6V0p6VXdTL0lHd0FBUWhhS3g4Zy9qZG1DVXVxa2ZmSGZ6VWlYRUw1cVNmK3lZUWpiNzNIeWJ3K1FNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyNjcxMTI2CWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CjBCUnc4RERvZmFqcFU4Q2NFcUVsalV5NWJZNU1TZ1RycHVzdkUyUlo0azRrUktBTW83MytyaWpvNDJwcmx6YUNxY09JbDh6dXVudC9mdlF2YU5aZkFnPT0K", - "url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.13/tari-universe-debug_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFRaL285VkNFRG1vU1NkdnptNERweG5DQk40Q3h6S0xzLzdhUWxqWUtpUm5QdStreW5YeVlWYXFtUy9wblNaa0wxeTN6dDJQaSs0eHJCVW4vVHRiQ0FrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyODg4NTYwCWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CkF2Z0xSWTZacThpUThvc3dDVmxZR0ZnT2VBS3ZpQ2Y4M3JTM3B5ZHJFS1paQnNsLzhTUGw0UDVmSHB2SmUzeVJuclpYYVUxbWdvWGFpa3hMUXRiOEJ3PT0K", + "url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.16/tari-universe-debug_universal.app.tar.gz" }, "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFd4QTNrbVpkZy82Y2xsbitud01adGJXdFk3UTB6V0p6VXdTL0lHd0FBUWhhS3g4Zy9qZG1DVXVxa2ZmSGZ6VWlYRUw1cVNmK3lZUWpiNzNIeWJ3K1FNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyNjcxMTI2CWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CjBCUnc4RERvZmFqcFU4Q2NFcUVsalV5NWJZNU1TZ1RycHVzdkUyUlo0azRrUktBTW83MytyaWpvNDJwcmx6YUNxY09JbDh6dXVudC9mdlF2YU5aZkFnPT0K", - "url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.13/tari-universe-debug_universal.app.tar.gz" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFRaL285VkNFRG1vU1NkdnptNERweG5DQk40Q3h6S0xzLzdhUWxqWUtpUm5QdStreW5YeVlWYXFtUy9wblNaa0wxeTN6dDJQaSs0eHJCVW4vVHRiQ0FrPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyODg4NTYwCWZpbGU6dGFyaS11bml2ZXJzZS5hcHAudGFyLmd6CkF2Z0xSWTZacThpUThvc3dDVmxZR0ZnT2VBS3ZpQ2Y4M3JTM3B5ZHJFS1paQnNsLzhTUGw0UDVmSHB2SmUzeVJuclpYYVUxbWdvWGFpa3hMUXRiOEJ3PT0K", + "url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.16/tari-universe-debug_universal.app.tar.gz" }, "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOGRENUlCNFc2dzVjWWFyekwvOUg0bHV0aXlHVjE5ZlhlUkYzeG9URkdpTzl6WmEweXdqQk5EU2tGTEFENDZMM004OW4vYmlGMTFwU2Rkd1RkTU1wUXdvPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyNjcxNzgzCWZpbGU6dGFyaS11bml2ZXJzZV8wLjEuMTNfeDY0X2VuLVVTLm1zaS56aXAKV3l4UVp5a3MvYS9nUDd1QU9JWlRGdFVGQmI2Q0drd2JDU2YxUkp5TkNWdnJLVTJFQU5ucFB4ZnJTTXpmK25iN2R2a2hvOGFsRWI2L1ZDZElPUmcyQkE9PQo=", - "url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.13/tari-universe_0.1.13_x64_en-US-debug.msi.zip" + "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVRbUtvKzlyYWhiOFM3SWlubWgzMENDV1k0K0g4VUlpQUpTYjZ4cFNpT2Q2YmxwQnl0WlhObWxzYlJSeGkxY1RkdVc2N1RaZFlJcTg2Slh4TXFPRXdWWUtYNkhXTE9pK1FzPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzIyODg4OTExCWZpbGU6dGFyaS11bml2ZXJzZV8wLjEuMTZfeDY0X2VuLVVTLm1zaS56aXAKTm43Wnk1Y056VS9MZjNFaklhMEp4T1A5VjRGU3A3bGlmU3hmMEpaMzdPcURyMVMzd211V2FVK1pkSW9Gd2p1c3BBYU44TGR4dnRVNTlnTjYvZm8zQVE9PQo=", + "url": "https://github.com/tari-project/universe/releases/download/tari_universe-v0.1.16/tari-universe_0.1.16_x64_en-US-debug.msi.zip" } } } \ No newline at end of file diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9b1331b4d..a71475550 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -148,11 +148,18 @@ async fn status(state: tauri::State<'_, UniverseAppState>) -> Result w, + Err(e) => { + warn!(target: LOG_TARGET, "Error getting wallet balance: {:?}", e); + WalletBalance { + available_balance: MicroMinotari(0), + pending_incoming_balance: MicroMinotari(0), + pending_outgoing_balance: MicroMinotari(0), + timelocked_balance: MicroMinotari(0), + } + } + }; Ok(AppStatus { cpu, @@ -319,7 +326,7 @@ fn main() { info!(target: LOG_TARGET, "App shutdown caught"); shutdown.trigger(); // TODO: Find a better way of knowing that all miners have stopped - sleep(std::time::Duration::from_secs(3)); + sleep(std::time::Duration::from_secs(5)); info!(target: LOG_TARGET, "App shutdown complete"); } RunEvent::MainEventsCleared => { diff --git a/src-tauri/src/merge_mining_adapter.rs b/src-tauri/src/merge_mining_adapter.rs index 61254c729..bcc7f2098 100644 --- a/src-tauri/src/merge_mining_adapter.rs +++ b/src-tauri/src/merge_mining_adapter.rs @@ -6,6 +6,7 @@ use dirs_next::data_local_dir; use std::path::PathBuf; use tari_common_types::tari_address::TariAddress; use tari_shutdown::Shutdown; +use tokio::runtime::Handle; use tokio::select; use tokio::task::JoinHandle; @@ -116,6 +117,17 @@ impl ProcessInstance for MergeMiningProxyInstance { Ok(res) } } +impl Drop for MergeMiningProxyInstance { + fn drop(&mut self) { + println!("Drop being called"); + self.shutdown.trigger(); + if let Some(handle) = self.handle.take() { + Handle::current().block_on(async move { + handle.await.unwrap(); + }); + } + } +} impl StatusMonitor for MergeMiningProxyStatusMonitor { fn status(&self) -> Result<(), Error> { diff --git a/src-tauri/src/minotari_node_adapter.rs b/src-tauri/src/minotari_node_adapter.rs index 8f61add10..f11f8b2d1 100644 --- a/src-tauri/src/minotari_node_adapter.rs +++ b/src-tauri/src/minotari_node_adapter.rs @@ -1,6 +1,7 @@ use crate::binary_resolver::{Binaries, BinaryResolver}; use crate::node_manager::NodeIdentity; use crate::process_adapter::{ProcessAdapter, ProcessInstance, StatusMonitor}; +use crate::xmrig_adapter::XmrigInstance; use anyhow::{anyhow, Error}; use async_trait::async_trait; use dirs_next::data_local_dir; @@ -14,6 +15,7 @@ use tari_core::transactions::tari_amount::MicroMinotari; use tari_crypto::ristretto::RistrettoPublicKey; use tari_shutdown::Shutdown; use tari_utilities::ByteArray; +use tokio::runtime::Handle; use tokio::select; use tokio::task::JoinHandle; use tokio::time::Instant; @@ -144,6 +146,18 @@ impl ProcessInstance for MinotariNodeInstance { Ok(res) } } + +impl Drop for MinotariNodeInstance { + fn drop(&mut self) { + println!("Drop being called"); + self.shutdown.trigger(); + if let Some(handle) = self.handle.take() { + Handle::current().block_on(async move { + handle.await.unwrap(); + }); + } + } +} pub struct MinotariNodeStatusMonitor {} impl StatusMonitor for MinotariNodeStatusMonitor { diff --git a/src-tauri/src/wallet_adapter.rs b/src-tauri/src/wallet_adapter.rs index 856da9f16..67b19e78d 100644 --- a/src-tauri/src/wallet_adapter.rs +++ b/src-tauri/src/wallet_adapter.rs @@ -15,6 +15,7 @@ use tari_core::transactions::tari_amount::MicroMinotari; use tari_crypto::ristretto::RistrettoPublicKey; use tari_shutdown::Shutdown; use tari_utilities::hex::Hex; +use tokio::runtime::Handle; use tokio::select; use tokio::task::JoinHandle; @@ -165,6 +166,18 @@ impl ProcessInstance for WalletInstance { } } +impl Drop for WalletInstance { + fn drop(&mut self) { + println!("Drop being called"); + self.shutdown.trigger(); + if let Some(handle) = self.handle.take() { + Handle::current().block_on(async move { + handle.await.unwrap(); + }); + } + } +} + pub struct WalletStatusMonitor {} impl StatusMonitor for WalletStatusMonitor { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index fa3dc34e3..5ff3e633b 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ }, "package": { "productName": "tari-universe", - "version": "0.1.16" + "version": "0.1.17" }, "tauri": { "updater": {