Skip to main content

ddk_node/
opts.rs

1use clap::Parser;
2use std::path::PathBuf;
3
4#[derive(Parser, Clone, Debug)]
5#[clap(name = "ddk-node")]
6#[clap(
7    about = "DDK Node for DLC Contracts",
8    author = "benny b <ben@bitcoinbay.foundation>"
9)]
10#[clap(version = option_env ! ("CARGO_PKG_VERSION").unwrap_or("unknown"))]
11pub struct NodeOpts {
12    #[arg(long)]
13    #[arg(help = "Set the log level.")]
14    #[arg(default_value = "info")]
15    #[arg(value_parser = ["info", "debug"])]
16    pub log: String,
17    #[arg(short, long)]
18    #[arg(help = "Set the Bitcoin network for DDK")]
19    #[arg(default_value = "signet")]
20    #[arg(value_parser = ["regtest", "mainnet", "signet"])]
21    pub network: String,
22    #[arg(short, long)]
23    #[arg(
24        help = "The path where ddk-node stores data. ddk-node will try to store in the $HOME directory by default."
25    )]
26    pub storage_dir: Option<PathBuf>,
27    #[arg(short = 'p')]
28    #[arg(long = "port")]
29    #[arg(default_value = "1776")]
30    #[arg(help = "Listening port for the lightning network transport.")]
31    pub listening_port: u16,
32    #[arg(long = "grpc")]
33    #[arg(default_value = "0.0.0.0:3030")]
34    #[arg(help = "Host and port the gRPC server will run on.")]
35    pub grpc_host: String,
36    #[arg(long = "esplora")]
37    #[arg(default_value = "https://mutinynet.com/api")]
38    #[arg(help = "Esplora server to connect to.")]
39    pub esplora_host: String,
40    #[arg(long = "oracle")]
41    #[arg(default_value = "https://kormir.dlcdevkit.com")]
42    #[arg(help = "Kormir oracle to connect to.")]
43    pub oracle_host: String,
44    #[arg(long)]
45    #[arg(help = "Seed config strategy.")]
46    #[arg(default_value = "file")]
47    #[arg(value_parser = ["file", "bytes"])]
48    pub seed: String,
49    #[arg(long)]
50    #[arg(help = "Name for the wallet.")]
51    #[arg(default_value = "ddk-node")]
52    pub name: String,
53    #[arg(long)]
54    #[arg(help = "Url for the postgres database connection.")]
55    pub postgres_url: String,
56}