@ethereumjs/devp2p / ENR
• new ENR()
▪ Static Readonly BRANCH_PREFIX: "enrtree-branch:"
packages/devp2p/src/dns/enr.ts:34
▪ Static Readonly RECORD_PREFIX: "enr:"
packages/devp2p/src/dns/enr.ts:32
▪ Static Readonly ROOT_PREFIX: "enrtree-root:"
packages/devp2p/src/dns/enr.ts:35
▪ Static Readonly TREE_PREFIX: "enrtree:"
packages/devp2p/src/dns/enr.ts:33
▸ Static _getIpProtocolConversionCodes(protocolId): ProtocolCodes
Gets relevant multiaddr conversion codes for ipv4, ipv6 and tcp, udp formats
| Name | Type |
|---|---|
protocolId |
Uint8Array |
ProtocolCodes
packages/devp2p/src/dns/enr.ts:182
▸ Static parseAndVerifyRecord(enr): PeerInfo
Converts an Ethereum Name Record (EIP-778) string into a PeerInfo object after validating its signature component with the public key encoded in the record itself.
The record components are:
signature: cryptographic signature of record contents seq: The sequence number, a 64-bit unsigned integer which increases whenever the record changes and is republished. A set of arbitrary key/value pairs
| Name | Type |
|---|---|
enr |
string |
packages/devp2p/src/dns/enr.ts:50
▸ Static parseAndVerifyRoot(root, publicKey): string
Extracts the branch subdomain referenced by a DNS tree root string after verifying the root record signature with its base32 compressed public key. Geth’s top level DNS domains and their public key can be found in: go-ethereum/params/bootnodes
| Name | Type | Description |
|---|---|---|
root |
string |
(See EIP-1459 for encoding details) |
publicKey |
string |
- |
string
subdomain subdomain to retrieve branch records from.
packages/devp2p/src/dns/enr.ts:101
▸ Static parseBranch(branch): string[]
Returns subdomains listed in an ENR branch entry. These in turn lead to either further branch entries or ENR records.
| Name | Type |
|---|---|
branch |
string |
string[]
packages/devp2p/src/dns/enr.ts:170
▸ Static parseTree(tree): ENRTreeValues
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
| Name | Type | Description |
|---|---|---|
tree |
string |
(See EIP-1459 ) |
ENRTreeValues