Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example multiaddrs of boostrap nodes #772

Merged
merged 5 commits into from
Oct 30, 2020
Merged

Conversation

mburns
Copy link
Contributor

@mburns mburns commented Oct 6, 2020

This updates the docs to point to new(er) bootstrap nodes. Infra would like to decouple how we announce bootstrap records so that the datacenter (ams-1, lon-1) is not strictly tied to a peer id (QmSol...).

These new examples are using servers on different continents, instead of both being EU-based.

mburns added 2 commits October 6, 2020 04:55
This points to 2 new bootstrap nodes, as we would like to decouple the datacenter (`ams-1`, `lon-1`) from the peer id.

Also, this (currently) uses both an EU and US based servers, instead of bother being EU-based.
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @mburns

I tried the browser example with the new addresses, but they are all failing:

WebSocket connection to 'wss://bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa' failed: Error in connection establishment: net::ERR_NAME_NOT_RESOLVED

Is this blocked by https://github.com/protocol/bifrost-infra/pull/827 ?

@mburns
Copy link
Contributor Author

mburns commented Oct 6, 2020

Is this blocked by protocol/bifrost-infra#827 ?

Hrm. Nope, the new addresses have been live and in production for several months.

I've kicked one of the instances that seemed wedged:

$ ipfs swarm connect /dns4/bootstrap.libp2p.io/tcp/443/wss/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
connect QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa success

Otherwsie, all connect for me.

@vasco-santos
Copy link
Member

I am able to dial using go-ipfs, but not in JS. The address is not being resolved.
While wss://ams-1.bootstrap.libp2p.io:443/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd (old bootstrap) resolves and connects, the same does not happen with wss://bootstrap.libp2p.io:443/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN.

I am getting on websockets:

message: 'getaddrinfo ENOTFOUND bootstrap.libp2p.io',
  error: Error: getaddrinfo ENOTFOUND bootstrap.libp2p.io
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
    errno: 'ENOTFOUND',
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'bootstrap.libp2p.io'
  }

@jacobheun any ideas?

@jacobheun
Copy link
Contributor

/dns4/bootstrap.libp2p.io/tcp/443/wss/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
/dns4/bootstrap.libp2p.io/tcp/443/wss/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN

@mburns @vasco-santos these are bad addresses. It "works" in go-ipfs because it already knows good addresses for those peers due to dnsaddr TCP addr resolution on boot. There is no dns4 resolution for bootstrap.libp2p.io, only TXT records, so this will never resolve.

@vasco-santos we need to implement multiformats/js-multiaddr#94 (comment).

The bootstrap addresses should ideally just be:

/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN

@mburns In order for the dnsaddr's to work we also need the TXT records to contain the wss addresses, can we add them?

A temporary workaround would be to use the underlying subdomains:

  • /dns4/ewr-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa
  • /dns4/sjc-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN

This isn't great because we're still hardcoding the subdomain addresses but until we add dnsaddr resolution in JS and add wss addresses to the TXT records, we can't dynamically resolve this.

@vasco-santos let's sync up to get the dnsaddr resolution support done so we're no longer blocked there.

@mburns mburns marked this pull request as draft October 7, 2020 22:12
@vasco-santos
Copy link
Member

Do we have any example on how the TXT records will look like?

@jacobheun
Copy link
Contributor

Do we have any example on how the TXT records will look like?

You can use dig to see the existing multiaddrs, dig -t TXT _dnsaddr.bootstrap.libp2p.io.

Or a curl from Cloudflare's service:
curl -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=_dnsaddr.bootstrap.libp2p.io&type=TXT'

@vasco-santos
Copy link
Member

Cool thanks! I was missing the _dnsaddr part. I could get it now

@mburns
Copy link
Contributor Author

mburns commented Oct 10, 2020

thanks for connecting those dots, @jacobheun

wss (and quic) addresses are now being advertised for the Bootstrap nodes.

$ dig +short TXT _dnsaddr.bootstrap.libp2p.io | tail -n 1
"dnsaddr=/dnsaddr/sjc-2.bootstrap.libp2p.io/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"

=>

$ dig +short TXT _dnsaddr.sjc-2.bootstrap.libp2p.io
"dnsaddr=/ip4/147.75.109.29/tcp/4001/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip4/147.75.109.29/tcp/443/wss/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip4/147.75.109.29/udp/4001/quic/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip6/2604:1380:1000:6000::5/tcp/4001/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip6/2604:1380:1000:6000::5/tcp/443/wss/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip6/2604:1380:1000:6000::5/udp/4001/quic/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"

@jacobheun
Copy link
Contributor

@mburns so one problematic thing we have to deal with for wss addresses is that we can't resolve the domain in the dnsaddr record, because we need it for SSL resolution.

/ip4/147.75.109.29/tcp/443/wss/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp needs to be backed by an SSL certificate for the browser to resolve it so we actually need the dns address to return, because we have to pass the domain to the Websocket transport in order for it to resolve in browsers.

So I think it will need to look like:

$ dig +short TXT _dnsaddr.sjc-2.bootstrap.libp2p.io
"dnsaddr=/ip4/147.75.109.29/tcp/4001/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/dns4/sjc-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip4/147.75.109.29/udp/4001/quic/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip6/2604:1380:1000:6000::5/tcp/4001/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/dns6/sjc-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"
"dnsaddr=/ip6/2604:1380:1000:6000::5/udp/4001/quic/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp"

And we have to avoid resolving dns4/dns6 addresses on the JS side.

@mburns
Copy link
Contributor Author

mburns commented Oct 14, 2020

So I think it will need to look like:

Great. I've pushed those changes:

$  dig +short TXT _dnsaddr.nyc-2.bootstrap.libp2p.io
"dnsaddr=/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/dns6/nyc-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/ip4/104.236.76.40/tcp/443/wss/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/ip4/104.236.76.40/udp/4001/quic/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/ip6/2604:a880:800:10::4a:5001/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/ip6/2604:a880:800:10::4a:5001/tcp/443/wss/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
"dnsaddr=/ip6/2604:a880:800:10::4a:5001/udp/4001/quic/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"

@vasco-santos vasco-santos changed the base branch from master to feat/resolve-multiaddrs-before-dial October 30, 2020 10:54
@vasco-santos vasco-santos marked this pull request as ready for review October 30, 2020 10:56
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Merging this into #782 with the doh resolver

@vasco-santos vasco-santos merged commit 3b3911b into libp2p:feat/resolve-multiaddrs-before-dial Oct 30, 2020
achingbrain pushed a commit to ipfs/js-ipfs that referenced this pull request Nov 6, 2020
Adds the new `dnsaddr` multiaddrs for browser bootstrapping peers per libp2p/js-libp2p#772 and libp2p/js-libp2p#782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants