eth-netstats icon indicating copy to clipboard operation
eth-netstats copied to clipboard

Private chains

Open rstormsf opened this issue 7 years ago • 24 comments

Any docs on how would I use it for private chain?

rstormsf avatar May 17 '17 17:05 rstormsf

Hi i would like to now if it possible to use eth-netstats in a testnet if so there's any step or documentation in this context. Thanks

Esperadoce avatar Jun 05 '17 14:06 Esperadoce

These instructions helped me. I have eth-netstats running locally and displaying stats for my private network of 4 nodes (3 remote). However I'm struggling to deploy eth-netstats to heroku..

mattvick avatar Jul 13 '17 12:07 mattvick

I followed mattvick's instruction link but still can't get eth-netstats to report anything about my private network. I only see "ATTENTION!This page does not represent the entire state of the ethereum network - listing a node on this page is a voluntary process." and nothing else.

aphilsmith avatar Aug 02 '17 00:08 aphilsmith

Shouldn't be that hard. I'm totally new to Ethereum (less than 1 week), and I can setup eth-netstats for my private network.

  1. when starting eth-netstats, you need to give it the WS_SECRET, like this: WS_SECRET=Hello npm start

  2. in eth-net-intelligence-api, app.json settings should look like this:

    "env":
    {
      "NODE_ENV"        : "test", //I changed it from production, but I guess it doesn't matter.
      "RPC_HOST"        : "localhost",
      "RPC_PORT"        : "8545",
      "LISTENING_PORT"  : "30303",
      "INSTANCE_NAME"   : "node1",  // give it a name
      "CONTACT_DETAILS" : "",
      "WS_SERVER"       : "http://localhost:3000", // if running on same machine, other change the localhost to real ip.
      "WS_SECRET"       : "Hello", //same as WS_SECRET setting on eth-netstats.
      "VERBOSITY"       : 2
    }

then you can try npm start, so that you can see logs.

That's it.

thomasyuan avatar Aug 17 '17 14:08 thomasyuan

@aphilsmith

If you inspect the page, you will discover that netstat.min.* files are not loaded (returns 404). This is because the Gruntfile.js has not been executed to create the various resources declared in that file. If you do not have Grunt installed, run:

npm install -g grunt-cli

Then execute the grunt script in the directory where you have eth-stats source code:

grunt

Restart eth-stats app:

WS_SECRET=<your-secret> npm start

You should now see the stats displayed.

ocheja avatar Aug 30 '17 05:08 ocheja

@ocheja I'm grateful for your instruction. It works like charm

trungtt198x avatar Dec 11 '17 10:12 trungtt198x

Most of my confusion was solved when I realized that ethstats require two different processes. One is the node server(aka websockets server) which hosts the website, and another is the pm2 process which transmits the data from ethereum client to website.

AyushyaChitransh avatar Jan 25 '18 15:01 AyushyaChitransh

@thomasyuan I did the same thing as you mentioned

  1. In eth-net-intelligence-api, app.json settings it looks like this "env": { "NODE_ENV" : "production", "RPC_HOST" : "localhost", "RPC_PORT" : "8454", "LISTENING_PORT" : "30303", "INSTANCE_NAME" : "node 1", "CONTACT_DETAILS" : "", "WS_SERVER" : "http://localhost:3000", "WS_SECRET" : "Hello", "VERBOSITY" : 2 }
  2. when starting eth-netstats, i gave WS_SECRET, like this: WS_SECRET=Hello npm start It gives a error that says "'WS_SECRET' is not recognized as an internal or external command, operable program or batch file."

If i give WS_SECRET as: npm start WS_SECRET=Hello It gives an erroe that says:

[email protected] start C:\Users\nikhita.nimbalkar\Monitoring_Privatenet\eth- netstats node ./bin/www "WS_SECRET=Hello"

2018-02-19 12:18:00.234 [API] WS_SECRET NOT SET!!! Here is the image of the error image

Can you please help me out on how to solve this error.

nikitha12 avatar Feb 19 '18 12:02 nikitha12

in Windows, you should : set WS_SECRET="Hello" npm start

zeon-epro avatar Jun 13 '18 05:06 zeon-epro

There are better blogs available on this documentation:

  • https://ayushyachitransh.wordpress.com/2018/04/21/setting-up-monitoring-for-ethereum-network/
  • https://blog.ippon.tech/monitoring-the-ethereum-blockchain/

