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