reticulum-js
    Preparing search index...

    In-memory store for propagated LXMF messages on a propagation node, keyed by transient_id = SHA-256(lxmf_data). Serves the client /get exchange (list/fetch/purge-acknowledged) and enforces a byte cap plus an optional age TTL (mirrors LXMRouter.propagation_entries / clean_messages).

    Index
    _entries: Map<string, PropagationEntry>
    _totalBytes: number

    Running total of stored bytes (sum of entry.size).

    messageTtlSecs: number | null
    storageLimitBytes: number | null
    • Adds an entry; no-op (returns false) if the transient_id is already known.

      Parameters

      • entry: PropagationEntry

      Returns boolean

      true if inserted, false on duplicate.

    • Exports all entries as serializable records (Sets → arrays) for the @reticulum/node FS adapter. The hex-keyed Sets are kept as arrays so the payload round-trips through msgpack cleanly.

      Returns {
          destinationHash: Uint8Array;
          handledPeers: string[];
          lxmfData: Uint8Array;
          received: number;
          size: number;
          stampData: Uint8Array;
          stampValue: number;
          transientId: Uint8Array;
          unhandledPeers: string[];
      }[]

    • Replaces the store with the given records (arrays → Sets). Used on load. Re-computes totalBytes. Does NOT re-run capacity eviction (the caller should call prune afterwards if limits may have changed).

      Parameters

      • records: {
            destinationHash: Uint8Array;
            handledPeers: string[];
            lxmfData: Uint8Array;
            received: number;
            size: number;
            stampData: Uint8Array;
            stampValue: number;
            transientId: Uint8Array;
            unhandledPeers: string[];
        }[]

      Returns void

    • Marks a message as already held by peerHash (handled), removing it from the peer's unhandled set (LXMPeer.add_handled_message).

      Parameters

      • transientId: Uint8Array<ArrayBufferLike>
      • peerHash: Uint8Array<ArrayBufferLike>

      Returns boolean

    • Marks a message as still needed by peerHash (unhandled for that peer). Used when a new message is ingested and must be distributed to peers.

      Parameters

      • transientId: Uint8Array<ArrayBufferLike>
      • peerHash: Uint8Array<ArrayBufferLike>

      Returns boolean

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

      Returns { aged: number }

      counts of pruned entries.

    • Removes an entry unconditionally.

      Parameters

      • transientId: Uint8Array<ArrayBufferLike>

      Returns boolean

      true if an entry was removed.

    • Removes an entry only if it is owned by ownerHash (a client may only purge messages addressed to itself).

      Parameters

      • transientId: Uint8Array<ArrayBufferLike>
      • ownerHash: Uint8Array<ArrayBufferLike>

      Returns boolean

    • Returns the base lxmf_data (stamp stripped) for serving, but only if the entry exists and is owned by ownerHash.

      Parameters

      • transientId: Uint8Array<ArrayBufferLike>
      • ownerHash: Uint8Array<ArrayBufferLike>

      Returns Uint8Array<ArrayBufferLike> | null

    • Lists transient_ids addressed to destinationHash, sorted by stored size ascending (matches message_get_request's size-ascending list order).

      Parameters

      • destinationHash: Uint8Array<ArrayBufferLike>

      Returns Uint8Array<ArrayBufferLike>[]

    • Lists the unhandled messages for a peer, as { transientId, weight, size, entry } sorted by weight ascending (LXMPeer.sync offer ordering). Entries whose stamp value is below minAcceptedCost are excluded.

      Parameters

      • peerHash: Uint8Array<ArrayBufferLike>
      • OptionalminAcceptedCost: number = 0

      Returns {
          entry: PropagationEntry;
          size: number;
          transientId: Uint8Array;
          weight: number;
      }[]