Skip to main content

NodeConfig

Struct NodeConfig 

Source
pub struct NodeConfig {
Show 27 fields pub node_id: String, pub endpoint: String, pub intent: String, pub model: Option<String>, pub backend: Option<String>, pub region: Option<String>, pub capabilities: Vec<String>, pub directory_url: String, pub timeout_ms: u64, pub max_concurrent: usize, pub tokens_per_min: u32, pub max_tokens: u32, pub transport_endpoint: Option<String>, pub transport_method: Option<String>, pub nat_type: Option<String>, pub transport_metadata: Option<Value>, pub exposure_mode: Option<String>, pub cip_policy: Option<Arc<CooperativeInferencePolicy>>, pub pricing: Option<PricingConfig>, pub node_hmac_key: String, pub availability_windows: Vec<Window>, pub enable_idempotency: bool, pub enable_mesh: bool, pub relay_capable: bool, pub relay_accept_port: u16, pub relay_worker_endpoint: Option<String>, pub log_dir: Option<PathBuf>,
}
Expand description

Configuration for an IICP provider node.

Fields§

§node_id: String§endpoint: String§intent: String§model: Option<String>§backend: Option<String>

Detected backend server flavor advertised at register (node-detail field): ollama / lmstudio / vllm / llamacpp / anthropic / custom.

§region: Option<String>§capabilities: Vec<String>§directory_url: String§timeout_ms: u64§max_concurrent: usize

Maximum concurrent tasks; excess requests receive 429 IICP-E021.

§tokens_per_min: u32

Tokens-per-minute capacity declared to directory (limits.tokens_per_min).

§max_tokens: u32

Per-request token cap declared on the capability object (capabilities[].max_tokens).

§transport_endpoint: Option<String>

Optional native IICP binary endpoint (spec/iicp-dir.md v0.7.0). Scheme MUST be iicp:// (plaintext) or iicpsec:// (TLS). Default IICP port is 9484 (ADR-040). When set, the directory persists it and clients SHOULD prefer it over endpoint for task CALLs.

§transport_method: Option<String>

#331 Phase A.1 / ADR-041 — NAT-traversal observability fields surfaced to the directory in the register payload. Populated by IicpNode::apply_nat_profile when an operator runs detect_nat at startup, OR set manually if the operator already knows their topology.

transport_method is one of direct / upnp_mapped / stun_hole_punch / turn_relay / external_tunnel / unknown.

§nat_type: Option<String>

One of full_cone / restricted_cone / port_restricted / symmetric / unknown (observability only).

§transport_metadata: Option<Value>

Forward-compat slot for ADR-041 transport_candidates[] + relay_endpoint.

§exposure_mode: Option<String>

ADR-043 §9 — 8-category exposure_mode, computed by qualify_service and set in apply_nat_profile. Surfaced to the directory nodes.exposure_mode column (#344).

§cip_policy: Option<Arc<CooperativeInferencePolicy>>

S.12 §2.1 CIP policy block surfaced to the directory register payload. When None, register() falls back to the module-level crate::cip_policy::get_cip_policy — operators can configure once and have it apply to all nodes that don’t override.

§pricing: Option<PricingConfig>

ADR-019 declarative pricing block. When None, the SDK does not advertise pricing and the directory defaults to a 1.0 multiplier.

§node_hmac_key: String

Operator-provisioned HMAC key for ADR-019 pricing signatures. When empty, the SDK captures the directory-issued key from the register response and uses it for subsequent signing.

§availability_windows: Vec<Window>

Phase 3+ availability windows (ADR-006). Local-time “HH:MM” windows that shape the effective capacity advertised to the directory and gated at serve time. Empty → always full capacity. See crate::availability.

§enable_idempotency: bool

ADR-010 task_id idempotency. false by default to preserve the pre-0.6 contract (a task_id may be resubmitted). When true, a duplicate task_id within the 5-minute window is rejected with IICP-E010.

§enable_mesh: bool

Phase 2 mesh (ADR-009/022). When true, serve() gossips peers and exposes POST /v1/peers. Default false.

§relay_capable: bool

When true, serve() exposes POST /v1/relay to forward tasks to peers learned via gossip (ADR-022). Requires enable_mesh. Default false.

§relay_accept_port: u16

Port for the RelayAcceptServer (R1 relay-as-last-resort, #341). Workers behind CGNAT connect here outbound and send RELAY_BIND. Default 9485.

§relay_worker_endpoint: Option<String>

R2: when set, this node acts as a relay WORKER — connects outbound to the specified relay endpoint. Format: “host:port” (e.g. “relay.example.com:9485”).

§log_dir: Option<PathBuf>

Directory for persistent log files (<node_id>.log + events.jsonl). None disables file logging (stderr only). Overridden by IICP_LOG_DIR.

Implementations§

Source§

impl NodeConfig

Source

pub fn new( node_id: impl Into<String>, endpoint: impl Into<String>, intent: impl Into<String>, ) -> Self

Trait Implementations§

Source§

impl Clone for NodeConfig

Source§

fn clone(&self) -> NodeConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more