pub struct Config {Show 37 fields
pub network_id: u32,
pub delegatee_key: String,
pub delegator_key: Option<String>,
pub internal_api_port: u16,
pub external_api_addr: String,
pub endpoint_url: String,
pub remote_rpc_proxy_url: Option<String>,
pub api_token_path: Option<String>,
pub api_allowed_origins: Vec<String>,
pub allow_remote_external_api: bool,
pub ice_servers: String,
pub stabilize_interval: u64,
pub online_node_heartbeat_interval_secs: u64,
pub online_node_ttl_secs: u64,
pub online_node_type: OnlineNodeType,
pub advertise_presence: bool,
pub advertise_onion_relay: bool,
pub advertise_onion_exit: bool,
pub onion_exit_heartbeat_interval_secs: u64,
pub onion_exit_ttl_secs: u64,
pub onion_exit_services: Vec<OnionServiceName>,
pub onion_exit_policy: OnionExitPolicy,
pub onion_http_proxy_addr: Option<String>,
pub onion_http_proxy_header_timeout_secs: u64,
pub onion_http_proxy_max_connections: usize,
pub gateway: Option<NativeGatewayConfig>,
pub bootstrap: BootstrapConfig,
pub services: Option<ServicesConfig>,
pub dns_relay: Option<DnsRelayConfig>,
pub dht_virtual_nodes: u16,
pub origin_quota: OriginQuotaConfig,
pub external_ip: Option<String>,
pub udp_port_min: Option<u16>,
pub udp_port_max: Option<u16>,
pub network: Option<NetworkConfigDescriptor>,
pub data_storage: StorageConfig,
pub measure_storage: StorageConfig,
}Expand description
Serializable native-node configuration.
Fields§
§network_id: u32Rings network identifier this node joins.
delegatee_key: StringDelegation secret key file path.
delegator_key: Option<String>Optional delegator secret key file path for in-process delegation renewal before the signing horizon (#1153); relative paths are resolved next to this config file.
internal_api_port: u16Internal JSON-RPC API port.
external_api_addr: StringExternal JSON-RPC listener address.
endpoint_url: StringInternal endpoint URL used by local clients.
remote_rpc_proxy_url: Option<String>Optional HTTP(S) proxy URL used for remote JSON-RPC endpoints (seed and HTTP handshakes).
api_token_path: Option<String>Optional API token file path; relative paths are resolved next to this config file.
api_allowed_origins: Vec<String>Exact browser origins permitted to call the authenticated API.
allow_remote_external_api: boolExplicitly allow the external API listener to bind a non-loopback address.
ice_servers: StringWebRTC ICE server list, independent from optional gateway ingress.
Defaults to empty when network: { kind, params } selects the transport explicitly.
stabilize_interval: u64Chord stabilization interval in seconds.
online_node_heartbeat_interval_secs: u64Presence descriptor heartbeat interval in seconds.
online_node_ttl_secs: u64Presence descriptor time-to-live in seconds.
online_node_type: OnlineNodeTypeNode type advertised in online-node descriptors.
advertise_presence: boolWhether this node publishes online-node descriptors.
advertise_onion_relay: boolWhether this node advertises onion relay capability.
advertise_onion_exit: boolWhether this node advertises onion exit capability.
onion_exit_heartbeat_interval_secs: u64Onion-exit descriptor heartbeat interval in seconds.
onion_exit_ttl_secs: u64Onion-exit descriptor time-to-live in seconds.
onion_exit_services: Vec<OnionServiceName>Onion-exit services this node can publish.
onion_exit_policy: OnionExitPolicyOnion-exit target and resource policy.
onion_http_proxy_addr: Option<String>Optional local HTTP CONNECT proxy listener address.
onion_http_proxy_header_timeout_secs: u64Timeout for reading HTTP CONNECT headers in seconds.
onion_http_proxy_max_connections: usizeMaximum simultaneous HTTP CONNECT proxy connections.
gateway: Option<NativeGatewayConfig>Native TUN gateway section; rings init writes it disabled, and it starts a gateway in
the same foreground lifecycle only under enabled: true or --gateway. Older configs
without the section load as None.
bootstrap: BootstrapConfigManaged bootstrap targets rings run keeps reachable for the life of the process.
services: Option<ServicesConfig>The services this node serves at <did>.<zone> through DNS relays (#1049); absent, it
announces nothing.
dns_relay: Option<DnsRelayConfig>The DNS relay this node runs for its zones (#1049), if any.
dht_virtual_nodes: u16Virtual DHT positions per storage owner.
origin_quota: OriginQuotaConfigRuntime-local final-destination quotas keyed by verified origin and logical lane.
external_ip: Option<String>Optional externally reachable IP address hint.
udp_port_min: Option<u16>Optional lower bound for local UDP port allocation.
udp_port_max: Option<u16>Optional upper bound for local UDP port allocation.
network: Option<NetworkConfigDescriptor>Optional serde-extensible tagged transport configuration ({ kind, params }).
When present, overrides the default "webrtc" transport constructed from ice_servers,
external_ip, and udp_port_min / udp_port_max.
data_storage: StorageConfigPersistent DHT data storage configuration.
measure_storage: StorageConfigPeer measurement storage configuration.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new<P>(delegatee_key: P) -> Self
pub fn new<P>(delegatee_key: P) -> Self
Creates a default native-node configuration using the supplied delegatee key path.
Sourcepub fn enabled_gateway(&self) -> Option<&NativeGatewayConfig>
pub fn enabled_gateway(&self) -> Option<&NativeGatewayConfig>
The gateway section rings run starts a runner from, if any.
Law: enabled_gateway() = Some(g) ⟺ gateway = Some(g) ∧ g.enabled. --gateway sets
enabled before this is consulted, so the flag and the field select the same runner.
Sourcepub fn write_fs<P>(&self, path: P) -> Result<String>
pub fn write_fs<P>(&self, path: P) -> Result<String>
Writes this configuration to a YAML file and returns the written path.
Sourcepub fn resolve_paths_relative_to<P>(&mut self, config_path: P) -> Result<()>
pub fn resolve_paths_relative_to<P>(&mut self, config_path: P) -> Result<()>
Normalize relative file paths in this configuration (such as delegator_key) against the
parent directory of config_path.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Source§impl TryFrom<Config> for ProcessorConfigSerialized
impl TryFrom<Config> for ProcessorConfigSerialized
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.