1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use std::net::SocketAddr;
use std::path::PathBuf;
use common::prelude::SecretKey;
use crate::state::BlobStoreConfig;
#[derive(Debug)]
pub struct Config {
// peer configuration
/// address for our jax peer to listen on,
/// if not set then an ephemeral port will be used
pub node_listen_addr: Option<SocketAddr>,
/// on system file path to our secret,
/// if not set then a new secret will be generated
pub node_secret: Option<SecretKey>,
// blob store configuration
/// Blob storage backend configuration
pub blob_store: BlobStoreConfig,
/// Path to the jax directory (absolute path, used for legacy blobs and cache)
pub jax_dir: PathBuf,
/// Maximum blob size allowed for BAO imports (bytes)
pub max_import_size: u64,
// http server configuration - separate ports for API and gateway
/// Port for the API HTTP server (private, mutation/RPC).
pub api_port: u16,
/// Port for the gateway HTTP server (public, read-only).
pub gateway_port: u16,
// data store configuration
/// a path to a sqlite database, if not set then an
/// in-memory database will be used
pub sqlite_path: Option<PathBuf>,
// logging
pub log_level: tracing::Level,
/// Directory for log files (optional, logs to stdout only if not set)
pub log_dir: Option<PathBuf>,
// url configuration
/// External gateway URL (e.g., "https://gateway.example.com")
/// Used for generating share/download links
pub gateway_url: Option<String>,
}
// TODO (amiller68): real error handling
#[allow(dead_code)]
#[derive(Debug, thiserror::Error)]
pub enum ConfigError {}