miden_node_utils/
config.rs1use std::path::Path;
2
3use figment::Figment;
4use figment::providers::{Format, Toml};
5use serde::Deserialize;
6
7pub const DEFAULT_NODE_RPC_PORT: u16 = 57291;
8pub const DEFAULT_BLOCK_PRODUCER_PORT: u16 = 48046;
9pub const DEFAULT_STORE_PORT: u16 = 28943;
10pub const DEFAULT_FAUCET_SERVER_PORT: u16 = 8080;
11
12#[allow(clippy::result_large_err, reason = "This error crashes the node")]
19pub fn load_config<T: for<'a> Deserialize<'a>>(
20 config_file: impl AsRef<Path>,
21) -> figment::Result<T> {
22 Figment::from(Toml::file(config_file.as_ref())).extract()
23}