zebra/zebrad/src/config.rs

51 lines
1.6 KiB
Rust
Raw Normal View History

//! Zebrad Config
//!
//! See instructions in `commands.rs` to specify the path to your
//! application's configuration file and/or command-line options
//! for specifying it.
use serde::{Deserialize, Serialize};
2020-06-17 14:44:24 -07:00
/// Configuration for `zebrad`.
///
/// The `zebrad` config is a TOML-encoded version of this structure. The meaning
/// of each field is described in the documentation, although it may be necessary
/// to click through to the sub-structures for each section.
#[derive(Clone, Default, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[serde(deny_unknown_fields, default)]
pub struct ZebradConfig {
/// Consensus configuration
//
// These configs use full paths to avoid a rustdoc link bug (#7048).
pub consensus: zebra_consensus::config::Config,
/// Metrics configuration
pub metrics: crate::components::metrics::Config,
/// Networking configuration
pub network: zebra_network::config::Config,
/// State configuration
pub state: zebra_state::config::Config,
/// Tracing configuration
pub tracing: crate::components::tracing::Config,
/// Sync configuration
pub sync: crate::components::sync::Config,
/// Mempool configuration
pub mempool: crate::components::mempool::Config,
feature(rpc): add an rpc server to Zebra (#3589) * feature(rpc): add an rpc component * feat(rpc): add a stub for getblockchaininfo This is the first RPC used by lightwalletd, so we need it for testing. * fix(rpc): remove non-standard "jsonrpc: 1.0" from lightwalletd * fix(rpc): re-enable default RPC security checks * deps(rpc): remove not needed dependency * fix(rpc): check if RPC task has stopped * fix(rpc): reduce config by using Option * fix(rpc): use tokio executor * security(rpc): turn off rpc by default * docs(rpc): update a TODO comment Co-authored-by: teor <teor@riseup.net> * fix(rpc): blocking tasks Co-authored-by: teor <teor@riseup.net> * rename(rpc): rpc.rs to methods.rs * refactor(rpc): move the server to the zebra-rpc crate * fix(rpc): clippy derive Default for RPC Config * fix(dependencies): remove unused dependency features in zebra-rpc We expect to use all the listed tokio features to implement and test RPC methods. * doc(rpc): fix testnet port, add security note * fix(rpc): change Rust function names and update method doc TODOs * fix(rpc): add "TODO" to fake RPC responses * doc(rpc): update module docs * fix(rpc): simplify server struct derives * fix(rpc): simplify server code * doc(rpc): explain how request fixes securely handle user-supplied data * refactor(rpc): move the compatibility fix to a separate module * fix(rpc): move the open log inside the spawn, and instrument it * doc(rpc): fix toml format and provide a config example Co-authored-by: teor <teor@riseup.net>
2022-02-22 03:26:29 -08:00
/// RPC configuration
pub rpc: zebra_rpc::config::Config,
#[serde(skip_serializing_if = "zebra_rpc::config::mining::Config::skip_getblocktemplate")]
/// Mining configuration
pub mining: zebra_rpc::config::mining::Config,
#[cfg(feature = "zebra-scan")]
/// Scanner configuration
pub shielded_scan: zebra_scan::config::Config,
}