cubedro / eth-netstats

Ethereum Network Stats
https://ethstats.net/
GNU General Public License v3.0
854 stars 539 forks source link

Empty response from server #347

Closed daithi-coombes closed 5 years ago

daithi-coombes commented 5 years ago

All seems good, am running ethnetstats and eth-intelligence-api from within same container. But can't access http://localhost:3000, I'm trying to monitor a parity node. Its up and can connect using web3 no problem.

$ curl -X GET http://localhost:3000
curl: (52) Empty reply from server

When running 1st I get the following from eth-netstats:

TypeError: results.reverse is not a function

Think it could be related to: #293 The above error only shows once, so could be false positive whilst netstat is waiting for intelligence-api to load?

Anyways, the logs seem to be working...

0|eth-netstats  | 2019-07-23 14:32:15.665 [API] [HIS] Got history from: node01
0|eth-netstats  | 2019-07-23 14:32:17.746 [API] [TXS] Pending: 8150 from: node01
0|eth-netstats  | 2019-07-23 14:32:21.768 [API] [HIS] Got history from: node01
0|eth-netstats  | 2019-07-23 14:32:21.885 [API] [TXS] Pending: 8060 from: node01
0|eth-netstats  | 2019-07-23 14:32:21.896 [API] [BLK] Block: 8207476 td: 11141168487583156443911 from: node01 ip: ::ffff:127.0.0.1
0|eth-netstats  | 2019-07-23 14:32:21.903 [API] [TXS] Pending: 8061 from: node01
0|eth-netstats  | 2019-07-23 14:32:21.943 [API] [TXS] Pending: 8062 from: node01
0|eth-netstats  | 2019-07-23 14:32:22.259 [API] [TXS] Pending: 8100 from: node01
0|eth-netstats  | 2019-07-23 14:32:22.277 [API] [TXS] Pending: 8108 from: node01
0|eth-netstats  | 2019-07-23 14:32:22.758 [API] [TXS] Pending: 8131 from: node01
0|eth-netstats  | 2019-07-23 14:32:23.280 [API] [TXS] Pending: 8169 from: node01
0|eth-netstats  | 2019-07-23 14:32:26.754 [API] [TXS] Pending: 8170 from: node01
0|eth-netstats  | 2019-07-23 14:32:27.273 [API] [TXS] Pending: 8171 from: node01

I've disabled firewall also, and ports are exposed for eth-netstats but not intelligence-api as they're in same container

daithi-coombes commented 5 years ago

Issue is with pm2, have recreated it outside of container.

Here is the app.json:

{
  "name"        : "mynode-0",
  "cwd"         : ".",
  "script"      : "app.js",
  "log_date_format"   : "YYYY-MM-DD HH:mm Z",
  "merge_logs"    : false,
  "watch"       : false,
  "exec_interpreter"  : "node",
  "exec_mode"     : "fork_mode",
  "env":
  {
    "NODE_ENV"    : "production",
    "RPC_HOST"    : "1.2.3.4",   // my parity ip address
    "RPC_PORT"    : "8545",     // http rpc_api port for my parity node
    "INSTANCE_NAME"   : "mynode-0",
    "WS_SERVER"     : "http://localhost:3000",
    "WS_SECRET"     : "pswd",
  }
}
daithi-coombes commented 5 years ago

Found solution. Don't bother to create pm2 json for eth-netstats. Instead run node daemon directly

WS_SECRET=pswd pm2 start ./bin/www