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

/dnsaddr support in bootstrap and swarm connect #2289

Closed
lidel opened this issue Jul 22, 2019 · 4 comments
Closed

/dnsaddr support in bootstrap and swarm connect #2289

lidel opened this issue Jul 22, 2019 · 4 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P3 Low: Not priority right now status/ready Ready to be worked

Comments

@lidel
Copy link
Member

lidel commented Jul 22, 2019

Type: Feature

Severity: Medium

Motivation

/dnsaddr is like DNSLink, but for multiaddrs.
It is a way of having static peer multiaddrs that do not hardcode PeerID and can point at multiple multiaddrs:

  • /dnsaddr/bootstrap.libp2p.io resolves to:
    • /ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd
    • /ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd

It is already supported by go-ipfs (ipfs/kubo#5522) and feels like "magic" mentioned in #1459
In js-ipfs, it could be used in default multiaddrs for things like dns-based bootstrap nodes or preload / delegate nodes, enabling us to scale transparently by adding more multiaddrs without the need for shipping patch release or changing client configs.

Problem

  • /dnsaddr multiaddrs are not supported in swarm connect
  • bootstrap ignores /dnsaddr entries

Steps to reproduce:

bootstrap.libp2p.io has dnsaddr records with port and peerid:

$ dig +short _dnsaddr.bootstrap.libp2p.io txt
"dnsaddr=/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"
"dnsaddr=/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"

Try connecting to peer via dnsaddr:

$ jsipfs swarm connect /dnsaddr/bootstrap.libp2p.io
peer multiaddr instance or string must include peerId

Expected:

$ ipfs swarm connect /dnsaddr/bootstrap.libp2p.io
connect QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd success

In case dnsaddr disappears from bootstrap.libp2p.io, alternative hostname for testing: ipfs.aergia.eu

@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up P3 Low: Not priority right now status/ready Ready to be worked labels Jul 29, 2019
@GavinDmello
Copy link

GavinDmello commented Aug 8, 2019

@alanshaw @lidel Can I work on this ?

@lidel
Copy link
Member Author

lidel commented Aug 12, 2019

@GavinDmello would be awesome, give it a try!

Check if we could add generic support for "resolving" multiaddrs in js-multiaddr/dnsaddr is an example of that. Check discussion at multiformats/js-multiaddr#94

@GavinDmello
Copy link

GavinDmello commented Aug 13, 2019

@lidel Thank you for the direction.

I was planning on adding handling directly in this repository and reusing the the dns objects in the core components.

I'll try asking on multiformats/js-multiaddr#94 if anyone has started working on adding support.

Edit: I see @hacdias is going to be working on adding support for it. I'll use his work once he is done.

@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterwards (see #4336).

This issue is most likely resolved in Helia, please try it out!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P3 Low: Not priority right now status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants