From 491b2aa6f00307357c4b425d9a73ae1a219dd562 Mon Sep 17 00:00:00 2001 From: cubedro Date: Sun, 22 Mar 2015 22:55:15 +0200 Subject: [PATCH] fixed version for POC9 --- lib/node.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/node.js b/lib/node.js index 797d30f..5aba8a6 100644 --- a/lib/node.js +++ b/lib/node.js @@ -16,7 +16,6 @@ Socket = Primus.createSocket({ }); var INSTANCE_NAME = process.env.INSTANCE_NAME; -var ETH_VERSION = "unknown"; if(process.env.NODE_ENV === 'production') { @@ -26,7 +25,6 @@ if(process.env.NODE_ENV === 'production') } } -ETH_VERSION = shelljs.exec((process.env.ETH_IMPLEMENTATION === 'go' ? 'ethereum version' : 'eth -V'), {silent: true}).output; var socket = new Socket(process.env.WS_SERVER || 'ws://localhost:3000'); var WS_SECRET = process.env.WS_SECRET || "eth-net-stats-has-a-secret"; @@ -37,10 +35,12 @@ function Node() { var self = this; - web3.setProvider(new web3.providers.HttpProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8545'))); + web3.setProvider(new web3.providers.HttpProvider('http://' + (process.env.RPC_HOST || 'localhost') + ':' + (process.env.RPC_PORT || '8080'))); try { - ETH_VERSION = web3.version; + ETH_VERSION = web3.version.client; + NET_VERSION = web3.version.network; + API_VERSION = web3.version.api; } catch (err) { console.log("couldn't get Version"); @@ -48,7 +48,9 @@ function Node() this.info = { name: INSTANCE_NAME || (process.env.EC2_INSTANCE_ID || os.hostname()), - node: 'unknown', + node: ETH_VERSION, + net: NET_VERSION, + api: API_VERSION, os: os.platform(), os_v: os.release() };