From e871da056ff014724fcf6e99efe589b596cd8f93 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 13 Jan 2022 15:53:22 +1100 Subject: [PATCH] Export enr, dns, entree modules --- src/index.ts | 11 ++++------- src/lib/discovery/bootstrap.ts | 2 +- src/lib/discovery/enrtree.ts | 7 ------- src/lib/discovery/index.ts | 3 +++ 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2b318f1f5b..d3a72319e6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,7 @@ -export { - getNodesFromHostedJson, - getPseudoRandomSubset, - parseBootstrap, - BootstrapOptions, - BootstrapFn, -} from './lib/discovery'; +export { getNodesFromHostedJson } from './lib/discovery'; +export * as discovery from './lib/discovery'; + +export * as enr from './lib/enr'; export * as utils from './lib/utils'; diff --git a/src/lib/discovery/bootstrap.ts b/src/lib/discovery/bootstrap.ts index 14a004edb7..fda17a6f80 100644 --- a/src/lib/discovery/bootstrap.ts +++ b/src/lib/discovery/bootstrap.ts @@ -20,7 +20,7 @@ export interface BootstrapOptions { /** * The maximum of peers to connect to as part of the bootstrap process. * - * @default {{DefaultMaxPeers}} + * @default [[DefaultMaxPeers]] */ maxPeers?: number; /** diff --git a/src/lib/discovery/enrtree.ts b/src/lib/discovery/enrtree.ts index d256cab9ec..369b294c02 100644 --- a/src/lib/discovery/enrtree.ts +++ b/src/lib/discovery/enrtree.ts @@ -7,13 +7,6 @@ import { ecdsaVerify } from 'secp256k1'; import { ENR } from '../enr'; import { keccak256Buf } from '../utils'; -export interface PeerInfo { - id?: Uint8Array | Buffer; - address?: string; - udpPort?: number | null; - tcpPort?: number | null; -} - type ENRRootValues = { eRoot: string; lRoot: string; diff --git a/src/lib/discovery/index.ts b/src/lib/discovery/index.ts index dfc4be4c4f..b0e04fd44d 100644 --- a/src/lib/discovery/index.ts +++ b/src/lib/discovery/index.ts @@ -2,6 +2,9 @@ import { shuffle } from 'libp2p-gossipsub/src/utils'; export { getNodesFromHostedJson } from './hosted_json'; export { parseBootstrap, BootstrapOptions, BootstrapFn } from './bootstrap'; +export { DnsClient, DnsNodeDiscovery } from './dns'; +export { Endpoints, DnsOverHttps } from './dns_over_https'; +export { ENRTree } from './enrtree'; export function getPseudoRandomSubset( values: T[],