[Updt] Mtp 0.3.0
This commit is contained in:
parent
e1dd86ec02
commit
ad8555bc6e
45 changed files with 2019 additions and 1441 deletions
|
|
@ -5,33 +5,16 @@ edition = "2024"
|
|||
|
||||
[dependencies]
|
||||
iota-logger = { path = "../iota-logger" }
|
||||
iota-state = { path = "../iota-state" }
|
||||
iota-util = { path = "../iota-util" }
|
||||
iota-paths = { path = "../iota-paths" }
|
||||
|
||||
mtp = { git = "https://git.methanium.net/Methanium/mtp.git" }
|
||||
|
||||
aes-gcm = "0.10.3"
|
||||
base64 = "0.22.1"
|
||||
hex = "*"
|
||||
hkdf = "0.12.4"
|
||||
json = "*"
|
||||
arc-swap = "1"
|
||||
once_cell = "1.21.3"
|
||||
r2d2 = "0.8"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
serde_yaml = "0.9"
|
||||
thiserror = "2"
|
||||
rand = "0.8"
|
||||
rand_core = { version = "0.6", features = ["getrandom", "std"] }
|
||||
ratatui = "0.30.0"
|
||||
reqwest = "0.13.2"
|
||||
rusqlite = "0.40.0"
|
||||
sha2 = "0.11.0"
|
||||
sysinfo = "0.39.0"
|
||||
tokio = { version = "1.50.0", features = ["full"] }
|
||||
uuid = { version = "*", features = ["v4"] }
|
||||
walkdir = "2.5.0"
|
||||
x448 = { version = "*" }
|
||||
zip = "6.0.0"
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ pub struct IotaConfig {
|
|||
pub private_key: Option<String>,
|
||||
#[serde(default = "default_read_receipts_enabled")]
|
||||
pub read_receipts_enabled: bool,
|
||||
#[serde(default = "default_max_ipc_clients")]
|
||||
pub max_ipc_clients: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -87,6 +89,10 @@ const fn default_read_receipts_enabled() -> bool {
|
|||
true
|
||||
}
|
||||
|
||||
const fn default_max_ipc_clients() -> usize {
|
||||
64
|
||||
}
|
||||
|
||||
impl Default for IotaConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
|
@ -99,6 +105,7 @@ impl Default for IotaConfig {
|
|||
public_key: None,
|
||||
private_key: None,
|
||||
read_receipts_enabled: default_read_receipts_enabled(),
|
||||
max_ipc_clients: default_max_ipc_clients(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -200,6 +207,14 @@ pub fn modify_config_value(key: &str, value: &str) -> Result<(), &'static str> {
|
|||
modify_config(|cfg| cfg.read_receipts_enabled = parsed);
|
||||
Ok(())
|
||||
}
|
||||
"max_ipc_clients" => {
|
||||
let parsed: usize = value.parse().map_err(|_| "invalid max_ipc_clients")?;
|
||||
if parsed == 0 {
|
||||
return Err("max_ipc_clients must be greater than zero");
|
||||
}
|
||||
modify_config(|cfg| cfg.max_ipc_clients = parsed);
|
||||
Ok(())
|
||||
}
|
||||
"web.mode" => {
|
||||
let mode = match value {
|
||||
"disabled" => WebMode::Disabled,
|
||||
|
|
|
|||
Loading…
Reference in a new issue