Closed SgtPooki closed 8 months ago
I just realised we have another problem now. We cannot instantiate @helia/verified-fetch
with a custom instance of Helia and also customising dnsResolver
.
This came up in the SW Gateway, where we now are faced with a choice:
IDBBlockstore
in the service worker but have no way to customise the dnsResolversThis is how they compare:
// option 1
const helia = await createHeliaHTTP({
blockstore,
datastore,
blockBrokers: [
trustlessGateway({
gateways: [...config.gateways, ]
})
],
routers: [...config.routers, 'https://delegated-ipfs.dev'].map(rUrl => delegatedHTTPRouting(rUrl))
})
const verifiedFetch = await createVerifiedFetch(helia, { contentTypeParser })
// ---- OR
// option 2
const verifiedFetch = await createVerifiedFetch({
gateways: [...config.gateways, 'https://trustless-gateway.link'],
routers: [...config.routers, 'https://delegated-ipfs.dev'],
dnsResolvers: ['https://delegated-ipfs.dev/dns-query'].map(dnsJsonOverHttps)
}, {
contentTypeParser
})
This seems like something we'd want to address. Naively we could move dnsResolvers to the second parameter and frame it as follows: the first config param is to customise Helia or pass a Helia instance, while the second is to customise verified-fetch specific config.
Any thoughts @SgtPooki @achingbrain ?
Title
feat(verified-fetch): customize ipns dnsResolvers
Description
Adds the ability to customize dns resolvers to verified-fetch.
Users should then be able to add custom doh resolvers to helia-service-worker-gateway as mentioned at https://github.com/ipfs-shipyard/helia-service-worker-gateway/issues/22
Notes & open questions
Change checklist