Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

IPNS resolution in the browser #2921

@jsonsivar

Description

@jsonsivar

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 get the following error:
image

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.

Metadata

Metadata

Assignees

Labels

P1High: Likely tackled by core team if no one steps upenv:browserexp/expertHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)kind/maybe-in-heliatopic/libp2pTopic libp2p

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions