diff --git a/lib/core/engine.js b/lib/core/engine.js index ff595db7..01411a53 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -191,21 +191,28 @@ class Engine { } self.servicesMonitor.addCheck('Ethereum', function (cb) { - if (self.web3.connected) { - return cb({ - name: (self.web3.version.node.split("/")[0] + " " + self.web3.version.node.split("/")[1].split("-")[0] + " (Ethereum)"), - status: 'on' - }); - } else { + if (self.web3.currentProvider === undefined) { return cb({name: "No Blockchain node found", status: 'off'}); } + + self.web3.eth.getAccounts(function(err, _accounts) { + if (err) { + return cb({name: "No Blockchain node found", status: 'off'}); + } + return cb({ + //name: (self.web3.version.node.split("/")[0] + " " + self.web3.version.node.split("/")[1].split("-")[0] + " (Ethereum)"), + // TODO: get nodename + name: "Ethereum node", + status: 'on' + }); + }); }); - //this.registerModule('whisper', { - // addCheck: this.servicesMonitor.addCheck.bind(this.servicesMonitor), - // communicationConfig: this.config.communicationConfig, - // web3: this.web3 - //}); + this.registerModule('whisper', { + addCheck: this.servicesMonitor.addCheck.bind(this.servicesMonitor), + communicationConfig: this.config.communicationConfig, + web3: this.web3 + }); } libraryManagerService(_options) { diff --git a/lib/modules/whisper/index.js b/lib/modules/whisper/index.js index 9fdef066..4546dd24 100644 --- a/lib/modules/whisper/index.js +++ b/lib/modules/whisper/index.js @@ -19,8 +19,8 @@ class Whisper { setServiceCheck() { const self = this; self.addCheck('Whisper', function (cb) { - self.web3.version.getWhisper(function (err, version) { - if (err) { + self.web3.shh.getVersion(function (err, version) { + if (err || version == "2") { return cb({name: 'Whisper', status: 'off'}); } else { return cb({name: 'Whisper (version ' + version + ')', status: 'on'});