2

I am installing eth-netstats on a private network. I configured everything as the docs suggested, however the eth-net-intelligence api complains about a connection refused error:

2017-10-18 08:59 -05:00: [wsc] =✘= Socket error: { Error: connect ECONNREFUSED 192.168.137.101:80
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ECONNREFUSED',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '192.168.137.101',
  port: 80,
  type: 'error',
  target: 
   WebSocket {
     domain: null,
     _events: { error: [Function: onerror] },
     _eventsCount: 1,
     _maxListeners: undefined,
     _socket: null,
     _ultron: null,
     _closeReceived: false,
     bytesReceived: 0,
     readyState: 3,
     supports: { binary: true },
     extensions: null,
     _binaryType: 'arraybuffer',
     _isServer: false,
     url: 'ws://192.168.137.101/api/?_primuscb=Lylo2SH',
     protocolVersion: 13,
     _closeTimer: null,
     _closeCode: 1006 } }

The eth-netstats process is using only port 3000 , but not 80 (ws) or 443 (wss). I have been looking into the config and I can't find any parameter there that specifies the listening ip/port number for the websocket. Logically, there should be 2 ports open for listening, one for the browser and one for eth-net-intelligence-api to push the stats, but there is only 1 port, the 3000.

On the eth-net-intelligence-api I have this config file:

[
  {
    "name"              : "node-app",
    "script"            : "app.js",
    "log_date_format"   : "YYYY-MM-DD HH:mm Z",
    "merge_logs"        : false,
    "watch"             : false,
    "max_restarts"      : 10,
    "exec_interpreter"  : "node",
    "exec_mode"         : "fork_mode",
    "env":
    {
      "NODE_ENV"        : "production",
      "RPC_HOST"        : "localhost",
      "RPC_PORT"        : "8545",
      "LISTENING_PORT"  : "30303",
      "INSTANCE_NAME"   : "MY ETH",
      "CONTACT_DETAILS" : "1234567",
      "WS_SERVER"       : "ws://192.168.137.101",
      "WS_SECRET"       : "myethereum",
      "VERBOSITY"       : 2
    }
  }
]

What parameters do I have to modify in eth-netstats and eth-net-intelligence-api so the eth-net-intelligence process connects to the websocket of eth-netstats ???

2

There seems to be some confusion around about how to run eth-netstats for a private ethereum network. I found when doing this (using geth v1.7.3) you don't actually have to run the eth-net-intelligence-api.

Simply run geth with the following command line argument when you start each instance (set ${ETHSTATS_URL} to whatever it needs to be - eg http://localhost:3000)

--ethstats <login>:<chosen_secret>@${ETHSTATS_URL}

Also ensure that --rpcaddr and --rpcapi arguments are set as well.

And then also run eth-netstats on the machine pointed to by the above URL, in the directory where you checked out and built it (as per these instructions https://github.com/ethereum/go-ethereum/wiki/Setting-up-monitoring-on-local-cluster):

WS_SECRET=<chosen_secret> npm start

Then point your web browser at ${ETHSTATS_URL}:3000, and you will see the stats being updated from the node(s) in your private network.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.