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

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

    Example

    // ...
    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

    Example

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