reticulum-js
    Preparing search index...

    Server-side propagation logic. Owns the MessageStore and implements the /get request-response exchange and the ingestion of submitted blobs.

    Index
    getDeliveryDestination: (destinationHash: Uint8Array) => Destination | null
    getLocalIdentityHash: () => Uint8Array
    identityAllowed: (identity: Identity) => boolean
    locallyDelivered: Set<string>
    locallyProcessed: Set<string>
    name: string | null
    nodeState: boolean
    onLocalDelivery: (
        message: LXMessage,
        transientId: Uint8Array,
    ) => void | Promise<void>
    peeringCost: number
    perSyncLimitKb: number
    perTransferLimitKb: number
    stampCost: number
    stampCostFlexibility: number
    • Builds the lxmf.propagation announce app_data advertising this node's limits and costs (LXMRouter.get_propagation_node_app_data).

      Parameters

      • Optionaltimebase: number = ...

        Unix seconds; defaults to now.

      Returns Uint8Array<ArrayBufferLike>

    • Builds the responseGenerator for registerRequestHandler("/offer", …).

      Returns (
          path: string,
          data: any,
          requestId: Uint8Array,
          remoteIdentity: Identity | null,
          requestedAt: number,
      ) => Promise<number | boolean | Uint8Array<ArrayBufferLike>[]>

    • Builds the responseGenerator for registerRequestHandler("/get", …). Adapts the Link handler signature to handleGetRequest.

      Returns (
          path: string,
          data: any,
          requestId: Uint8Array,
          remoteIdentity: Identity | null,
          requestedAt: number,
      ) => Promise<number | Uint8Array<ArrayBufferLike>[]>

    • Handles a /get REQUEST (LXMRouter.message_get_request).

      data is the decoded [want, have] or [want, have, transferLimitKb]:

      • [null, null] → list of available transient_ids for the requester.
      • [wants[], haves[]] → purge haves, return base lxmf_data for wants.
      • [null, haves[]] → purge-ack only (returns []).

      Returns a value to be msgpack-encoded as the response: an array of transient_ids, an array of lxmf_data blobs, or a peer error code.

      Parameters

      • remoteIdentity: Identity | null
      • data: any

      Returns Promise<number | Uint8Array<ArrayBufferLike>[]>

    • Handles a /offer REQUEST from a peering propagation node (LXMRouter.offer_request).

      data is [peering_key, [transient_id, …]]. The peering key is validated against peering_id = receivingIdentityHash ‖ offeringIdentityHash at this node's own peering cost. The node then reports which offered messages it does not yet have:

      • false → it already has every offered message.
      • true → it wants every offered message.
      • [ids] → it wants exactly that subset.

      Parameters

      • remoteIdentity: Identity | null
      • data: any

      Returns Promise<number | boolean | Uint8Array<ArrayBufferLike>[]>

      the offer response, or a peer-error code.

    • Ingests a list of propagation blobs received in a submit/sync Resource container (LXMRouter.propagation_resource_concluded → lxmf_propagation).

      Each blob is lxmf_data || stamp. Stamps are validated against the node's minimum cost; survivors are deduplicated, then either locally delivered (if addressed to one of this node's identities) or stored. Returns the count of newly stored entries and the count of locally delivered entries.

      Parameters

      • transientList: Uint8Array<ArrayBufferLike>[]

      Returns Promise<
          {
              delivered: number;
              rejected: number;
              stored: number;
              storedIds: Uint8Array<ArrayBufferLike>[];
          },
      >

    • Periodic maintenance — prunes aged entries (when messageTtlSecs is set) and re-runs capacity eviction. A runner calls this hourly (Python calls clean_messages from its job loop).

      Returns { aged: number }