diff options
Diffstat (limited to 'RPCTests/modules/startnode.js')
-rw-r--r-- | RPCTests/modules/startnode.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/RPCTests/modules/startnode.js b/RPCTests/modules/startnode.js new file mode 100644 index 000000000..f0877b065 --- /dev/null +++ b/RPCTests/modules/startnode.js @@ -0,0 +1,27 @@ +function startNode (nodeExec, dataDir, genesisPath, listeningPort) +{ + var spawn = require('child_process').spawn + var options = [ + '--private', 'privatechain', + '-d', dataDir, + '--config', genesisPath, + '--ipcpath', dataDir + '/geth.ipc', + '--ipc', + '--listen', listeningPort, + '--test' + ] + console.log('starting node') + console.log(nodeExec + ' ' + options.join(' ')) + var node = spawn(nodeExec, options) + node.stdout.on('data', (data) => { + console.log(`stdout: ${data}`) + }) + node.stderr.on('data', (data) => { + console.log(`stderr: ${data}`) + }) + node.on('close', (code) => { + console.log(`child process exited with code ${code}`) + }) +} + +module.exports = startNode |