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.

/dnsaddr support in bootstrap and swarm connect #2289

Closed
@lidel

Description

@lidel

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

Metadata

Metadata

Assignees

Labels

P3Low: Not priority right nowexp/noviceSomeone with a little familiarity can pick upkind/bugA bug in existing code (including security flaws)kind/resolved-in-heliastatus/readyReady to be worked

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions