pub struct NodeConfig {
pub root_dir: PathBuf,
pub port: u16,
pub ip_version: IpVersion,
pub bootstrap: Vec<SocketAddr>,
pub network_mode: NetworkMode,
pub testnet: TestnetConfig,
pub upgrade: UpgradeConfig,
pub payment: PaymentConfig,
pub bootstrap_cache: BootstrapCacheConfig,
pub storage: StorageConfig,
pub max_message_size: usize,
pub log_level: String,
}Expand description
Node configuration.
Fields§
§root_dir: PathBufRoot directory for node data.
port: u16Listening port (0 for auto-select).
ip_version: IpVersionIP version to use.
bootstrap: Vec<SocketAddr>Bootstrap peer addresses.
network_mode: NetworkModeNetwork mode (production, testnet, or development).
testnet: TestnetConfigTestnet-specific configuration.
Only used when network_mode is Testnet.
upgrade: UpgradeConfigUpgrade configuration.
payment: PaymentConfigPayment verification configuration.
bootstrap_cache: BootstrapCacheConfigBootstrap cache configuration for persistent peer storage.
storage: StorageConfigStorage configuration for chunk persistence.
max_message_size: usizeMaximum application-layer message size in bytes.
Tunes the QUIC stream receive window and per-stream read buffer.
Default: MAX_WIRE_MESSAGE_SIZE
(5 MiB — sufficient for 4 MiB data chunks plus serialization
envelope overhead).
log_level: StringLog level.
Implementations§
Source§impl NodeConfig
impl NodeConfig
Sourcepub fn testnet() -> Self
pub fn testnet() -> Self
Create a testnet configuration preset.
This is a convenience method for setting up a testnet node with relaxed anti-Sybil protection, suitable for single-provider deployments. Includes default bootstrap nodes for the Autonomi testnet.
Sourcepub fn development() -> Self
pub fn development() -> Self
Create a development configuration preset.
This has minimal restrictions and is only suitable for local testing.
Sourcepub fn is_relaxed(&self) -> bool
pub fn is_relaxed(&self) -> bool
Check if this configuration is using relaxed security settings.
Trait Implementations§
Source§impl Clone for NodeConfig
impl Clone for NodeConfig
Source§fn clone(&self) -> NodeConfig
fn clone(&self) -> NodeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodeConfig
impl Debug for NodeConfig
Source§impl Default for NodeConfig
impl Default for NodeConfig
Source§impl<'de> Deserialize<'de> for NodeConfig
impl<'de> Deserialize<'de> for NodeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for NodeConfig
impl RefUnwindSafe for NodeConfig
impl Send for NodeConfig
impl Sync for NodeConfig
impl Unpin for NodeConfig
impl UnsafeUnpin for NodeConfig
impl UnwindSafe for NodeConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more