feat: Add cli aliases for nanoreth compatibility, add --local

This commit is contained in:
sprites0
2025-07-04 18:24:27 +00:00
parent f6830a67cd
commit 5987f147f1
2 changed files with 24 additions and 3 deletions

View File

@ -9,15 +9,19 @@ pub struct BlockSourceArgs {
/// Example: /home/user/personal/evm-blocks
///
/// For S3, you can use environment variables like AWS_PROFILE, etc.
#[arg(long)]
#[arg(long, alias = "ingest-dir")]
block_source: Option<String>,
#[arg(long)]
#[arg(long, alias = "local-ingest-dir")]
block_source_from_node: Option<String>,
/// Shorthand of --block-source=s3://hl-mainnet-evm-blocks
#[arg(long = "s3", default_value_t = false)]
#[arg(long, default_value_t = false)]
s3: bool,
/// Shorthand of --block-source-from-node=~/hl/data/evm_blocks_and_receipts
#[arg(long)]
local: bool,
}
impl BlockSourceArgs {
@ -32,6 +36,10 @@ impl BlockSourceArgs {
return Ok(BlockSourceConfig::s3_default().await);
}
if self.local {
return Ok(BlockSourceConfig::local_default());
}
let Some(value) = self.block_source.as_ref() else {
return Err(eyre::eyre!(
"You need to specify a block source e.g., --s3 or --block-source=/path/to/blocks"