Skip to main content
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
94%
Published
a month ago (0.1.0)
class DHT
extends BaseService<Service>

A client for the DHT service.

Methods

getProviders(
topic: string,
): ProvidersStream

Get the providers for a given key in a topic.

Get a record from the DHT.

provide(
topic: string,
): Promise<void>

Register as a provider for a given key in a topic.

putRecord(
topic: string,
data: Uint8Array,
): Promise<void>

Put a record into the DHT.

Remove a record from the DHT.

This only affects the local node and will only take effect in the network once the record expires.

Stop providing a key in a topic.

This only affects the local node and will only take effect in the network once the record expires.

Add Package

deno add jsr:@hyveos/sdk

Import symbol

import { DHT } from "@hyveos/sdk";

---- OR ----

Import directly with a jsr specifier

import { DHT } from "jsr:@hyveos/sdk";

Add Package

npx jsr add @hyveos/sdk

Import symbol

import { DHT } from "@hyveos/sdk";

Add Package

yarn dlx jsr add @hyveos/sdk

Import symbol

import { DHT } from "@hyveos/sdk";

Add Package

pnpm dlx jsr add @hyveos/sdk

Import symbol

import { DHT } from "@hyveos/sdk";

Add Package

bunx jsr add @hyveos/sdk

Import symbol

import { DHT } from "@hyveos/sdk";