diff --git a/zebrad/src/commands/generate.rs b/zebrad/src/commands/generate.rs index c3e9ba27..9bb636b2 100644 --- a/zebrad/src/commands/generate.rs +++ b/zebrad/src/commands/generate.rs @@ -15,9 +15,10 @@ impl Runnable for GenerateCmd { /// Start the application. fn run(&self) { let default_config = ZebradConfig { - tracing: crate::config::TracingSection::populated(), - network: Default::default(), metrics: Default::default(), + network: Default::default(), + state: Default::default(), + tracing: crate::config::TracingSection::populated(), }; let mut output = r"# Default configuration for zebrad. # diff --git a/zebrad/src/commands/start.rs b/zebrad/src/commands/start.rs index b72c8997..2cbf7f26 100644 --- a/zebrad/src/commands/start.rs +++ b/zebrad/src/commands/start.rs @@ -47,7 +47,7 @@ pub struct StartCmd { impl StartCmd { async fn start(&self) -> Result<(), Report> { - info!(?self, "begin tower-based peer handling test stub"); + info!(?self, "starting to connect to the network"); // The service that our node uses to respond to requests by peers let node = Buffer::new( @@ -57,9 +57,9 @@ impl StartCmd { }), 1, ); - let config = app_config().network.clone(); - let state = zebra_state::on_disk::init(zebra_state::Config::default()); - let (peer_set, _address_book) = zebra_network::init(config, node).await; + let config = app_config(); + let state = zebra_state::on_disk::init(config.state.clone()); + let (peer_set, _address_book) = zebra_network::init(config.network.clone(), node).await; let verifier = zebra_consensus::chain::init(Mainnet, state.clone()); let mut syncer = sync::Syncer::new(peer_set, state, verifier); diff --git a/zebrad/src/config.rs b/zebrad/src/config.rs index 26ea3774..01b812a1 100644 --- a/zebrad/src/config.rs +++ b/zebrad/src/config.rs @@ -9,6 +9,7 @@ use std::net::SocketAddr; use serde::{Deserialize, Serialize}; use zebra_network::Config as NetworkSection; +use zebra_state::Config as StateSection; /// Configuration for `zebrad`. /// @@ -18,12 +19,17 @@ use zebra_network::Config as NetworkSection; #[derive(Clone, Default, Debug, Deserialize, Serialize)] #[serde(deny_unknown_fields, default)] pub struct ZebradConfig { - /// Tracing configuration - pub tracing: TracingSection, - /// Networking configuration - pub network: NetworkSection, /// Metrics configuration pub metrics: MetricsSection, + + /// Networking configuration + pub network: NetworkSection, + + /// State configuration + pub state: StateSection, + + /// Tracing configuration + pub tracing: TracingSection, } /// Tracing configuration section.