mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-16 23:13:08 +00:00
* add: test for multi enrtree + static multiaddr * wrap up test * rm: only * move test to optional file * dns-disc: setup default for node requirements & move to constants * chore: restructure DNS Discovery for better readability * fix: build * fix: type import * fix: test expect * rm: only * update packagelock * use new libp2p interface * fix linting errors
48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
import { PeerStore } from "@libp2p/interface/peer-store";
|
|
|
|
export type SearchContext = {
|
|
domain: string;
|
|
publicKey: string;
|
|
visits: { [key: string]: boolean };
|
|
};
|
|
|
|
export interface DnsClient {
|
|
resolveTXT: (domain: string) => Promise<string[]>;
|
|
}
|
|
|
|
export interface NodeCapabilityCount {
|
|
relay: number;
|
|
store: number;
|
|
filter: number;
|
|
lightPush: number;
|
|
}
|
|
|
|
export interface DnsDiscoveryComponents {
|
|
peerStore: PeerStore;
|
|
}
|
|
|
|
export interface DnsDiscOptions {
|
|
/**
|
|
* ENR URL to use for DNS discovery
|
|
*/
|
|
enrUrls: string | string[];
|
|
/**
|
|
* Specifies what type of nodes are wanted from the discovery process
|
|
*/
|
|
wantedNodeCapabilityCount: Partial<NodeCapabilityCount>;
|
|
/**
|
|
* Tag a bootstrap peer with this name before "discovering" it (default: 'bootstrap')
|
|
*/
|
|
tagName?: string;
|
|
|
|
/**
|
|
* The bootstrap peer tag will have this value (default: 50)
|
|
*/
|
|
tagValue?: number;
|
|
|
|
/**
|
|
* Cause the bootstrap peer tag to be removed after this number of ms (default: 2 minutes)
|
|
*/
|
|
tagTTL?: number;
|
|
}
|