update whisper check
This commit is contained in:
parent
59c3d82260
commit
4fcfc6c142
|
@ -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) {
|
||||
|
|
|
@ -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'});
|
||||
|
|
Loading…
Reference in New Issue