fix(@embark/whisper): show message when geth port is already taken

This commit is contained in:
Jonathan Rainville 2019-11-19 15:18:12 -05:00 committed by Pascal Precht
parent dba5f771f2
commit 23f9a8c49c
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
3 changed files with 4 additions and 7 deletions

View File

@ -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) => {

View File

@ -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) {

View File

@ -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'
};