diff --git a/lib/modules/blockchain_process/simulator.js b/lib/modules/blockchain_process/simulator.js index 5d03f1ef..2206af47 100644 --- a/lib/modules/blockchain_process/simulator.js +++ b/lib/modules/blockchain_process/simulator.js @@ -60,6 +60,13 @@ class Simulator { 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 program = ganache; console.log(`running: ${programName} ${cmds.join(' ')}`);