mirror of https://github.com/embarklabs/embark.git
fix(simulator): change port depending of the type in config
This commit is contained in:
parent
f90194703e
commit
51e39c5b74
|
@ -40,6 +40,7 @@ class EmbarkController {
|
|||
let Simulator = require('../lib/modules/blockchain_process/simulator.js');
|
||||
let simulator = new Simulator({
|
||||
blockchainConfig: this.config.blockchainConfig,
|
||||
contractsConfig: this.config.contractsConfig,
|
||||
logger: this.logger
|
||||
});
|
||||
simulator.run(options);
|
||||
|
|
|
@ -10,6 +10,7 @@ const fs = require('../../core/fs.js');
|
|||
class Simulator {
|
||||
constructor(options) {
|
||||
this.blockchainConfig = options.blockchainConfig;
|
||||
this.contractsConfig = options.contractsConfig;
|
||||
this.logger = options.logger;
|
||||
}
|
||||
|
||||
|
@ -30,7 +31,8 @@ class Simulator {
|
|||
|
||||
let useProxy = this.blockchainConfig.proxy || false;
|
||||
let host = (dockerHostSwap(options.host || this.blockchainConfig.rpcHost) || defaultHost);
|
||||
let port = (options.port || this.blockchainConfig.rpcPort || 8545);
|
||||
const configPort = this.contractsConfig.deployment.type === 'rpc' ? this.blockchainConfig.rpcPort : this.blockchainConfig.wsPort;
|
||||
let port = (options.port || configPort || 8545);
|
||||
port = parseInt(port, 10) + (useProxy ? constants.blockchain.servicePortOnProxy : 0);
|
||||
|
||||
cmds.push("-p " + port);
|
||||
|
|
Loading…
Reference in New Issue