1use super::*;
2
3#[derive(Clone, Default, Debug, Parser)]
4#[command(group(
5 ArgGroup::new("chains")
6 .required(false)
7 .args(&["chain_argument", "signet", "regtest", "testnet"]),
8))]
9pub struct Options {
10 #[arg(long, help = "Load Bitcoin Core data dir from <BITCOIN_DATA_DIR>.")]
11 pub(crate) bitcoin_data_dir: Option<PathBuf>,
12 #[arg(
13 long,
14 help = "Authenticate to Bitcoin Core RPC with <BITCOIN_RPC_PASSWORD>."
15 )]
16 pub(crate) bitcoin_rpc_password: Option<String>,
17 #[arg(long, help = "Connect to Bitcoin Core RPC at <BITCOIN_RPC_URL>.")]
18 pub(crate) bitcoin_rpc_url: Option<String>,
19 #[arg(
20 long,
21 help = "Authenticate to Bitcoin Core RPC as <BITCOIN_RPC_USERNAME>."
22 )]
23 pub(crate) bitcoin_rpc_username: Option<String>,
24 #[arg(
25 long = "postgresql-uri",
26 value_enum,
27 help = "Connect to postgres with <URI>. [default: postgres://btc_indexer:btc@localhost/btc_indexer]"
28 )]
29 pub(crate) postgres_uri: Option<String>,
30 #[arg(long = "chain", value_enum, help = "Use <CHAIN>. [default: mainnet]")]
31 pub(crate) chain_argument: Option<Chain>,
32 #[arg(
33 long,
34 help = "Commit to index every <COMMIT_INTERVAL> blocks. [default: 5000]"
35 )]
36 pub(crate) commit_interval: Option<usize>,
37 #[arg(long, help = "Load configuration from <CONFIG>.")]
38 pub(crate) config: Option<PathBuf>,
39 #[arg(long, help = "Load configuration from <CONFIG_DIR>.")]
40 pub(crate) config_dir: Option<PathBuf>,
41 #[arg(long, help = "Load Bitcoin Core RPC cookie file from <COOKIE_FILE>.")]
42 pub(crate) cookie_file: Option<PathBuf>,
43 #[arg(long, alias = "datadir", help = "Store index in <DATA_DIR>.")]
44 pub(crate) data_dir: Option<PathBuf>,
45 #[arg(
46 long,
47 help = "Don't look for inscriptions below <FIRST_INSCRIPTION_HEIGHT>."
48 )]
49 pub(crate) first_inscription_height: Option<u32>,
50 #[arg(long, help = "Limit index to <HEIGHT_LIMIT> blocks.")]
51 pub(crate) height_limit: Option<u32>,
52 #[arg(long, help = "Use index at <INDEX>.")]
53 pub(crate) index: Option<PathBuf>,
54 #[arg(
55 long,
56 help = "Set index cache size to <INDEX_CACHE_SIZE> bytes. [default: 1/4 available RAM]"
57 )]
58 pub(crate) index_cache_size: Option<usize>,
59 #[arg(
60 long,
61 help = "Track location of runes. RUNES ARE IN AN UNFINISHED PRE-ALPHA STATE AND SUBJECT TO CHANGE AT ANY TIME."
62 )]
63 pub(crate) index_runes: bool,
64 #[arg(long, help = "Track location of all satoshis.")]
65 pub(crate) index_sats: bool,
66 #[arg(long, help = "Keep sat index entries of spent outputs.")]
67 pub(crate) index_spent_sats: bool,
68 #[arg(long, help = "Store transactions in index.")]
69 pub(crate) index_transactions: bool,
70 #[arg(long, help = "Run in integration test mode.")]
71 pub(crate) integration_test: bool,
72 #[arg(long, help = "Minify JSON output.")]
73 pub minify: bool,
74 #[arg(
75 long,
76 short,
77 alias = "noindex_inscriptions",
78 help = "Do not index inscriptions."
79 )]
80 pub(crate) no_index_inscriptions: bool,
81 #[arg(
82 long,
83 help = "Require basic HTTP authentication with <SERVER_PASSWORD>. Credentials are sent in cleartext. Consider using authentication in conjunction with HTTPS."
84 )]
85 pub(crate) server_password: Option<String>,
86 #[arg(
87 long,
88 help = "Require basic HTTP authentication with <SERVER_USERNAME>. Credentials are sent in cleartext. Consider using authentication in conjunction with HTTPS."
89 )]
90 pub(crate) server_username: Option<String>,
91 #[arg(long, short, help = "Use regtest. Equivalent to `--chain regtest`.")]
92 pub(crate) regtest: bool,
93 #[arg(long, short, help = "Use signet. Equivalent to `--chain signet`.")]
94 pub(crate) signet: bool,
95 #[arg(long, short, help = "Use testnet. Equivalent to `--chain testnet`.")]
96 pub(crate) testnet: bool,
97}