Js-ipfs: TCP 0 addr port, doesn't get correctly resolved to a final address

Created on 4 Feb 2018  路  4Comments  路  Source: ipfs/js-ipfs

  • Version: 0.27.7
  • Platform: all
  • Subsystem: ipfs-api, libp2p, libp2p-tcp

Type: Bug

Severity: Medium

Description: ipfs.id doesn't return resolved ports for 0.0.0.0:0 addrs.

Steps to reproduce the error:

  • Create an ipfs node with a 0.0.0.0:0 addr
  • Connect to ipfs with ipfs-api and call the id method

Expected results:

The addresses field of the resulting object should contain addresses with resolved 0 addrs, however the tcp port does not get correctly resolved.

P2 dihard kinbug statuready

All 4 comments

@dryajov can you create a test please?

@jacobheun @vasco-santos can you confirm if this is still a bug or link to a tracking issue on libp2p land?

This works for both TCP and Websockets.

For example, updating your Swarm config to:

"Addresses": {
    "Swarm": [
      "/ip4/0.0.0.0/tcp/0",
      "/ip4/0.0.0.0/tcp/0/ws"
    ],
    ...
}

Will get you something like:

$ jsipfs swarm addrs local
/ip4/127.0.0.1/tcp/64365/ipfs/Qm
/ip4/192.168.x.x/tcp/64365/ipfs/Qm
/ip4/127.0.0.1/tcp/64366/ws/ipfs/Qm
/ip4/192.168.x.x/tcp/64366/ws/ipfs/Qm

Was this page helpful?
0 / 5 - 0 ratings