sui_indexer_alt_jsonrpc/
args.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use std::path::PathBuf;
5
6use sui_indexer_alt_metrics::MetricsArgs;
7use sui_indexer_alt_reader::bigtable_reader::BigtableArgs;
8use sui_indexer_alt_reader::pg_reader::db::DbArgs;
9use url::Url;
10
11use crate::{NodeArgs, RpcArgs};
12
13pub use sui_indexer_alt_reader::system_package_task::SystemPackageTaskArgs;
14
15#[derive(clap::Parser, Debug, Clone)]
16pub struct Args {
17    #[command(subcommand)]
18    pub command: Command,
19}
20
21#[allow(clippy::large_enum_variant)]
22#[derive(clap::Subcommand, Debug, Clone)]
23pub enum Command {
24    /// Run the RPC service.
25    Rpc {
26        /// The URL of the database to connect to.
27        #[clap(
28            long,
29            default_value = "postgres://postgres:postgrespw@localhost:5432/sui_indexer_alt"
30        )]
31        database_url: Url,
32
33        /// Bigtable instance ID to make KV store requests to. If this is not provided, KV store
34        /// requests will be made to the database.
35        #[clap(long)]
36        bigtable_instance: Option<String>,
37
38        #[command(flatten)]
39        db_args: DbArgs,
40
41        #[command(flatten)]
42        bigtable_args: BigtableArgs,
43
44        #[command(flatten)]
45        rpc_args: RpcArgs,
46
47        #[command(flatten)]
48        system_package_task_args: SystemPackageTaskArgs,
49
50        #[command(flatten)]
51        metrics_args: MetricsArgs,
52
53        #[command(flatten)]
54        node_args: NodeArgs,
55
56        /// Path to the RPC's configuration TOML file. If one is not provided, the default values for
57        /// the configuration will be set.
58        #[arg(long)]
59        config: Option<PathBuf>,
60    },
61
62    /// Output the contents of the default configuration to STDOUT.
63    GenerateConfig,
64}