reticulum-js
    Preparing search index...

    The primary entry point and orchestrator for the Reticulum Network System.

    The Reticulum class orchestrates the transport and local destinations.

    Index
    • Initializes the Reticulum engine.

      Parameters

      • config: {
            compressionProvider?: Object;
            defaultGravity?: number;
            discovery?: Object;
            enableDiscovery?: boolean;
            ingressControl?: IngressControlConfig;
            logLevel?: string | number;
            storageAdapter?: StorageAdapter;
            useImplicitProof?: boolean;
        } = {}

        Configuration options for the node.

        • OptionalcompressionProvider?: Object

          Engine for handling bz2 Resources (e.g., for rngit).

        • OptionaldefaultGravity?: number

          Default interface gravity applied to any interface that doesn't specify one (Python default_gravity). Higher gravity = preferred for paths. Defaults to Reticulum.DEFAULT_GRAVITY (0).

        • Optionaldiscovery?: Object

          Extra options forwarded to the InterfaceDiscovery constructor when enableDiscovery is true (requiredValue, discoverySources, networkIdentity, backboneSupport).

        • OptionalenableDiscovery?: boolean

          When true, start an InterfaceDiscovery listener on the transport "announce" event so a leaf can discover connectable transport-node interfaces on the rnstransport.discovery.interface aspect (Python discover_interfaces). v1 is surface-only — no auto-connect.

        • OptionalingressControl?: IngressControlConfig

          Node-global ingress burst-control overrides applied to every interface at addInterface time (Python's [reticulum]-section ic_* options — there is no per-interface form). Absent keys keep the Python defaults. Per-interface programmatic control (including iface.ingressControl = false to opt out) always remains available.

        • OptionallogLevel?: string | number

          Initial log threshold. Accepts a LogLevel value or a level name ("DEBUG", "NOTICE", …). Takes precedence over the RETICULUM_LOG_LEVEL environment variable. See src/utils/log.js.

        • OptionalstorageAdapter?: StorageAdapter

          Interface for persisting identities and caches.

        • OptionaluseImplicitProof?: boolean

          §6.5.2 PROOF form for opportunistic DATA: true (default, upstream) emits the 64-byte implicit body; false emits the 96-byte explicit body.

      Returns Reticulum

    _stopped: boolean

    Whether stop has run.

    compressionProvider: Object | null
    defaultGravity: number
    discovery: InterfaceDiscovery | null
    ingressControl: IngressControlConfig
    localDestinations: Map<any, any>
    persistor: Persistor
    persistorLoadPromise: Promise<void>
    storage: StorageAdapter | null
    transport: TransportCore
    useImplicitProof: boolean
    DEFAULT_GRAVITY: number = 0

    The default interface gravity applied when an interface doesn't specify one (RNS.Interfaces.Interface.Interface.DEFAULT_GRAVITY). Higher gravity = preferred for paths when the same announce is heard on multiple interfaces.

    DEFAULT_PER_HOP_TIMEOUT: number = 6

    The base per-hop timeout in seconds (RNS.Reticulum.DEFAULT_PER_HOP_TIMEOUT), added on top of the bitrate-derived term in TransportCore.firstHopTimeout / TransportCore.establishmentTimeout.

    IFAC_MIN_SIZE: number = IFAC_MIN_SIZE

    Minimum IFAC size in bytes (RNS.Reticulum.IFAC_MIN_SIZE). Re-exported from import("./ifac.js").IFAC_MIN_SIZE for upstream API parity.

    IFAC_SALT: Uint8Array<ArrayBuffer> = IFAC_SALT

    Fixed IFAC salt (RNS.Reticulum.IFAC_SALT). Re-exported from import("./ifac.js").IFAC_SALT for upstream API parity.

    MINIMUM_BITRATE: number = 5

    Minimum acceptable interface bitrate in bits/s (RNS.Reticulum.MINIMUM_BITRATE in the Python reference). A configured bitrate below this is ignored so the interface keeps its default — used for config-time validation only. It does not cause interfaces to be skipped in routing; the Python reference doesn't either.

    MTU: number = 500

    The network MTU in bytes (RNS.Reticulum.MTU). The largest packet the network will carry; feeds the bitrate-adaptive timeout math (TransportCore.firstHopTimeout).

    • Attaches a physical or virtual network interface to the router.

      Connecting to a local shared instance is now the caller's job — use the LocalClientInterface.connectToSharedInstance() static factory (from @reticulum/node/src/interfaces/local_client.js) and pass the resulting interface here. Keeping shared-instance discovery out of the core keeps Reticulum free of Node.js builtins and browser-safe.

      Parameters

      • rnsInterface: Interface

        An instantiated interface (TCP, WebSocket, RNode, shared-instance client, ...)

      • isDefault: boolean = false

        If true, unroutable packets fallback to this interface

      Returns void

    • The bitrate-adaptive proof timeout for a single hop toward the destination, in seconds (RNS.Reticulum.get_first_hop_timeout). Delegates to TransportCore.firstHopTimeout; falls back to Reticulum.DEFAULT_PER_HOP_TIMEOUT when no route / bitrate is known.

      Parameters

      • destinationHash: Uint8Array<ArrayBufferLike>

      Returns number

      seconds

    • The bitrate of the slowest currently-online interface, in bits/s, or null when no online interface reports a usable bitrate (RNS.Reticulum.get_lowest_interface_bitrate). Delegates to TransportCore.lowestInterfaceBitrate. (The Python reference also has a shared-instance RPC branch; reticulum-js has no shared-instance model yet, so only the local delegation is exposed.)

      Returns number | null

    • A full round trip for an MTU on the slowest currently-online interface, plus per-hop grace, in seconds (RNS.Reticulum.get_medium_path_timeout). Delegates to TransportCore.mediumPathTimeout; returns 0 when no online interface bitrate is known. (No shared-instance RPC branch — see getLowestInterfaceBitrate.)

      Returns number

      seconds

    • Binds an application-level Destination to the network. When your web components spin up and instantiate a Yjs provider, this is where they register their collaborative endpoints to receive traffic.

      Parameters

      Returns void

    • Removes an interface and purges its routes from the TransportCore.

      Parameters

      • rnsInterface: Interface

        An instantiated interface (TCP, WebSocket, RNode)

      Returns void

    • Graceful shutdown: stops interface discovery, disconnects every attached interface, and flushes the persistence layer so the final debounced batch isn't lost. A per-interface disconnect failure is logged and the rest still proceed. Idempotent.

      Links and their channels are not torn down here (they are owned by the application's destinations); they terminate when their interfaces close.

      Returns Promise<void>