-
Notifications
You must be signed in to change notification settings - Fork 1.2k
IPNS resolution in the browser #2921
Description
Hello - thanks again for your work on js-ipfs. Excited to be using and testing it, and hopefully contribute. Currently I'm trying to use the in-browser node to resolve an IPNS address and it is failing. I've looked at the existing issues similar to this that are now closed but still unable to get it working. Details below:
js-ipfs version: 0.41.2
go-ipfs version: 0.4.23
browser version: Chrome 80.0.3987.132
In-browser node setup:
const node = await window.Ipfs.create({
config: {
dht: {
enabled: true,
},
}
});
await node.swarm.connect("/dns4/node1.mydomain.com/tcp/8001/wss/ipfs/QmZRgRJUxUgakETE76vvLGGCdzusdPtsTWD7THv8aJy1iJ");
await node.swarm.connect("/dns4/node2.mydomain.com/tcp/8001/wss/ipfs/Qmcbo9iTcFoqXMfL7vGapt4TnSB6QPvk16aBE87cDB4LFZ");
The 2 nodes I connect to above are go-ipfs nodes on version 0.4.23 and ran with the --enable-namesys-pubsub flag. They are able to publish and resolve IPNS addresses among themselves fine, it's just the browser node that is unable to do so.
So basically when I try
await node.name.resolve('/ipns/QmZRgRJUxUgakETE76vvLGGCdzusdPtsTWD7THv8aJy1iJ');
I will keep digging into this and post more info as I find it. For now, it's failing here and when I print routingKey.toBuffer().toString() I get "/ipns/� ��d��z?�ꃑ�Y��U���U��,}�87�x1��". It jumped out since part of it is string encoded and the rest is in binary but haven't looked elsewhere yet to see if this is expected.
