use std::path::PathBuf;
use std::time::Duration;
#[derive(Debug, Clone)]
pub struct ServerConfig {
pub port: u16,
pub ws_port: Option<u16>,
pub upstream_url: String,
pub upstream_ws_url: String,
pub rpc_timeout: Duration,
pub index_trees: Vec<String>,
pub db: Option<PathBuf>,
pub snapshots: Vec<PathBuf>,
pub offchain_metadata: bool,
}
impl Default for ServerConfig {
fn default() -> Self {
Self {
port: 8897,
ws_port: None,
upstream_url: "http://127.0.0.1:8899".into(),
upstream_ws_url: "ws://127.0.0.1:8900".into(),
rpc_timeout: Duration::from_secs(10),
index_trees: Vec::new(),
db: None,
snapshots: Vec::new(),
offchain_metadata: true,
}
}
}