Skip to content

Commit

Permalink
indexer-alt: IngestionArgs -> ClientArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
amnn committed Nov 29, 2024
1 parent 17a463e commit 53e9470
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions crates/sui-indexer-alt/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::path::PathBuf;
#[cfg(feature = "benchmark")]
use crate::benchmark::BenchmarkArgs;
use crate::db::DbArgs;
use crate::ingestion::IngestionArgs;
use crate::ingestion::ClientArgs;
use crate::IndexerArgs;
use clap::Subcommand;

Expand All @@ -25,7 +25,7 @@ pub enum Command {
/// Run the indexer.
Indexer {
#[command(flatten)]
ingestion_args: IngestionArgs,
client_args: ClientArgs,

#[command(flatten)]
indexer_args: IndexerArgs,
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-indexer-alt/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{path::PathBuf, time::Instant};

use crate::{
db::{reset_database, DbArgs},
ingestion::IngestionArgs,
ingestion::ClientArgs,
start_indexer, IndexerArgs, IndexerConfig,
};
use sui_synthetic_ingestion::synthetic_ingestion::read_ingestion_data;
Expand Down Expand Up @@ -37,7 +37,7 @@ pub async fn run_benchmark(
..Default::default()
};

let ingestion_args = IngestionArgs {
let client_args = ClientArgs {
remote_store_url: None,
local_ingestion_path: Some(ingestion_path.clone()),
};
Expand All @@ -47,7 +47,7 @@ pub async fn run_benchmark(
start_indexer(
db_args,
indexer_args,
ingestion_args,
client_args,
indexer_config,
false, /* with_genesis */
)
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-indexer-alt/src/ingestion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod remote_client;
mod test_utils;

#[derive(clap::Args, Clone, Debug)]
pub struct IngestionArgs {
pub struct ClientArgs {
/// Remote Store to fetch checkpoints from.
#[clap(long, required = true, group = "source")]
pub remote_store_url: Option<Url>,
Expand Down Expand Up @@ -71,7 +71,7 @@ impl IngestionConfig {

impl IngestionService {
pub fn new(
args: IngestionArgs,
args: ClientArgs,
config: IngestionConfig,
metrics: Arc<IndexerMetrics>,
cancel: CancellationToken,
Expand Down Expand Up @@ -201,7 +201,7 @@ mod tests {
cancel: CancellationToken,
) -> IngestionService {
IngestionService::new(
IngestionArgs {
ClientArgs {
remote_store_url: Some(Url::parse(&uri).unwrap()),
local_ingestion_path: None,
},
Expand Down
10 changes: 5 additions & 5 deletions crates/sui-indexer-alt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use handlers::{
tx_balance_changes::TxBalanceChanges, tx_calls::TxCalls, tx_digests::TxDigests,
tx_kinds::TxKinds, wal_coin_balances::WalCoinBalances, wal_obj_types::WalObjTypes,
};
use ingestion::{client::IngestionClient, IngestionArgs, IngestionConfig, IngestionService};
use ingestion::{client::IngestionClient, ClientArgs, IngestionConfig, IngestionService};
use metrics::{IndexerMetrics, MetricsService};
use models::watermarks::CommitterWatermark;
use pipeline::{
Expand Down Expand Up @@ -110,7 +110,7 @@ impl Indexer {
pub async fn new(
db_args: DbArgs,
indexer_args: IndexerArgs,
ingestion_args: IngestionArgs,
client_args: ClientArgs,
ingestion_config: IngestionConfig,
cancel: CancellationToken,
) -> Result<Self> {
Expand All @@ -134,7 +134,7 @@ impl Indexer {
MetricsService::new(metrics_address, db.clone(), cancel.clone())?;

let ingestion_service = IngestionService::new(
ingestion_args,
client_args,
ingestion_config,
metrics.clone(),
cancel.clone(),
Expand Down Expand Up @@ -358,7 +358,7 @@ impl Default for IndexerArgs {
pub async fn start_indexer(
db_args: DbArgs,
indexer_args: IndexerArgs,
ingestion_args: IngestionArgs,
client_args: ClientArgs,
indexer_config: IndexerConfig,
// If true, the indexer will bootstrap from genesis.
// Otherwise it will skip the pipelines that rely on genesis data.
Expand Down Expand Up @@ -427,7 +427,7 @@ pub async fn start_indexer(
let mut indexer = Indexer::new(
db_args,
indexer_args,
ingestion_args,
client_args,
ingestion,
cancel.clone(),
)
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-indexer-alt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async fn main() -> Result<()> {

match args.command {
Command::Indexer {
ingestion_args,
client_args,
indexer_args,
config,
} => {
Expand All @@ -36,7 +36,7 @@ async fn main() -> Result<()> {
start_indexer(
args.db_args,
indexer_args,
ingestion_args,
client_args,
indexer_config,
true,
)
Expand Down

0 comments on commit 53e9470

Please sign in to comment.