Merge pull request #326 from hodlbank/develop
Fixing issue #324: add options to configure simulator's mnemonic and …
This commit is contained in:
commit
5985e6bea1
|
@ -16,7 +16,9 @@
|
||||||
"wsOrigins": "http://localhost:8000",
|
"wsOrigins": "http://localhost:8000",
|
||||||
"wsRPC": true,
|
"wsRPC": true,
|
||||||
"wsHost": "localhost",
|
"wsHost": "localhost",
|
||||||
"wsPort": 8546
|
"wsPort": 8546,
|
||||||
|
"simulatorMnemonic": "example exile argue silk regular smile grass bomb merge arm assist farm",
|
||||||
|
"simulatorBlocktime": 0
|
||||||
},
|
},
|
||||||
"testnet": {
|
"testnet": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|
|
@ -16,7 +16,9 @@
|
||||||
"wsOrigins": "http://localhost:8000",
|
"wsOrigins": "http://localhost:8000",
|
||||||
"wsRPC": true,
|
"wsRPC": true,
|
||||||
"wsHost": "localhost",
|
"wsHost": "localhost",
|
||||||
"wsPort": 8546
|
"wsPort": 8546,
|
||||||
|
"simulatorMnemonic": "example exile argue silk regular smile grass bomb merge arm assist farm",
|
||||||
|
"simulatorBlocktime": 0
|
||||||
},
|
},
|
||||||
"testnet": {
|
"testnet": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|
|
@ -14,9 +14,20 @@ class Simulator {
|
||||||
cmds.push("-e " + (options.defaultBalance || 100));
|
cmds.push("-e " + (options.defaultBalance || 100));
|
||||||
cmds.push("-l " + (options.gasLimit || 8000000));
|
cmds.push("-l " + (options.gasLimit || 8000000));
|
||||||
|
|
||||||
|
// adding mnemonic only if it is defined in the blockchainConfig or options
|
||||||
|
let simulatorMnemonic = this.blockchainConfig.simulatorMnemonic || options.simulatorMnemonic;
|
||||||
|
if (simulatorMnemonic) {
|
||||||
|
cmds.push("--mnemonic \"" + (simulatorMnemonic) +"\"");
|
||||||
|
}
|
||||||
|
|
||||||
|
// adding blocktime only if it is defined in the blockchainConfig or options
|
||||||
|
let simulatorBlocktime = this.blockchainConfig.simulatorBlocktime || options.simulatorBlocktime;
|
||||||
|
if (simulatorBlocktime) {
|
||||||
|
cmds.push("-b \"" + (simulatorBlocktime) +"\"");
|
||||||
|
}
|
||||||
|
|
||||||
shelljs.exec('testrpc ' + cmds.join(' '), {async : true});
|
shelljs.exec('testrpc ' + cmds.join(' '), {async : true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Simulator;
|
module.exports = Simulator;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue