settings.rs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. use std::net::SocketAddr;
  2. use serde::Deserialize;
  3. use structopt::StructOpt;
  4. use structopt_toml::StructOptToml;
  5. use darkfi::net::settings::SettingsOpt;
  6. pub const CONFIG_FILE: &str = "taud_config.toml";
  7. pub const CONFIG_FILE_CONTENTS: &str = include_str!("../../taud_config.toml");
  8. /// taud cli
  9. #[derive(Clone, Debug, Deserialize, StructOpt, StructOptToml)]
  10. #[serde(default)]
  11. #[structopt(name = "taud")]
  12. pub struct Args {
  13. /// Sets a custom config file
  14. #[structopt(long)]
  15. pub config: Option<String>,
  16. /// JSON-RPC listen URL
  17. #[structopt(long = "rpc", default_value = "127.0.0.1:11055")]
  18. pub rpc_listen: SocketAddr,
  19. /// Sets Datastore Path
  20. #[structopt(long, default_value = "~/.config/tau")]
  21. pub datastore: String,
  22. #[structopt(flatten)]
  23. pub net: SettingsOpt,
  24. /// Increase verbosity
  25. #[structopt(short, parse(from_occurrences))]
  26. pub verbose: u8,
  27. /// Generate a new secret key
  28. #[structopt(long)]
  29. pub key_gen: bool,
  30. /// Load a secret key
  31. #[structopt(long)]
  32. pub key: Option<String>,
  33. }