-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: use custom DNS resolver in @helia/ipns for DNSLink
Uses the `.dns` property from #465 to resolve DNS `TXT` records. This allows configuring discrete resolvers for different TLDs, unifies caching across different use of DNS (e.g. dnsaddr multiaddrs), etc. BREAKING CHANGE: requires @helia/[email protected] or later, `resolveDns` has been renamed `resolveDNSLink`
- Loading branch information
1 parent
02e709d
commit d941ad6
Showing
16 changed files
with
319 additions
and
665 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint-env mocha */ | ||
|
||
import { ipns } from '@helia/ipns' | ||
import { expect } from 'aegir/chai' | ||
import { createHeliaNode } from './fixtures/create-helia.js' | ||
import type { IPNS } from '@helia/ipns' | ||
import type { HeliaLibp2p } from 'helia' | ||
|
||
const TEST_DOMAINS: string[] = [ | ||
'ipfs.io', | ||
'docs.ipfs.tech', | ||
'en.wikipedia-on-ipfs.org', | ||
'blog.libp2p.io', | ||
'consensuslab.world', | ||
'n0.computer', | ||
'protocol.ai', | ||
'research.protocol.ai', | ||
'probelab.io', | ||
'singularity.storage', | ||
'saturn.tech' | ||
] | ||
|
||
describe('@helia/ipns - dnslink', () => { | ||
let helia: HeliaLibp2p | ||
let name: IPNS | ||
|
||
beforeEach(async () => { | ||
helia = await createHeliaNode() | ||
name = ipns(helia) | ||
}) | ||
|
||
afterEach(async () => { | ||
if (helia != null) { | ||
await helia.stop() | ||
} | ||
}) | ||
|
||
TEST_DOMAINS.forEach(domain => { | ||
it(`should resolve ${domain}`, async () => { | ||
const result = await name.resolveDNSLink(domain) | ||
|
||
expect(result).to.have.property('cid') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.