From d70264adb6da3816fdf615f99409dd6a20e91cb9 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Sun, 15 Jul 2018 12:30:51 -0500 Subject: [PATCH] blockchain -- defaultHost, dockerHostSwap --- lib/cmds/blockchain/blockchain.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index c556ac40..2ab7fc74 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -8,6 +8,8 @@ const constants = require('../../constants.json'); const GethCommands = require('./geth_commands.js'); const DevFunds = require('./dev_funds.js'); +const {defaultHost, dockerHostSwap} = require('../../utils/host'); + /*eslint complexity: ["error", 36]*/ var Blockchain = function(options) { this.blockchainConfig = options.blockchainConfig; @@ -31,7 +33,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, @@ -44,7 +46,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 || defaultWsApi),