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

Commit

Permalink
chore: use dnsaddr for bootstrap nodes (#3370)
Browse files Browse the repository at this point in the history
Adds the new `dnsaddr` multiaddrs for browser bootstrapping peers per libp2p/js-libp2p#772 and libp2p/js-libp2p#782
  • Loading branch information
vasco-santos authored Nov 6, 2020
1 parent 308baa4 commit 7a0f1a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/ipfs-core/.aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let sigServerB
let ipfsdServer

module.exports = {
bundlesize: { maxSize: '518kB' },
bundlesize: { maxSize: '520kB' },
karma: {
files: [{
pattern: 'node_modules/interface-ipfs-core/test/fixtures/**/*',
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"it-first": "^1.0.4",
"it-last": "^1.0.4",
"it-pipe": "^1.1.0",
"libp2p": "^0.29.0",
"libp2p": "^0.29.3",
"libp2p-bootstrap": "^0.12.1",
"libp2p-crypto": "^0.18.0",
"libp2p-floodsub": "^0.23.1",
Expand Down
11 changes: 5 additions & 6 deletions packages/ipfs-core/src/runtime/config-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ module.exports = () => ({
}
},
Bootstrap: [
'/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd',
'/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3',
'/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM',
'/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu',
'/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm',
'/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt',
'/dns4/node0.preload.ipfs.io/tcp/443/wss/p2p/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic',
'/dns4/node1.preload.ipfs.io/tcp/443/wss/p2p/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6',
'/dns4/node2.preload.ipfs.io/tcp/443/wss/p2p/QmV7gnbW5VTcJ3oyM2Xk1rdFBJ3kTkvxc87UFGsun29STS',
Expand Down
8 changes: 4 additions & 4 deletions packages/ipfs-core/test/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ describe('config', function () {

expect(res.Peers).to.not.be.empty()

const onlyWss = res.Peers.reduce((acc, curr) => {
const onlyWssOrResolvableAddr = res.Peers.reduce((acc, curr) => {
if (!acc) {
return acc
}

const ma = multiaddr(curr)
return ma.protos().some(proto => proto.name === 'wss')
return ma.protos().some(proto => proto.name === 'wss' || proto.resolvable)
}, true)

if (isBrowser || isWebWorker) {
expect(onlyWss).to.be.true()
expect(onlyWssOrResolvableAddr).to.be.true()
} else {
expect(onlyWss).to.be.false()
expect(onlyWssOrResolvableAddr).to.be.false()
}
})
})

0 comments on commit 7a0f1a2

Please sign in to comment.