2026-06-09 09:29:07 +00:00
|
|
|
//! Distributed-node configuration.
|
2026-02-12 09:13:50 +00:00
|
|
|
//!
|
2026-06-09 09:29:07 +00:00
|
|
|
//! The `DistributedNode` orchestrator that once lived here has been retired:
|
|
|
|
|
//! SWIM membership, the cluster name registry, node-metadata dissemination, and
|
|
|
|
|
//! the actor→host directory now each run as an independent actor on the swactor
|
|
|
|
|
//! runtime — see [`crate::swim::actor`], [`crate::registry_actor`],
|
2026-06-23 20:10:41 +00:00
|
|
|
//! [`crate::node_metadata_actor`], and [`crate::directory_actor`]. Concrete
|
|
|
|
|
//! network drivers (for example `iroh-driver`) feed those actors. All that
|
|
|
|
|
//! remains here is the shared configuration bundle the node binary uses to
|
|
|
|
|
//! construct them.
|
2026-06-09 09:29:07 +00:00
|
|
|
|
|
|
|
|
use crate::registry::RegistryConfig;
|
2026-02-12 09:13:50 +00:00
|
|
|
use crate::swim::probe::SwimConfig;
|
|
|
|
|
|
2026-06-09 09:29:07 +00:00
|
|
|
/// Configuration for a distributed node — the bundle of per-protocol configs the
|
|
|
|
|
/// node binary unpacks to construct the SWIM / registry / metadata actors.
|
2026-02-15 09:47:05 +00:00
|
|
|
#[derive(Clone)]
|
2026-02-12 09:13:50 +00:00
|
|
|
pub struct DistributedNodeConfig {
|
|
|
|
|
pub swim: SwimConfig,
|
|
|
|
|
pub cache_capacity: usize,
|
2026-02-13 07:42:44 +00:00
|
|
|
pub registry: RegistryConfig,
|
2026-02-19 14:39:33 +00:00
|
|
|
/// Dissemination multiplier for node metadata (default: 3).
|
|
|
|
|
pub metadata_lambda: usize,
|
2026-02-12 09:13:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for DistributedNodeConfig {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Self {
|
|
|
|
|
swim: SwimConfig::default(),
|
|
|
|
|
cache_capacity: 10_000,
|
2026-02-13 07:42:44 +00:00
|
|
|
registry: RegistryConfig::default(),
|
2026-02-19 14:39:33 +00:00
|
|
|
metadata_lambda: 3,
|
2026-02-12 09:13:50 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|