blockchain -- defaultHost, dockerHostSwap

This commit is contained in:
Michael Bradley, Jr 2018-07-15 12:30:51 -05:00
parent e5b1a58b25
commit 98318c6c05
1 changed files with 4 additions and 2 deletions

View File

@ -7,6 +7,8 @@ const utils = require('../../utils/utils.js');
const GethCommands = require('./geth_commands.js');
const {defaultHost, dockerHostSwap} = require('../../utils/host');
/*eslint complexity: ["error", 36]*/
var Blockchain = function(options) {
this.blockchainConfig = options.blockchainConfig;
@ -26,7 +28,7 @@ var Blockchain = function(options) {
genesisBlock: this.blockchainConfig.genesisBlock || false,
datadir: this.blockchainConfig.datadir || false,
mineWhenNeeded: this.blockchainConfig.mineWhenNeeded || false,
rpcHost: this.blockchainConfig.rpcHost || 'localhost',
rpcHost: dockerHostSwap(this.blockchainConfig.rpcHost) || defaultHost,
rpcPort: this.blockchainConfig.rpcPort || 8545,
rpcCorsDomain: this.blockchainConfig.rpcCorsDomain || false,
networkId: this.blockchainConfig.networkId || 1337,
@ -39,7 +41,7 @@ var Blockchain = function(options) {
bootnodes: this.blockchainConfig.bootnodes || "",
rpcApi: (this.blockchainConfig.rpcApi || ['eth', 'web3', 'net', 'debug']),
wsRPC: (this.blockchainConfig.wsRPC === undefined) || this.blockchainConfig.wsRPC,
wsHost: this.blockchainConfig.wsHost || 'localhost',
wsHost: dockerHostSwap(this.blockchainConfig.wsHost) || defaultHost,
wsPort: this.blockchainConfig.wsPort || 8546,
wsOrigins: this.blockchainConfig.wsOrigins || false,
wsApi: (this.blockchainConfig.wsApi || ['eth', 'web3', 'net', 'shh', 'debug']),