AyushyaChitransh avatar Jun 13 '18 06:06 AyushyaChitransh

No matter which of these tutorials I follow, I always get the same error:

errormessageeth

Anybody had the same issue?

BoredCodingMonkey avatar Jun 20 '18 14:06 BoredCodingMonkey

Error says:

Closed - wrong auth

This means that in the config to start the eth-net-intelligence-api service, you entered incorrect information of WS_SECRET

AyushyaChitransh avatar Jun 20 '18 15:06 AyushyaChitransh

I had the same idea and repeated it with various keys, always with the same result.

Setting it with:

set WS_SECRET=secret && npm start

... is the correct way to do it?

BoredCodingMonkey avatar Jun 20 '18 16:06 BoredCodingMonkey

Seems like the client(geth) is using secret like “ secret”, many spaces before “secret”. How did you start the geth?

thomasyuan avatar Jun 20 '18 22:06 thomasyuan

The space is there because i painted black over the rest of the WS_SECRET.

I am starting geth with: geth --identity "miner1" --rpccorsdomain "*" --rpcapi "db,eth,net,web3,personal,miner,admin" --nat "any" --networkid 500 --datadir "miner1" --nodiscover --mine --rpc --rpcport "8042" --port "30303" --unlock 0 --password miner1\password.sec

And my app.json:

[
  {
    "name"              : "Test-Blockchain",
    "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"        : "Test",
      "RPC_HOST"        : "localhost",
      "RPC_PORT"        : "8042",
      "LISTENING_PORT"  : "30303",
      "INSTANCE_NAME"   : "miner1",
      "CONTACT_DETAILS" : "",
      "WS_SERVER"       : "http://localhost:3000",
      "WS_SECRET"       : "Secret",
      "VERBOSITY"       : 3
    }
  }
]

BoredCodingMonkey avatar Jun 21 '18 09:06 BoredCodingMonkey

Try add option ‘--ethstats value’ Reporting URL of a ethstats service (nodename:secret@host:port)

thomasyuan avatar Jun 22 '18 01:06 thomasyuan

Thanks for the hint. I found that it is an issue with the syntax I used:

bc_error

You can see in the screenshot above, that it works, when I leave out the whitespace in front of the &&. Thank you for your help. Maybe this helps the next Windows user.

BoredCodingMonkey avatar Jun 26 '18 17:06 BoredCodingMonkey

created a dashboard for non-pow networks https://github.com/goerli/netstats-server/

5chdn avatar Dec 01 '18 19:12 5chdn

i have a question about node nethermind. What settings need to be made?

zrock23 avatar Dec 10 '20 11:12 zrock23

no name #. I need help.

zrock23 avatar Dec 11 '20 00:12 zrock23

eth-netstats setup on private blockchain is only accessible thru HTTP://localhost:3000 but not HTTP://{{ipaddress}}:3000. ports are open, netstat -tupln shows app is listening on 3000 port. what has to be done in production environment ?

hma23 avatar Jun 12 '21 17:06 hma23

eth-netstats setup on private blockchain is only accessible thru HTTP://localhost:3000 but not HTTP://{{ipaddress}}:3000. ports are open, netstat -tupln shows app is listening on 3000 port. what has to be done in production environment ?

What is the output of netstat? Is your web server running on localhost or 0.0.0.0 (all interfaces)? This is most likely the issue

mikeyb avatar Jun 12 '21 18:06 mikeyb

eth-netstats setup on private blockchain is only accessible thru HTTP://localhost:3000 but not HTTP://{{ipaddress}}:3000. ports are open, netstat -tupln shows app is listening on 3000 port. what has to be done in production environment ?

What is the output of netstat? Is your web server running on localhost or 0.0.0.0 (all interfaces)? This is most likely the issue

root@scale-geth-2:/home/ubuntu# netstat -tupln |grep 3000 tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN 232804/node

hma23 avatar Jun 12 '21 20:06 hma23

My node.json looks like this. --eth.netstats flag is added to the geth command [ { "name" : "spu-miner", "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" : "30311", "INSTANCE_NAME" : "sp-1", "CONTACT_DETAILS" : "12345", "WS_SERVER": "http://192.168.x.x:3000", "WS_SECRET": "spuggg", "VERBOSITY" : 1 } } ]

hma23 avatar Jun 12 '21 20:06 hma23