mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-20 16:12:13 +00:00
18 lines
311 B
JavaScript
18 lines
311 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const eachSeries = require('async/eachSeries')
|
||
|
|
||
|
module.exports = (nodes, callback) => {
|
||
|
eachSeries(
|
||
|
nodes,
|
||
|
(node, cb) => {
|
||
|
eachSeries(
|
||
|
nodes.filter(n => node !== n),
|
||
|
(otherNode, cb) => node.dial(otherNode.peerInfo, cb),
|
||
|
cb
|
||
|
)
|
||
|
},
|
||
|
callback
|
||
|
)
|
||
|
}
|