@waku/discovery
Version:
Contains various discovery mechanisms: DNS Discovery (EIP-1459, Peer Exchange, Local Peer Cache Discovery.
34 lines (33 loc) • 1.21 kB
TypeScript
export type ENRRootValues = {
eRoot: string;
lRoot: string;
seq: number;
signature: string;
};
export type ENRTreeValues = {
publicKey: string;
domain: string;
};
export declare class ENRTree {
static readonly RECORD_PREFIX = "enr:";
static readonly TREE_PREFIX = "enrtree:";
static readonly BRANCH_PREFIX = "enrtree-branch:";
static readonly ROOT_PREFIX = "enrtree-root:";
/**
* Extracts the branch subdomain referenced by a DNS tree root string after verifying
* the root record signature with its base32 compressed public key.
*/
static parseAndVerifyRoot(root: string, publicKey: string): string;
static parseRootValues(txt: string): ENRRootValues;
/**
* Returns the public key and top level domain of an ENR tree entry.
* The domain is the starting point for traversing a set of linked DNS TXT records
* and the public key is used to verify the root entry record
*/
static parseTree(tree: string): ENRTreeValues;
/**
* Returns subdomains listed in an ENR branch entry. These in turn lead to
* either further branch entries or ENR records.
*/
static parseBranch(branch: string): string[];
}