0g-storage-node/node/rpc/src/config.rs

28 lines
818 B
Rust
Raw Normal View History

2024-09-25 08:48:40 +00:00
use std::{net::SocketAddr, str::FromStr};
2024-01-03 10:24:52 +00:00
2024-09-25 08:48:40 +00:00
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
#[serde(default)]
2024-01-03 10:24:52 +00:00
pub struct Config {
pub enabled: bool,
pub listen_address: SocketAddr,
2024-09-25 08:48:40 +00:00
pub listen_address_admin: SocketAddr,
2024-01-03 10:24:52 +00:00
pub chunks_per_segment: usize,
pub max_request_body_size: u32,
2024-01-03 10:24:52 +00:00
pub max_cache_file_size: usize,
}
2024-09-25 08:48:40 +00:00
impl Default for Config {
fn default() -> Self {
Self {
enabled: true,
listen_address: SocketAddr::from_str("0.0.0.0:5678").unwrap(),
listen_address_admin: SocketAddr::from_str("127.0.0.1:5679").unwrap(),
chunks_per_segment: 1024,
max_request_body_size: 100 * 1024 * 1024, // 100MB
max_cache_file_size: 10 * 1024 * 1024, // 10MB
}
}
}