[m] Setting up network id for simulator from blockchainConfig or options.

This commit is contained in:
hodlbank 2018-08-15 23:23:48 +00:00 committed by Iuri Matias
parent a834ca71de
commit b9cd0cf74e
1 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,13 @@ class Simulator {
cmds.push("-b \"" + (simulatorBlocktime) +"\""); cmds.push("-b \"" + (simulatorBlocktime) +"\"");
} }
// Setting up network id for simulator from blockchainConfig or options.
// Otherwise ganache-cli would make random network id.
let networkId = this.blockchainConfig.networkId || options.networkId;
if (typeof networkId != 'undefined') {
cmds.push("--networkId " + networkId);
}
const programName = 'ganache-cli'; const programName = 'ganache-cli';
const program = ganache; const program = ganache;
console.log(`running: ${programName} ${cmds.join(' ')}`); console.log(`running: ${programName} ${cmds.join(' ')}`);