Avatar Rithvik Vibhu
Back to Projects

hnsd-client

A Node.js client to interface with hnsd’s DNS-based API.

It operates on DNS queries with the HS class instead of the standard IN.

const { HnsdClient } = require("hnsd-client");

// Create a client instance
const client = new HnsdClient({
  host: "127.0.0.1",
  port: 5349,
});
await client.open();

// Query for info
const chain = await client.getChain(); // {tip: {...}, synced, progress}
const peers = await client.getPeers(); // [{host, agent}, ...]