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

Valid IPNS records fail to resolve #395

Closed
2color opened this issue Jan 18, 2024 · 1 comment
Closed

Valid IPNS records fail to resolve #395

2color opened this issue Jan 18, 2024 · 1 comment

Comments

@2color
Copy link
Member

2color commented Jan 18, 2024

Using the canary tag of the @helia/http, trying to resolve the following IPNS record k51qzi5uqu5di4qhp7oa8qcwmlt94dyd68it5dn60lmwbg4by0s24l3by9sene, results in the following error:

Uncaught (in promise) CodeError: Could not find record for routing key
    at DefaultIPNS.findIpnsRecord_fn (@helia_ipns.js?v=3f44548b:28394:11)
    at async DefaultIPNS.resolve (@helia_ipns.js?v=3f44548b:28319:20)
    at async resolveIpns (index.ts:36:10)
    at async HTMLButtonElement.<anonymous> (index.ts:53:17)
findIpnsRecord_fn @ @helia_ipns.js?v=3f44548b:28394
Show 1 more frame
Show less

Reproduction:

achingbrain added a commit that referenced this issue Jan 18, 2024
Updates IPNS module to version that is capable of round-tripping records
created with non-nano-second validity times.

Updates `@helia/delegated-routing-v1-http-api-client` to version that
can skip verification of incoming records.

Fixes #394 and #395
achingbrain added a commit that referenced this issue Jan 18, 2024
…396)

Updates IPNS module to version that is capable of round-tripping records
created with non-nano-second validity times.

Updates `@helia/delegated-routing-v1-http-api-client` to version that
can skip verification of incoming records.

Fixes #394 and #395
@achingbrain
Copy link
Member

achingbrain commented Jan 18, 2024

This has been fixed for me after #396

I can't see the linked repo (wrong team?) but this is mine:

import { CID } from 'multiformats'
import { createHeliaHTTP } from '@helia/http'
import { json } from '@helia/json'
import { trustlessGateway } from '@helia/block-brokers'
import { ipns } from '@helia/ipns'
import { peerIdFromString } from '@libp2p/peer-id'
import { delegatedHTTPRouting } from '@helia/routers'

const ipnsName = `k51qzi5uqu5di4qhp7oa8qcwmlt94dyd68it5dn60lmwbg4by0s24l3by9sene`

const helia = await createHeliaHTTP({
  blockBrokers: [
    trustlessGateway({
      gateways: ['https://cloudflare-ipfs.com', 'https://ipfs.io'],
    }),
  ],
  routers: [delegatedHTTPRouting('https://delegated-ipfs.dev')],
})

const name = ipns(helia)
const peerId = peerIdFromString(ipnsName)

console.info('ipns', await ipns.resolve(peerId))
{
  "type": "module",
  "dependencies": {
    "@helia/block-brokers": "next",
    "@helia/http": "next",
    "@helia/ipns": "next",
    "@helia/json": "next",
    "@helia/unixfs": "next",
    "@libp2p/peer-id": "^4.0.3",
    "multiformats": "^13.0.0"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants