From 23f9a8c49c7990381baf6e74bb54b24e5a842d53 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 19 Nov 2019 15:18:12 -0500 Subject: [PATCH] fix(@embark/whisper): show message when geth port is already taken --- packages/plugins/geth/src/blockchain.js | 2 +- packages/plugins/geth/src/whisperClient.js | 2 +- packages/plugins/whisper/src/index.js | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/plugins/geth/src/blockchain.js b/packages/plugins/geth/src/blockchain.js index 416786e10..cb7159d40 100644 --- a/packages/plugins/geth/src/blockchain.js +++ b/packages/plugins/geth/src/blockchain.js @@ -222,7 +222,7 @@ Blockchain.prototype.run = function () { // TOCHECK I don't understand why stderr and stdout are reverted. // This happens with Geth and Parity, so it does not seems a client problem self.child.stdout.on('data', (data) => { - self.logger.info(`${self.client.name} error: ${data}`); + self.logger.error(`${self.client.name} error: ${data}`); }); self.child.stderr.on('data', async (data) => { diff --git a/packages/plugins/geth/src/whisperClient.js b/packages/plugins/geth/src/whisperClient.js index 8cb8e9df7..d32239f79 100644 --- a/packages/plugins/geth/src/whisperClient.js +++ b/packages/plugins/geth/src/whisperClient.js @@ -169,7 +169,7 @@ class WhisperGethClient { if (config.wsRPC) { cmd.push("--ws"); - cmd.push(`--wsport=${communicationConfig.connection.port || config.wsPost++}`); + cmd.push(`--wsport=${communicationConfig.connection.port || config.wsPort++}`); cmd.push(`--wsaddr=${communicationConfig.connection.host || config.wsHost++}`); if (config.wsOrigins) { diff --git a/packages/plugins/whisper/src/index.js b/packages/plugins/whisper/src/index.js index 51ad13922..3338077d3 100644 --- a/packages/plugins/whisper/src/index.js +++ b/packages/plugins/whisper/src/index.js @@ -1,6 +1,5 @@ import { __ } from 'embark-i18n'; -import {dappPath, canonicalHost, defaultHost} from 'embark-utils'; -const constants = require('embark-core/constants'); +import {canonicalHost, defaultHost} from 'embark-utils'; const API = require('./api.js'); class Whisper { @@ -11,8 +10,6 @@ class Whisper { this.communicationConfig = embark.config.communicationConfig; this.embarkConfig = embark.config.embarkConfig; this.embark = embark; - this.webSocketsChannels = {}; - this.modulesPath = dappPath(embark.config.embarkConfig.generationDir, constants.dappArtifacts.symlinkDir); this.api = new API(embark); this.whisperNodes = {}; @@ -42,7 +39,7 @@ class Whisper { let connection = this.communicationConfig.connection || {}; const config = { server: canonicalHost(connection.host || defaultHost), - port: connection.port || '8546', + port: connection.port || '8557', type: connection.type || 'ws' };