mirror of https://github.com/embarklabs/embark.git
19 lines
475 B
JavaScript
19 lines
475 B
JavaScript
var shelljs = require('shelljs');
|
|
|
|
var Simulator = function(options) {
|
|
this.blockchainConfig = options.blockchainConfig;
|
|
};
|
|
|
|
Simulator.prototype.run = function(options) {
|
|
var cmds = [];
|
|
|
|
cmds.push("-p " + (this.blockchainConfig.rpcPort || options.port || 8545));
|
|
cmds.push("-h " + (this.blockchainConfig.rpcHost || options.host || 'localhost'));
|
|
cmds.push("-a " + (options.num || 10));
|
|
|
|
shelljs.exec('testrpc ' + cmds.join(' '));
|
|
};
|
|
|
|
module.exports = Simulator;
|
|
|