diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index e1879a72c..9be5a974c 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -20,6 +20,11 @@ var Blockchain = function(options) { console.log("===> " + __("warning: running default config on a non-development environment")); } + let defaultWsApi = ['eth', 'web3', 'net', 'shh', 'debug']; + if (this.isDev) { + defaultWsApi.push('personal'); + } + this.config = { geth_bin: this.blockchainConfig.geth_bin || 'geth', networkType: this.blockchainConfig.networkType || 'custom', @@ -42,7 +47,7 @@ var Blockchain = function(options) { wsHost: this.blockchainConfig.wsHost || 'localhost', wsPort: this.blockchainConfig.wsPort || 8546, wsOrigins: this.blockchainConfig.wsOrigins || false, - wsApi: (this.blockchainConfig.wsApi || ['eth', 'web3', 'net', 'shh', 'debug', 'personal']), + wsApi: (this.blockchainConfig.wsApi || defaultWsApi), vmdebug: this.blockchainConfig.vmdebug || false, targetGasLimit: this.blockchainConfig.targetGasLimit || false, syncMode: this.blockchainConfig.syncMode, diff --git a/lib/cmds/blockchain/geth_commands.js b/lib/cmds/blockchain/geth_commands.js index 919b37f10..b60e14aae 100644 --- a/lib/cmds/blockchain/geth_commands.js +++ b/lib/cmds/blockchain/geth_commands.js @@ -123,7 +123,13 @@ class GethCommands { let self = this; let config = this.config; let rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net', 'debug']); - let ws_api = (this.config.wsApi || ['eth', 'web3', 'net', 'debug', 'personal']); + + let defaultWsApi = ['eth', 'web3', 'net', 'shh', 'debug']; + if (this.isDev) { + defaultWsApi.push('personal'); + } + + let ws_api = (this.config.wsApi || defaultWsApi); let args = [];