interface KadDHT {
    cancelReprovide(key): Promise<void>;
    findPeer(id, options?): AsyncIterable<QueryEvent>;
    findProviders(key, options?): AsyncIterable<QueryEvent>;
    get(key, options?): AsyncIterable<QueryEvent>;
    getClosestPeers(key, options?): AsyncIterable<QueryEvent>;
    getMode(): "client" | "server";
    provide(key, options?): AsyncIterable<QueryEvent>;
    put(key, value, options?): AsyncIterable<QueryEvent>;
    refreshRoutingTable(): Promise<void>;
    setMode(mode): Promise<void>;
}

Hierarchy (view full)

Methods

  • Provider records must be re-published every 24 hours - pass a previously provided CID here to not re-publish a record for it any more

    Parameters

    Returns Promise<void>

  • Returns the mode this node is in

    Returns "client" | "server"

  • If 'server' this node will respond to DHT queries, if 'client' this node will not.

    Parameters

    • mode: "client" | "server"

    Returns Promise<void>