interface ContentRouting {
    cancelReprovide(key, options?): Promise<void>;
    findProviders(cid, options?): AsyncIterable<PeerInfo>;
    get(key, options?): Promise<Uint8Array>;
    provide(cid, options?): Promise<void>;
    put(key, value, options?): Promise<void>;
}

Methods

  • Find the providers of the passed CID.

    Parameters

    Returns AsyncIterable<PeerInfo>

    Example

    // Iterate over the providers found for the given cid
    for await (const provider of contentRouting.findProviders(cid)) {
    console.log(provider.id, provider.multiaddrs)
    }