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

fix: update to latest tari and add cpu config options #889

Merged
merged 4 commits into from
Oct 18, 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
4 changes: 2 additions & 2 deletions package-lock.json

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

156 changes: 140 additions & 16 deletions src-tauri/Cargo.lock

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

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ regex = "1.10.5"
reqwest = {version = "0.12.5", features = ["stream", "json", "multipart"] }
sanitize-filename = "0.5"
semver = "1.0.23"
sentry = {version = "0.34.0", features = ["anyhow"] }
sentry-tauri = "0.3.0"
serde = {version = "1", features = ["derive"] }
serde_json = "1"
Expand Down
6 changes: 3 additions & 3 deletions src-tauri/binaries_versions_esmeralda.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"binaries": {
"xmrig": "=6.22.0",
"mmproxy": "=1.7.0-pre.2",
"minotari_node": "=1.7.0-pre.2",
"wallet": "=1.7.0-pre.2",
"mmproxy": "=1.7.0-pre.3",
"minotari_node": "=1.7.0-pre.3",
"wallet": "=1.7.0-pre.3",
"sha-p2pool": "=0.4.5",
"xtrgpuminer": "=0.1.17",
"tor": "=13.5.6"
Expand Down
6 changes: 3 additions & 3 deletions src-tauri/binaries_versions_nextnet.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"binaries": {
"xmrig": "=6.22.0",
"mmproxy": "=1.7.0-rc.2",
"minotari_node": "=1.7.0-rc.2",
"wallet": "=1.7.0-rc.2",
"mmproxy": "=1.7.0-rc.3",
"minotari_node": "=1.7.0-rc.3",
"wallet": "=1.7.0-rc.3",
"sha-p2pool": "=0.4.5",
"xtrgpuminer": "=0.1.17",
"tor": "=13.5.6"
Expand Down
39 changes: 39 additions & 0 deletions src-tauri/src/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ pub struct AppConfigFromFile {
use_tor: bool,
#[serde(default = "default_false")]
paper_wallet_enabled: bool,
eco_mode_cpu_threads: Option<isize>,
ludicrous_mode_cpu_threads: Option<isize>,
eco_mode_cpu_options: Vec<String>,
ludicrous_mode_cpu_options: Vec<String>,
}

impl Default for AppConfigFromFile {
Expand All @@ -72,6 +76,10 @@ impl Default for AppConfigFromFile {
airdrop_ui_enabled: true,
paper_wallet_enabled: false,
use_tor: true,
eco_mode_cpu_options: Vec::new(),
ludicrous_mode_cpu_options: Vec::new(),
eco_mode_cpu_threads: None,
ludicrous_mode_cpu_threads: None,
}
}
}
Expand Down Expand Up @@ -121,6 +129,10 @@ pub(crate) struct AppConfig {
airdrop_ui_enabled: bool,
paper_wallet_enabled: bool,
use_tor: bool,
eco_mode_cpu_threads: Option<isize>,
ludicrous_mode_cpu_threads: Option<isize>,
eco_mode_cpu_options: Vec<String>,
ludicrous_mode_cpu_options: Vec<String>,
}

impl AppConfig {
Expand All @@ -145,6 +157,10 @@ impl AppConfig {
airdrop_ui_enabled: true,
use_tor: true,
paper_wallet_enabled: false,
eco_mode_cpu_options: Vec::new(),
ludicrous_mode_cpu_options: Vec::new(),
eco_mode_cpu_threads: None,
ludicrous_mode_cpu_threads: None,
}
}

Expand Down Expand Up @@ -185,6 +201,10 @@ impl AppConfig {
self.airdrop_ui_enabled = config.airdrop_ui_enabled;
self.use_tor = config.use_tor;
self.paper_wallet_enabled = config.paper_wallet_enabled;
self.eco_mode_cpu_options = config.eco_mode_cpu_options;
self.eco_mode_cpu_threads = config.eco_mode_cpu_threads;
self.ludicrous_mode_cpu_options = config.ludicrous_mode_cpu_options;
self.ludicrous_mode_cpu_threads = config.ludicrous_mode_cpu_threads;
}
Err(e) => {
warn!(target: LOG_TARGET, "Failed to parse app config: {}", e.to_string());
Expand All @@ -207,6 +227,21 @@ impl AppConfig {
}
}

pub fn eco_mode_cpu_options(&self) -> &Vec<String> {
&self.eco_mode_cpu_options
}

pub fn ludicrous_mode_cpu_options(&self) -> &Vec<String> {
&self.ludicrous_mode_cpu_options
}
pub fn eco_mode_cpu_threads(&self) -> Option<isize> {
self.eco_mode_cpu_threads
}

pub fn ludicrous_mode_cpu_threads(&self) -> Option<isize> {
self.ludicrous_mode_cpu_threads
}

pub fn anon_id(&self) -> &str {
&self.anon_id
}
Expand Down Expand Up @@ -396,6 +431,10 @@ impl AppConfig {
airdrop_ui_enabled: self.airdrop_ui_enabled,
paper_wallet_enabled: self.paper_wallet_enabled,
use_tor: self.use_tor,
eco_mode_cpu_options: self.eco_mode_cpu_options.clone(),
ludicrous_mode_cpu_options: self.ludicrous_mode_cpu_options.clone(),
eco_mode_cpu_threads: self.eco_mode_cpu_threads,
ludicrous_mode_cpu_threads: self.ludicrous_mode_cpu_threads,
};
let config = serde_json::to_string(config)?;
debug!(target: LOG_TARGET, "Updating config file: {:?} {:?}", file, self.clone());
Expand Down
Loading
Loading