embark/lib/simulator.js

18 lines
433 B
JavaScript

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));
exec('testrpc ' + cmds.join(' '));
};
module.exports = Simulator;