libp2p
    Preparing search index...

    Interface Fetch

    interface Fetch {
        fetch(
            peer: PeerId,
            key: string | Uint8Array<ArrayBufferLike>,
            options?: AbortOptions,
        ): Promise<undefined | Uint8Array<ArrayBufferLike>>;
        registerLookupFunction(prefix: string, lookup: LookupFunction): void;
        unregisterLookupFunction(prefix: string, lookup?: LookupFunction): void;
    }
    Index

    Methods

    • Registers a new lookup callback that can map keys to values, for a given set of keys that share the same prefix

      Parameters

      Returns void

      // ...
      libp2p.services.fetch.registerLookupFunction('/prefix', (key) => { ... })
    • Registers a new lookup callback that can map keys to values, for a given set of keys that share the same prefix.

      Parameters

      Returns void

      // ...
      libp2p.services.fetch.unregisterLookupFunction('/prefix')