Add ZkSyncConfig structure
+// External deps
+use serde::Deserialize;
+
// Public re-exports
pub use self::{
api::ApiConfig, chain::ChainConfig, contracts::ContractsConfig, db::DBConfig,
@@ -16,6 +19,35 @@ pub mod misc;
pub mod prover;
pub mod ticker;
+#[derive(Debug, Deserialize, Clone, PartialEq)]
+pub struct ZkSyncConfig {
+ pub api: ApiConfig,
+ pub chain: ChainConfig,
+ pub contracts: ContractsConfig,
+ pub db: DBConfig,
+ pub eth_client: ETHClientConfig,
+ pub eth_sender: ETHSenderConfig,
+ pub eth_watch: ETHWatchConfig,
+ pub prover: ProverConfig,
+ pub ticker: TickerConfig,
+}
+
+impl ZkSyncConfig {
+ pub fn from_env() -> Self {
+ Self {
+ api: ApiConfig::from_env(),
+ chain: ChainConfig::from_env(),
+ contracts: ContractsConfig::from_env(),
+ db: DBConfig::from_env(),
+ eth_client: ETHClientConfig::from_env(),
+ eth_sender: ETHSenderConfig::from_env(),
+ eth_watch: ETHWatchConfig::from_env(),
+ prover: ProverConfig::from_env(),
+ ticker: TickerConfig::from_env(),
+ }
+ }
+}
+
#[cfg(test)]
pub(crate) mod test_utils;
