Skip to content

Commit d70264a

Browse files
blockchain -- defaultHost, dockerHostSwap
1 parent 2ad8097 commit d70264a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/cmds/blockchain/blockchain.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const constants = require('../../constants.json');
88
const GethCommands = require('./geth_commands.js');
99
const DevFunds = require('./dev_funds.js');
1010

11+
const {defaultHost, dockerHostSwap} = require('../../utils/host');
12+
1113
/*eslint complexity: ["error", 36]*/
1214
var Blockchain = function(options) {
1315
this.blockchainConfig = options.blockchainConfig;
@@ -31,7 +33,7 @@ var Blockchain = function(options) {
3133
genesisBlock: this.blockchainConfig.genesisBlock || false,
3234
datadir: this.blockchainConfig.datadir || false,
3335
mineWhenNeeded: this.blockchainConfig.mineWhenNeeded || false,
34-
rpcHost: this.blockchainConfig.rpcHost || 'localhost',
36+
rpcHost: dockerHostSwap(this.blockchainConfig.rpcHost) || defaultHost,
3537
rpcPort: this.blockchainConfig.rpcPort || 8545,
3638
rpcCorsDomain: this.blockchainConfig.rpcCorsDomain || false,
3739
networkId: this.blockchainConfig.networkId || 1337,
@@ -44,7 +46,7 @@ var Blockchain = function(options) {
4446
bootnodes: this.blockchainConfig.bootnodes || "",
4547
rpcApi: (this.blockchainConfig.rpcApi || ['eth', 'web3', 'net', 'debug']),
4648
wsRPC: (this.blockchainConfig.wsRPC === undefined) || this.blockchainConfig.wsRPC,
47-
wsHost: this.blockchainConfig.wsHost || 'localhost',
49+
wsHost: dockerHostSwap(this.blockchainConfig.wsHost) || defaultHost,
4850
wsPort: this.blockchainConfig.wsPort || 8546,
4951
wsOrigins: this.blockchainConfig.wsOrigins || false,
5052
wsApi: (this.blockchainConfig.wsApi || defaultWsApi),

0 commit comments

Comments
 (0)