Interface SingleKadDHT

Hierarchy

Properties

findPeer: ((id: PeerId, options?: QueryOptions) => AsyncIterable<QueryEvent>)

Type declaration

findProviders: ((key: CID<unknown, number, number, Version>, options?: QueryOptions) => AsyncIterable<QueryEvent>)

Type declaration

get: ((key: Uint8Array, options?: QueryOptions) => AsyncIterable<QueryEvent>)

Type declaration

getClosestPeers: ((key: Uint8Array, options?: QueryOptions) => AsyncIterable<QueryEvent>)

Type declaration

getMode: (() => Promise<"client" | "server">)

Type declaration

    • (): Promise<"client" | "server">
    • Returns the mode this node is in

      Returns Promise<"client" | "server">

provide: ((key: CID<unknown, number, number, Version>, options?: QueryOptions) => AsyncIterable<QueryEvent>)

Type declaration

put: ((key: Uint8Array, value: Uint8Array, options?: QueryOptions) => AsyncIterable<QueryEvent>)

Type declaration

refreshRoutingTable: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Force a routing table refresh

      Returns Promise<void>

routingTable: RoutingTable
setMode: ((mode: "client" | "server") => Promise<void>)

Type declaration

    • (mode: "client" | "server"): Promise<void>
    • If 'server' this node will respond to DHT queries, if 'client' this node will not

      Parameters

      • mode: "client" | "server"

      Returns Promise<void>