display ethereum node name and embark version in available services

This commit is contained in:
Iuri Matias 2016-10-22 12:11:47 -04:00
parent f337ffd418
commit 4989876135
1 changed files with 11 additions and 2 deletions

View File

@ -25,10 +25,19 @@ ServicesMonitor.prototype.check = function() {
web3.setProvider(new web3.providers.HttpProvider(web3Endpoint)); web3.setProvider(new web3.providers.HttpProvider(web3Endpoint));
callback(null, web3, []); callback(null, web3, []);
}, },
function addEmbarkVersion(web3, result, callback) {
self.logger.trace('addEmbarkVersion');
result.push('Embark 2.1.0'.green);
callback(null, web3, result);
},
function checkEthereum(web3, result, callback) { function checkEthereum(web3, result, callback) {
self.logger.trace('checkEthereum'); self.logger.trace('checkEthereum');
var service = 'geth (Ethereum)'; var service;
service = (web3.isConnected()) ? service.green : service.red; if (web3.isConnected()) {
service = (web3.version.node.split("/")[0] + " (Ethereum)").green;
} else {
service = "No Blockchain node found".red;
}
result.push(service); result.push(service);
callback(null, web3, result); callback(null, web3, result);
}, },