Hierarchy

Properties

#private: any
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>

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>

Methods

  • Parameters

    Returns boolean

  • Parameters

    • type: string

    Returns number

  • Type Parameters

    • Detail

    Parameters

    • type: "peer"
    • detail: CustomEventInit<Detail>

    Returns boolean