diff --git a/Cargo.lock b/Cargo.lock index deee8b1a..4c543c49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -957,7 +957,6 @@ version = "0.1.0" dependencies = [ "anyhow", "common-http-client", - "key-management-system-service", "reqwest", ] @@ -5175,7 +5174,6 @@ dependencies = [ "storage", "tempfile", "tokio", - "zksign", ] [[package]] @@ -5216,7 +5214,6 @@ dependencies = [ "sequencer_core", "sequencer_rpc", "tokio", - "zksign", ] [[package]] diff --git a/bedrock_client/Cargo.toml b/bedrock_client/Cargo.toml index e771f0c8..034a093e 100644 --- a/bedrock_client/Cargo.toml +++ b/bedrock_client/Cargo.toml @@ -7,4 +7,3 @@ edition = "2024" reqwest.workspace = true anyhow.workspace = true common-http-client.workspace = true -key-management-system-service.workspace = true diff --git a/sequencer_core/Cargo.toml b/sequencer_core/Cargo.toml index c0cd33ee..3f46f7ca 100644 --- a/sequencer_core/Cargo.toml +++ b/sequencer_core/Cargo.toml @@ -18,9 +18,8 @@ tempfile.workspace = true chrono.workspace = true log.workspace = true bedrock_client.workspace = true -key-management-system-service = { git = "https://github.com/logos-blockchain/logos-blockchain.git" } -nomos-core = { git = "https://github.com/logos-blockchain/logos-blockchain.git" } -zksign = { git = "https://github.com/logos-blockchain/logos-blockchain.git", default-features = false } +key-management-system-service.workspace = true +nomos-core.workspace=true rand.workspace = true reqwest.workspace = true borsh.workspace = true diff --git a/sequencer_core/src/config.rs b/sequencer_core/src/config.rs index ed42fa3a..8b4d991c 100644 --- a/sequencer_core/src/config.rs +++ b/sequencer_core/src/config.rs @@ -67,3 +67,12 @@ impl SequencerConfig { Ok(serde_json::from_reader(reader)?) } } + +impl SequencerConfig { + pub fn from_path(config_home: &Path) -> Result { + let file = File::open(config_home)?; + let reader = BufReader::new(file); + + Ok(serde_json::from_reader(reader)?) + } +} diff --git a/sequencer_runner/Cargo.toml b/sequencer_runner/Cargo.toml index 8ee9f1db..55f56dec 100644 --- a/sequencer_runner/Cargo.toml +++ b/sequencer_runner/Cargo.toml @@ -9,7 +9,6 @@ sequencer_core = { workspace = true, features = ["testnet"] } sequencer_rpc.workspace = true clap = { workspace = true, features = ["derive", "env"] } -zksign = { git = "https://github.com/logos-blockchain/logos-blockchain.git", default-features = false } anyhow.workspace = true env_logger.workspace = true log.workspace = true diff --git a/wallet/Cargo.toml b/wallet/Cargo.toml index 0f88af26..bef25007 100644 --- a/wallet/Cargo.toml +++ b/wallet/Cargo.toml @@ -14,7 +14,7 @@ serde_json.workspace = true env_logger.workspace = true log.workspace = true serde.workspace = true -tokio.workspace = true +tokio = { workspace = true, features = ["macros"] } clap.workspace = true base64.workspace = true bytemuck.workspace = true diff --git a/wallet/src/cli/config.rs b/wallet/src/cli/config.rs index 15467160..b2d4aa93 100644 --- a/wallet/src/cli/config.rs +++ b/wallet/src/cli/config.rs @@ -10,7 +10,13 @@ use crate::{ #[derive(Subcommand, Debug, Clone)] pub enum ConfigSubcommand { /// Getter of config fields - Get { key: String }, + Get { + /// Print all config fields + #[arg(short, long)] + all: bool, + /// Config field key to get + key: Option, + }, /// Setter of config fields Set { key: String, value: String }, /// Prints description of corresponding field @@ -23,58 +29,66 @@ impl WalletSubcommand for ConfigSubcommand { wallet_core: &mut WalletCore, ) -> Result { match self { - ConfigSubcommand::Get { key } => match key.as_str() { - "all" => { + ConfigSubcommand::Get { all, key } => { + if all { let config_str = serde_json::to_string_pretty(&wallet_core.storage.wallet_config)?; println!("{config_str}"); - } - "override_rust_log" => { - if let Some(value) = &wallet_core.storage.wallet_config.override_rust_log { - println!("{value}"); - } else { - println!("Not set"); + } else if let Some(key) = key { + match key.as_str() { + "override_rust_log" => { + if let Some(value) = + &wallet_core.storage.wallet_config.override_rust_log + { + println!("{value}"); + } else { + println!("Not set"); + } + } + "sequencer_addr" => { + println!("{}", wallet_core.storage.wallet_config.sequencer_addr); + } + "seq_poll_timeout_millis" => { + println!( + "{}", + wallet_core.storage.wallet_config.seq_poll_timeout_millis + ); + } + "seq_tx_poll_max_blocks" => { + println!( + "{}", + wallet_core.storage.wallet_config.seq_tx_poll_max_blocks + ); + } + "seq_poll_max_retries" => { + println!("{}", wallet_core.storage.wallet_config.seq_poll_max_retries); + } + "seq_block_poll_max_amount" => { + println!( + "{}", + wallet_core.storage.wallet_config.seq_block_poll_max_amount + ); + } + "initial_accounts" => { + println!("{:#?}", wallet_core.storage.wallet_config.initial_accounts); + } + "basic_auth" => { + if let Some(basic_auth) = &wallet_core.storage.wallet_config.basic_auth + { + println!("{basic_auth}"); + } else { + println!("Not set"); + } + } + _ => { + println!("Unknown field"); + } } + } else { + println!("Please provide a key or use --all flag"); } - "sequencer_addr" => { - println!("{}", wallet_core.storage.wallet_config.sequencer_addr); - } - "seq_poll_timeout_millis" => { - println!( - "{}", - wallet_core.storage.wallet_config.seq_poll_timeout_millis - ); - } - "seq_tx_poll_max_blocks" => { - println!( - "{}", - wallet_core.storage.wallet_config.seq_tx_poll_max_blocks - ); - } - "seq_poll_max_retries" => { - println!("{}", wallet_core.storage.wallet_config.seq_poll_max_retries); - } - "seq_block_poll_max_amount" => { - println!( - "{}", - wallet_core.storage.wallet_config.seq_block_poll_max_amount - ); - } - "initial_accounts" => { - println!("{:#?}", wallet_core.storage.wallet_config.initial_accounts); - } - "basic_auth" => { - if let Some(basic_auth) = &wallet_core.storage.wallet_config.basic_auth { - println!("{basic_auth}"); - } else { - println!("Not set"); - } - } - _ => { - println!("Unknown field"); - } - }, + } ConfigSubcommand::Set { key, value } => { match key.as_str() { "override_rust_log" => {