mirror of https://github.com/embarklabs/embark.git
When communication is disabled in config, do not run the module in embark.
Previous to this change, `Geth: WARN [06-25|16:46:26] origin 'embark' not allowed on WS-RPC interface` would appear in the logs when the module was run while disabled. Updated the cors component so that when `rpcCorsDomain` and `wsOrigins` are set to `'auto'`, and all components are disabled `rpcCorsDomain` and `wsOrigins` are passed as a null parameter to geth as opposed to being passed as `'auto'`.
This commit is contained in:
parent
0ba5f1a1b3
commit
d32708fcde
|
@ -119,8 +119,14 @@ Config.prototype._updateBlockchainCors = function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
let cors = corsParts.join(',');
|
let cors = corsParts.join(',');
|
||||||
if(blockchainConfig.rpcCorsDomain === 'auto' && cors.length) blockchainConfig.rpcCorsDomain = cors;
|
if(blockchainConfig.rpcCorsDomain === 'auto'){
|
||||||
if(blockchainConfig.wsOrigins === 'auto' && cors.length) blockchainConfig.wsOrigins = cors;
|
if(cors.length) blockchainConfig.rpcCorsDomain = cors;
|
||||||
|
else blockchainConfig.rpcCorsDomain = '';
|
||||||
|
}
|
||||||
|
if(blockchainConfig.wsOrigins === 'auto'){
|
||||||
|
if(cors.length) blockchainConfig.wsOrigins = cors;
|
||||||
|
else blockchainConfig.wsOrigins = '';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, enabledByDefault) {
|
Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, enabledByDefault) {
|
||||||
|
|
|
@ -11,6 +11,10 @@ class Whisper {
|
||||||
this.web3 = new Web3();
|
this.web3 = new Web3();
|
||||||
this.embark = embark;
|
this.embark = embark;
|
||||||
|
|
||||||
|
if (!this.communicationConfig.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.connectToProvider();
|
this.connectToProvider();
|
||||||
this.setServiceCheck();
|
this.setServiceCheck();
|
||||||
this.addWhisperToEmbarkJS();
|
this.addWhisperToEmbarkJS();
|
||||||
|
|
Loading…
Reference in New Issue