Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: use custom DNS resolver in @helia/ipns for DNSLink #466

Merged
merged 11 commits into from
Mar 14, 2024
45 changes: 45 additions & 0 deletions packages/interop/src/ipns-dnslink.spec.ts
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')
})
})
})
5 changes: 1 addition & 4 deletions packages/ipns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,10 @@
"@libp2p/kad-dht": "^12.0.8",
"@libp2p/logger": "^4.0.7",
"@libp2p/peer-id": "^4.0.7",
"dns-over-http-resolver": "^3.0.2",
"dns-packet": "^5.6.1",
"hashlru": "^2.3.0",
"@multiformats/dns": "^1.0.1",
"interface-datastore": "^8.2.11",
"ipns": "^9.0.0",
"multiformats": "^13.1.0",
"p-queue": "^8.0.1",
"progress-events": "^1.0.0",
"uint8arrays": "^5.0.2"
},
Expand Down
9 changes: 0 additions & 9 deletions packages/ipns/src/dns-resolvers/default.ts

This file was deleted.

90 changes: 0 additions & 90 deletions packages/ipns/src/dns-resolvers/dns-json-over-https.ts

This file was deleted.

146 changes: 0 additions & 146 deletions packages/ipns/src/dns-resolvers/dns-over-https.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/ipns/src/dns-resolvers/index.ts

This file was deleted.

50 changes: 0 additions & 50 deletions packages/ipns/src/dns-resolvers/resolver.browser.ts

This file was deleted.

25 changes: 0 additions & 25 deletions packages/ipns/src/dns-resolvers/resolver.ts

This file was deleted.

Loading
Loading