mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 06:16:01 +00:00
Merge pull request #355 from embark-framework/bug_fix/node_name
restore properly display node name and version
This commit is contained in:
commit
e0982e0427
@ -210,11 +210,17 @@ 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'});
|
||||
}
|
||||
let nodeName = version.split("/")[0];
|
||||
let versionNumber = version.split("/")[1].split("-")[0];
|
||||
let name = nodeName + " " + versionNumber + " (Ethereum)";
|
||||
|
||||
return cb({name: name, status: 'on'});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user