reticulum-js
    Preparing search index...

    Federation sync engine: tracks peers and schedules sync attempts.

    Index
    • Parameters

      • Optionaloptions: {
            fromStaticOnly?: boolean;
            localNodeHash?: Uint8Array<ArrayBufferLike> | null;
            pruneAgeSecs?: number;
            staticPeers?: Uint8Array<ArrayBufferLike>[];
        } = {}

      Returns FedSync

    fromStaticOnly: boolean

    When true, only configured staticPeers are tracked; otherwise every seen rfed.node announce is tracked (Rust from_static_only, default false).

    localNodeHash: string | null
    peers: Map<string, FedPeer>
    pruneAgeSecs: number
    staticPeers: string[]
    • Called when an rfed.node announce is seen. Creates or updates peer entry.

      Parameters

      • destinationHash: Uint8Array<ArrayBufferLike>

        16-byte rfed.node destination hash

      • peeringCost: number | null = null

        PoW cost from announce app_data (optional)

      Returns void

    • Prunes peers not heard from within pruneAgeSecs (except static peers). Returns count of pruned peers.

      Returns number

    • Mark that a sync attempt failed for a peer (increases backoff).

      Parameters

      • destinationHash: Uint8Array<ArrayBufferLike>

      Returns void

    • Mark that a sync attempt succeeded for a peer (resets backoff).

      Parameters

      • destinationHash: Uint8Array<ArrayBufferLike>

      Returns void

    • Mark that a sync attempt has started for a peer.

      Parameters

      • destinationHash: Uint8Array<ArrayBufferLike>

      Returns void

    • Returns a list of peer destination hashes that are due for sync. Called periodically by the main loop/runner.

      Returns Uint8Array<ArrayBufferLike>[]