Skip to content

Commit 69f356b

Browse files
committed
only use personal in --dev mode
1 parent eda616d commit 69f356b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/cmds/blockchain/blockchain.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ var Blockchain = function(options) {
2020
console.log("===> " + __("warning: running default config on a non-development environment"));
2121
}
2222

23+
let defaultWsApi = ['eth', 'web3', 'net', 'shh', 'debug'];
24+
if (this.isDev) {
25+
defaultWsApi.push('personal');
26+
}
27+
2328
this.config = {
2429
geth_bin: this.blockchainConfig.geth_bin || 'geth',
2530
networkType: this.blockchainConfig.networkType || 'custom',
@@ -42,7 +47,7 @@ var Blockchain = function(options) {
4247
wsHost: this.blockchainConfig.wsHost || 'localhost',
4348
wsPort: this.blockchainConfig.wsPort || 8546,
4449
wsOrigins: this.blockchainConfig.wsOrigins || false,
45-
wsApi: (this.blockchainConfig.wsApi || ['eth', 'web3', 'net', 'shh', 'debug', 'personal']),
50+
wsApi: (this.blockchainConfig.wsApi || defaultWsApi),
4651
vmdebug: this.blockchainConfig.vmdebug || false,
4752
targetGasLimit: this.blockchainConfig.targetGasLimit || false,
4853
syncMode: this.blockchainConfig.syncMode,

lib/cmds/blockchain/geth_commands.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ class GethCommands {
123123
let self = this;
124124
let config = this.config;
125125
let rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net', 'debug']);
126-
let ws_api = (this.config.wsApi || ['eth', 'web3', 'net', 'debug', 'personal']);
126+
127+
let defaultWsApi = ['eth', 'web3', 'net', 'shh', 'debug'];
128+
if (this.isDev) {
129+
defaultWsApi.push('personal');
130+
}
131+
132+
let ws_api = (this.config.wsApi || defaultWsApi);
127133

128134
let args = [];
129135

0 commit comments

Comments
 (0)