Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions js/src/utils/spawn.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const waterfall = require('async/waterfall')
const times = require('async/times')
const timesSeries = require('async/timesSeries')

// Spawn a node, get it's id and set it as `peerId` on the node
function spawnNodeWithId (factory, callback) {
Expand All @@ -17,14 +17,14 @@ exports.spawnNodeWithId = spawnNodeWithId

// Spawn n nodes
function spawnNodes (n, factory, callback) {
times(n, (_, cb) => factory.spawnNode(cb), callback)
timesSeries(n, (_, cb) => factory.spawnNode(cb), callback)
}

exports.spawnNodes = spawnNodes

// Spawn n nodes, getting their id's and setting them as `peerId` on the nodes
function spawnNodesWithId (n, factory, callback) {
times(n, (_, cb) => spawnNodeWithId(factory, cb), callback)
timesSeries(n, (_, cb) => spawnNodeWithId(factory, cb), callback)
}

exports.spawnNodesWithId = spawnNodesWithId