From 4989876135497263148df9127502e69440ec9e40 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sat, 22 Oct 2016 12:11:47 -0400 Subject: [PATCH] display ethereum node name and embark version in available services --- lib/services.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/services.js b/lib/services.js index 4f717ed4..48f5bf3c 100644 --- a/lib/services.js +++ b/lib/services.js @@ -25,10 +25,19 @@ ServicesMonitor.prototype.check = function() { web3.setProvider(new web3.providers.HttpProvider(web3Endpoint)); 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) { self.logger.trace('checkEthereum'); - var service = 'geth (Ethereum)'; - service = (web3.isConnected()) ? service.green : service.red; + var service; + if (web3.isConnected()) { + service = (web3.version.node.split("/")[0] + " (Ethereum)").green; + } else { + service = "No Blockchain node found".red; + } result.push(service); callback(null, web3, result); },