I’m trying to resolve an IPNS entry with Helia and get the following error:
Could not find record for routing key
Here is what happens in my code:
import { peerIdFromString } from '@libp2p/peer-id'
import { ipns, type IPNS } from '@helia/ipns'
// build name resolver from existing helia instance
const helianame: IPNS = ipns(_helia)
const IPNS_ENTRY = "..." // ipns as given by the kubo node (base36)
const ipns_entry = peerIdFromString(IPNS_ENTRY) // convert to peerid as expected by the resolve method
// try to resolve
helianame.resolve(ipns_entry).then(/* [...] */)
I am connected to a local kubo node through webtransports. Its gateway is able to correctly resolve the ipns entry.
I tried to provide multiple different transports with routers option but event DefaultIPNS should be able to do it, right?
There are essentially two ways to resolve an IPNS name in the browser:
By traversing the DHT and connecting to relevant DHT server nodes who store the IPNS record. This option is suboptimal because browsers have connectivity challenges connecting to most nodes.
Thanks a lot for your detailed answer @danieln! What’s fun is that I came to the exact same conclusion by the exact same path. I have been looking at the code of verified fetch and figured out it was using delegated routing, so I added /routing to my kubo config and configured name resolution with delegated routing in my client /src/main.ts#L57-L63.
However it would be nice to succeed with the first option too.
chromium has webtransports feature which kubo also has and that’s what I’m using at the moment
firefox has webrtc but it seems to be unimplemented in go at the moment
I’ll keep experimenting with all of this, the libs are very good and its a lot of fun to play with those ^^
and WebRTC-direct will hopefully land in go-libp2p soon (and Kubo). Even when these two are stable, it will take a while for the network to upgrade. Great that you’re kicking the tires with these.