mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-24 12:40:21 +00:00
fix(@embark/whisper): fix whisper status check
This commit is contained in:
parent
ee56f37713
commit
926b2bb046
@ -4,7 +4,7 @@ const constants = require("embark-core/constants");
|
|||||||
const API = require("./api.js");
|
const API = require("./api.js");
|
||||||
import { BlockchainProcessLauncher } from "./blockchainProcessLauncher";
|
import { BlockchainProcessLauncher } from "./blockchainProcessLauncher";
|
||||||
import { ws, rpcWithEndpoint } from "./check.js";
|
import { ws, rpcWithEndpoint } from "./check.js";
|
||||||
const { normalizeInput } = require("embark-utils");
|
const { normalizeInput, buildUrlFromConfig } = require("embark-utils");
|
||||||
|
|
||||||
class Whisper {
|
class Whisper {
|
||||||
constructor(embark, _options) {
|
constructor(embark, _options) {
|
||||||
@ -64,10 +64,11 @@ class Whisper {
|
|||||||
|
|
||||||
registerServiceCheck() {
|
registerServiceCheck() {
|
||||||
this.events.request("services:register", "Whisper", (cb) => {
|
this.events.request("services:register", "Whisper", (cb) => {
|
||||||
if (this.blockchainConfig.endpoint.startsWith('ws')) {
|
const endpoint = buildUrlFromConfig(this.communicationConfig.connection);
|
||||||
return ws(this.blockchainConfig.endpoint, (err, version) => this._getNodeState(err, version, cb));
|
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");
|
}, 5000, "off");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user