mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-28 10:03:09 +00:00
Merge branch 'main' into schouhy/adapt-sequencer-to-bedrock
This commit is contained in:
commit
ae5fe0a2a5
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -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]]
|
||||
|
||||
@ -7,4 +7,3 @@ edition = "2024"
|
||||
reqwest.workspace = true
|
||||
anyhow.workspace = true
|
||||
common-http-client.workspace = true
|
||||
key-management-system-service.workspace = true
|
||||
|
||||
@ -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
|
||||
|
||||
@ -67,3 +67,12 @@ impl SequencerConfig {
|
||||
Ok(serde_json::from_reader(reader)?)
|
||||
}
|
||||
}
|
||||
|
||||
impl SequencerConfig {
|
||||
pub fn from_path(config_home: &Path) -> Result<SequencerConfig> {
|
||||
let file = File::open(config_home)?;
|
||||
let reader = BufReader::new(file);
|
||||
|
||||
Ok(serde_json::from_reader(reader)?)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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<String>,
|
||||
},
|
||||
/// 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<SubcommandReturnValue> {
|
||||
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" => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user