await using support.
This node's id.
This node's dialable address (id + current direct addresses).
Whether the node was started with admission hooks (or a gate).
Whether close() has been called.
StaticstartStart a node. In-memory unless config.storagePath is set. Only the
given config is used — merge AsterConfig.fromEnv in yourself to
honour ASTER_* variables.
Optionalconfig: AsterConfigOptionaloptions: NodeStartOptionsDirect socket addresses ("ip:port") currently advertised. Empty until
the endpoint has bound and discovered its local addresses.
The node's 32-byte secret key. Persist it (or set secretKeyFile) for a
restart-stable identity — the store does not keep it.
Attach a Gate-0 policy (null detaches it). Applies from the next
admission decision. Needs a node started with hooks or a gate.
Admission requests raised while no gate is attached — iterate with
for await and accept() / reject(code, reason) each. Outbound
dials by this node appear as direction === 'outbound'. One iterator
per node; needs a node started with enableHooks: true.
Answer this node's admission requests with hooks over upcalls (kinds
admission_handshake / admission_connect) — the alternative to
admission; one or the other per node. An attached gate still
decides first. Without an answer (error, timeout) the upcall policy's
failure mode decides (fail-closed by default: a handshake is rejected
with 403 "hook unavailable"); keep its timeout below the node's
hookTimeoutMs. Outbound dials are allowed unless hooks.connect
says otherwise. close() on the result removes the hooks (later
requests then get the failure mode).
Optionaloptions: { upcalls?: Upcalls }Blob store client.
Document sync client.
Gossip pub-sub client.
Serve /healthz, /readyz and /metrics (OTel Prometheus text,
including the transport counters) on host:port from Rust. Port 0
binds an ephemeral port. Starts the observability pipeline from the
environment when nothing has. Replaces the former metricsPrometheus().
Optionaloptions: { host?: string; port?: number }This node's topology view (v1 per-peer proximity; v2 shared swarm).
Populates only when the node runs with enableMonitoring: true.
A lease backend on the designated grantor grantor (an
aster.lease.Grantor service reached over RPC). The grantor must be
dialable by id (discovery, or its address added beforehand).
Serve aster.lease.Grantor over serializer, making this node a
designated grantor. Start the node with alpns: ['aster/1']. This owns
the node's RPC accept loop — don't also run an RPC server on it.
Returns a handle whose close() stops serving.
Optionaloptions: LeaseGrantorOptionsOwn this node's accept loop for expose: inbound connections on one of
alpns (start the node with them in alpns) are fed to expose.
Don't also run an RPC server on the node. close() stops accepting.
Consumers open a stream with connection.openExposeStream(serviceId).
Shut down cleanly (flushes persistent state first). Idempotent.
A running Aster node. Start one with Node.start; close it with
close()orawait using.