settings.rs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* This file is part of DarkFi (https://dark.fi)
  2. *
  3. * Copyright (C) 2020-2026 Dyne.org foundation
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Affero General Public License as
  7. * published by the Free Software Foundation, either version 3 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. use structopt::StructOpt;
  19. use structopt_toml::{serde::Deserialize, StructOptToml};
  20. use darkfi::{net::settings::SettingsOpt, rpc::settings::RpcSettingsOpt};
  21. pub const CONFIG_FILE: &str = "taud_config.toml";
  22. pub const CONFIG_FILE_CONTENTS: &str = include_str!("../taud_config.toml");
  23. /// taud cli
  24. #[derive(Clone, Debug, Deserialize, StructOpt, StructOptToml)]
  25. #[serde(default)]
  26. #[structopt(name = "taud")]
  27. pub struct Args {
  28. #[structopt(long)]
  29. /// Sets a custom config file
  30. pub config: Option<String>,
  31. #[structopt(long, default_value = "~/.local/share/darkfi/taud_db")]
  32. /// Sets Datastore Path
  33. pub datastore: String,
  34. #[structopt(long, default_value = "~/.local/share/darkfi/replayed_taud_db")]
  35. /// Replay logs (DB) path
  36. pub replay_datastore: String,
  37. #[structopt(long)]
  38. /// Enable RLN proof generation and verification
  39. pub rln_enabled: Option<bool>,
  40. #[structopt(long, default_value = "~/.local/share/darkfi/taud/zk_keys")]
  41. /// Datastore path for RLN proving and verifying keys
  42. pub zk_key_datastore: String,
  43. #[structopt(long)]
  44. /// Generate a new RLN identity
  45. pub gen_rln_identity: bool,
  46. #[structopt(long)]
  47. /// Generate N genesis RLN identities
  48. pub gen_genesis_rln_identities: Option<u64>,
  49. #[structopt(long)]
  50. /// Flag to store KVDB instructions
  51. pub replay_mode: bool,
  52. #[structopt(flatten)]
  53. /// JSON-RPC settings
  54. pub rpc: RpcSettingsOpt,
  55. #[structopt(flatten)]
  56. /// P2P network settings
  57. pub net: SettingsOpt,
  58. #[structopt(short, parse(from_occurrences))]
  59. /// Increase verbosity
  60. pub verbose: u8,
  61. #[structopt(long)]
  62. /// Generate a new workspace
  63. pub generate: bool,
  64. #[structopt(long)]
  65. /// Secret Key To Encrypt/Decrypt tasks
  66. pub workspaces: Vec<String>,
  67. #[structopt(long)]
  68. /// Write access key
  69. pub write: Option<String>,
  70. #[structopt(long)]
  71. /// Password
  72. pub password: Option<String>,
  73. #[structopt(long)]
  74. /// Clean all the local data in datastore path
  75. /// (BE CAREFUL) Check the datastore path in the config file before running this
  76. pub refresh: bool,
  77. #[structopt(long)]
  78. /// Current display name
  79. pub nickname: Option<String>,
  80. #[structopt(long)]
  81. /// Flag to skip syncing the DAG (no history)
  82. pub skip_dag_sync: bool,
  83. #[structopt(long, default_value = "/tmp/tau_pipe")]
  84. /// Named pipe path
  85. pub pipe_path: String,
  86. #[structopt(long)]
  87. // Whether to pipe notifications or not
  88. pub piped: bool,
  89. #[structopt(long)]
  90. // Whether to sync headers only or full sync
  91. pub fast_mode: bool,
  92. #[structopt(short, long)]
  93. /// Set log file to ouput into
  94. pub log: Option<String>,
  95. }