0.0.13 • Published 29 days ago

@blockcore/dns v0.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
29 days ago

Blockcore DNS Provider

Install

npm install @blockcore/dns

Warning: This package is native ESM and does not provide a CommonJS export. If your project uses CommonJS, you'll have to convert to ESM or use the dynamic import() function.

Usage

import { BlockcoreDns } from '@blockcore/dns';

let dns = new BlockcoreDns();

// This relies on a central nameserver registry:
await dns.load();
let indexers = await dns.getServicesByType('Indexer');

Get servers from known nameservers:

import { BlockcoreDns } from '@blockcore/dns';

let dns = new BlockcoreDns();

// This relies on fixed set of nameservers:
await dns.load({ url: 'https://ns.blockcore.net', contact: 'post@blockcore.net' });
let indexers = await dns.getServicesByType('Indexer');

You can create an load the nameservers using this static function:

let dnsServers = await BlockcoreDns.getDnsServers();
dns.setActiveServer(dnsServers[0].url);

await dns.api.getServicesByType('Indexer');
await dns.api.getServicesByNetwork('CITY');
await dns.api.getServicesByTypeAndNetwork('Indexer', 'CITY');
await dns.api.getExternalIP();
0.0.13

29 days ago

0.0.12

8 months ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago