zoe_relay/
config.rs

1use serde::{Deserialize, Serialize};
2use std::path::PathBuf;
3use zoe_wire_protocol::KeyPair;
4
5#[derive(Debug)]
6pub struct RelayConfig {
7    pub server_keypair: KeyPair,
8    pub blob_config: BlobConfig,
9}
10
11impl RelayConfig {
12    /// Create a new RelayConfig with Ed25519 keypair for transport security
13    pub fn new_with_new_ed25519_tls_key() -> Self {
14        let mut rng = rand::thread_rng();
15        Self {
16            server_keypair: KeyPair::generate_ed25519(&mut rng),
17            blob_config: BlobConfig::default(),
18        }
19    }
20}
21
22#[derive(Debug, Clone, Deserialize, Serialize)]
23pub struct BlobConfig {
24    pub data_dir: PathBuf,
25}
26
27impl Default for BlobConfig {
28    fn default() -> Self {
29        Self {
30            data_dir: PathBuf::from("./blob-store-data"),
31        }
32    }
33}