From 69f356b3f028d2f8729a15ba3fbdae39dd7edd19 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 19 Jul 2018 10:58:47 +0300 Subject: [PATCH] only use personal in --dev mode --- lib/cmds/blockchain/blockchain.js | 7 ++++++- lib/cmds/blockchain/geth_commands.js | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index e1879a72..9be5a974 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 919b37f1..b60e14aa 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 = [];