zebrad/
config.rs

1//! Zebrad Config
2//!
3//! See instructions in `commands.rs` to specify the path to your
4//! application's configuration file and/or command-line options
5//! for specifying it.
6
7use serde::{Deserialize, Serialize};
8
9/// Configuration for `zebrad`.
10///
11/// The `zebrad` config is a TOML-encoded version of this structure. The meaning
12/// of each field is described in the documentation, although it may be necessary
13/// to click through to the sub-structures for each section.
14///
15/// The path to the configuration file can also be specified with the `--config` flag when running Zebra.
16///
17/// The default path to the `zebrad` config is platform dependent, based on
18/// [`dirs::preference_dir`](https://docs.rs/dirs/latest/dirs/fn.preference_dir.html):
19///
20/// | Platform | Value                                 | Example                                        |
21/// | -------- | ------------------------------------- | ---------------------------------------------- |
22/// | Linux    | `$XDG_CONFIG_HOME` or `$HOME/.config` | `/home/alice/.config/zebrad.toml`              |
23/// | macOS    | `$HOME/Library/Preferences`           | `/Users/Alice/Library/Preferences/zebrad.toml` |
24/// | Windows  | `{FOLDERID_RoamingAppData}`           | `C:\Users\Alice\AppData\Local\zebrad.toml`     |
25#[derive(Clone, Default, Debug, Eq, PartialEq, Deserialize, Serialize)]
26#[serde(deny_unknown_fields, default)]
27pub struct ZebradConfig {
28    /// Consensus configuration
29    //
30    // These configs use full paths to avoid a rustdoc link bug (#7048).
31    pub consensus: zebra_consensus::config::Config,
32
33    /// Metrics configuration
34    pub metrics: crate::components::metrics::Config,
35
36    /// Networking configuration
37    pub network: zebra_network::config::Config,
38
39    /// State configuration
40    pub state: zebra_state::config::Config,
41
42    /// Tracing configuration
43    pub tracing: crate::components::tracing::Config,
44
45    /// Sync configuration
46    pub sync: crate::components::sync::Config,
47
48    /// Mempool configuration
49    pub mempool: crate::components::mempool::Config,
50
51    /// RPC configuration
52    pub rpc: zebra_rpc::config::rpc::Config,
53
54    /// Mining configuration
55    pub mining: zebra_rpc::config::mining::Config,
56}