ddk_node/
opts.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use clap::Parser;
use std::path::PathBuf;

#[derive(Parser, Clone, Debug)]
#[clap(name = "ddk-node")]
#[clap(
    about = "DDK Node for DLC Contracts",
    author = "benny b <ben@bitcoinbay.foundation>"
)]
#[clap(version = option_env ! ("CARGO_PKG_VERSION").unwrap_or("unknown"))]
pub struct NodeOpts {
    #[arg(long)]
    #[arg(help = "Set the log level.")]
    #[arg(default_value = "info")]
    #[arg(value_parser = ["info", "debug"])]
    pub log: String,
    #[arg(short, long)]
    #[arg(help = "Set the Bitcoin network for DDK")]
    #[arg(default_value = "signet")]
    #[arg(value_parser = ["regtest", "mainnet", "signet"])]
    pub network: String,
    #[arg(short, long)]
    #[arg(
        help = "The path where ddk-node stores data. ddk-node will try to store in the $HOME directory by default."
    )]
    pub storage_dir: Option<PathBuf>,
    #[arg(short = 'p')]
    #[arg(long = "port")]
    #[arg(default_value = "1776")]
    #[arg(help = "Listening port for the lightning network transport.")]
    pub listening_port: u16,
    #[arg(long = "grpc")]
    #[arg(default_value = "0.0.0.0:3030")]
    #[arg(help = "Host and port the gRPC server will run on.")]
    pub grpc_host: String,
    #[arg(long = "esplora")]
    #[arg(default_value = "https://mutinynet.com/api")]
    #[arg(help = "Esplora server to connect to.")]
    pub esplora_host: String,
    #[arg(long = "oracle")]
    #[arg(default_value = "https://kormir.dlcdevkit.com")]
    #[arg(help = "Kormir oracle to connect to.")]
    pub oracle_host: String,
    #[arg(long)]
    #[arg(help = "Seed config strategy.")]
    #[arg(default_value = "file")]
    #[arg(value_parser = ["file", "bytes"])]
    pub seed: String,
}