question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ethstats` plugin for node status reporting

See original GitHub issue

Background

ethstats is an Ethereum-specific, opt-in node status reporting service.

The original JavaScript implementation was developed by Marian Oancea (@cubedro).

The server component is called eth-netstats; it can be seen on ethstats.net (ETH main-net), ropsten-stats.parity.io (Ropsten test-net), and others, including private/development chains via puppeth.

The stand-alone client component is called eth-net-intelligence-api; this can be used with any node implementing a certain sub-set of Ethereum’s JSON-RPC queries required by e-n-i-a.

(An alternative approach - taken, for example, by geth, - is implementing a client as a sub-service in the node itself.)

Client-server communication happens over WebSockets.

This issue is about implementing the functionality in trinity, preferably as a plug-in.

Details

e-n-i-a is by now mostly unmaintained; it also expects features that trinity does not currently have, like a JSON-RPC-over-HTTP interface, as well as certain JSON-RPC queries (e.g. subscriptions to “new block” events).

Instead of trying to “fix” that, it “would be nice” to have this as a plug-in. This eliminates the need for JSON-RPC-over-HTTP (which is itself well-suited to be a plug-in), and allows using internal APIs (event subscriptions, timers, etc.).

The plug-in APIs in trinity are unstable; this work will help produce a “demo” of what it takes to write a trinity plug-in, as well as shape the APIs themselves.

Inputs

These are listed “for information purposes”; refer to the existing implementations for actual ones.

Note that some are or will be implemented as part of a different plug-in!

(Likely obtained using internal APIs; falling back to JSON-RPC request over IPC socket could be possible, but that would probably show an inconsistency in internal APIs…)

  • Operator-specified (yet human-readable 😉) node name;
  • operator-specified “contact details”;
  • node software id/version;
  • OS id/version;
  • Python impl-n id/version;
  • whether active/syncing/mining;
  • PoW hash rate (actually mostly useless due to prevalence of grinder proxies);
  • chain head:
    • block number/hash/difficulty;
    • transaction count;
    • ommer (uncle) count;
  • recommended gas price;
  • peer count;
  • transaction count in pending transaction pool;
  • uptime.

Output

JSON messages over a WebSocket, to an operator-specified remote server.

Since ethstats is a “push” scheme, a “shared secret” (essentially a passphrase, also operator-specified) must be used.

Notes

I highly recommend reading @shazow’s notes on the ethstats protocol (linked below, in section References -> Server) to get in touch with its quirks.

Personally, I found geth’s client code slightly more readable than e-n-i-a, but I’m very biased.

Also, to clarify: I’m not exactly thrilled by the ethstats protocol, but it’s already got infrastructure around it to be immediately usable.

References

Client

Server

Possibly related issues/PRs

These are for further exploration of the topic. Status in parenthesis, at time of posting.

  • PR #1182 (merged) - Convert “fix-unclean-shutdown” to plugin
  • Issue #979 (open) - Plugin architecture
  • Issue #1090 (open) - Convert plugin API to be purely event based
  • Issue #1103 (open) - Create guide on how to write plugins

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:30 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
veoxcommented, Sep 28, 2018

@cubedro You’ve misspelled @evgeniuz again. 😉 Fixed.

4reactions
evgeniuscommented, Sep 4, 2018

@owocki no way, don’t bring me into this 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

`ethstats` plugin for node status reporting | ethereum Funded Issue ...
Background `ethstats` is an Ethereum-specific, opt-in node status reporting service. The original JavaScript implementation was developed by [Marian ...
Read more >
ethstats - Go Packages
Package ethstats implements the network stats reporting service. ... Protocols implements node.Service, returning the P2P network protocols used by the ...
Read more >
How to build Ethereum Dashboard and to monitor your ...
eth-netstats : This is a visual interface for tracking ethereum network status. It uses WebSockets to receive stats from running nodes and ...
Read more >
Collaborative Markdown Knowledge Base - HackMD
INFO [/usr/src/app/webpack:/@dappnode/dappmanager/src/modules/ ... EthStats 2022-09-06 19-31-22.7581| Found plugin type Nethermind.
Read more >
Chapter 7. collectd plugins Red Hat OpenStack Platform 13
Use the battery plugin to report the remaining capacity, power, or voltage of ... When you deploy collectd, the ceph plugin is added...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found