chore(@embark/whisper): add warning if comm port is the same as node

Co-Authored-By: Eric Mastro <ericmastro@status.im>
This commit is contained in:
Jonathan Rainville 2019-11-19 15:27:53 -05:00 committed by Pascal Precht
parent 23f9a8c49c
commit 14dbb63775
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,11 @@ class Whisper {
});
this.events.request("communication:node:register", "whisper", (readyCb) => {
if (this.communicationConfig.connection.port === this.embark.config.blockchainConfig.wsPort) {
this.logger.warn(__('Communication connection set to open on port %s, which is the same as your blockchain node. It will probably conflict', this.communicationConfig.connection.port));
this.logger.warn(__('You can change that port in your communication config file as `connection.port`'));
}
let clientName = this.communicationConfig.client || "geth";
let registerCb = this.whisperNodes[clientName];
if (!registerCb) return readyCb("whisper client " + clientName + " not found");