From 926b2bb046af30727ab4f11837c3f5279bc01dc5 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 13 Dec 2019 14:29:46 -0500 Subject: [PATCH] fix(@embark/whisper): fix whisper status check --- packages/plugins/whisper-geth/src/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/plugins/whisper-geth/src/index.js b/packages/plugins/whisper-geth/src/index.js index 578759467..c0a536a34 100644 --- a/packages/plugins/whisper-geth/src/index.js +++ b/packages/plugins/whisper-geth/src/index.js @@ -4,7 +4,7 @@ const constants = require("embark-core/constants"); const API = require("./api.js"); import { BlockchainProcessLauncher } from "./blockchainProcessLauncher"; import { ws, rpcWithEndpoint } from "./check.js"; -const { normalizeInput } = require("embark-utils"); +const { normalizeInput, buildUrlFromConfig } = require("embark-utils"); class Whisper { constructor(embark, _options) { @@ -64,10 +64,11 @@ class Whisper { registerServiceCheck() { this.events.request("services:register", "Whisper", (cb) => { - if (this.blockchainConfig.endpoint.startsWith('ws')) { - return ws(this.blockchainConfig.endpoint, (err, version) => this._getNodeState(err, version, cb)); + const endpoint = buildUrlFromConfig(this.communicationConfig.connection); + if (endpoint.startsWith('ws')) { + return ws(endpoint, (err, version) => this._getNodeState(err, version, cb)); } - rpcWithEndpoint(this.blockchainConfig.endpoint, (err, version) => this._getNodeState(err, version, cb)); + rpcWithEndpoint(endpoint, (err, version) => this._getNodeState(err, version, cb)); }, 5000, "off"); }