Skip to main content

espresso_api/v1/
config.rs

1//! V1 config API.
2
3use async_trait::async_trait;
4use espresso_types::config::PublicNetworkConfig;
5
6/// The node's runtime configuration. Its type is built from the node binary's CLI options, which
7/// this crate cannot depend on, so it is erased. It serializes exactly like the value it holds.
8pub type RuntimeConfig = Box<dyn erased_serde::Serialize + Send + Sync>;
9
10#[async_trait]
11pub trait ConfigApi {
12    async fn hotshot_config(&self) -> anyhow::Result<PublicNetworkConfig>;
13
14    /// The allowlisted environment variables, each as a single `KEY=value` string. Unset
15    /// variables are present with an empty value.
16    async fn env(&self) -> anyhow::Result<Vec<String>>;
17
18    async fn runtime_config(&self) -> anyhow::Result<RuntimeConfig>;
19}