From 044759ef526c01f8f64e259b1e0aca934157f2a8 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 10 Apr 2018 15:08:08 -0400 Subject: [PATCH] get node name and version --- lib/core/engine.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/core/engine.js b/lib/core/engine.js index 53ee62032..0b62011f8 100644 --- a/lib/core/engine.js +++ b/lib/core/engine.js @@ -210,11 +210,13 @@ class Engine { 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' + + // TODO: web3_clientVersion method is currently not implemented in web3.js 1.0 + self.web3._requestManager.send({method: 'web3_clientVersion', params: []}, (err, version) => { + if (err) { + return cb({name: "Ethereum node (version unknown)", status: 'on'}); + } + return cb({name: version, status: 'on'}); }); }); });