GithubHelp home page GithubHelp logo

rojotek / eth2stats-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alethio/eth2stats-client

0.0 0.0 0.0 134 KB

Command line stats collector for Eth2Stats Ethereum 2 Network Monitor

Home Page: https://eth2stats.io

License: MIT License

Dockerfile 0.87% Makefile 0.57% Go 96.31% Shell 2.25%

eth2stats-client's Introduction

Ethereum 2.0 Network Stats and Monitoring - CLI Client

This is an intial POC release of the eth2stats network monitoring suite

It supports Prysm, Lighthouse, Teku, Nimbus and v1 of standardized api (Lodestar). Once the standard lands the client will be refactored to support just that.

Supported clients and protocols:

Client Supported Protocols Supported features
Prysm GRPC Version, head, sync stats, memory, attestation count
Lighthouse HTTP Version, head, sync stats, memory
Teku HTTP Version, head, sync stats, memory
Lodestar (v1) HTTP Version, head, sync stats, memory, attestation count
Nimbus HTTP Version, head, sync stats, memory
Trinity

Current live deployments:

Getting Started

The following section uses Docker to run. If you want to build from source go here.

The most important variable to change is --eth2stats.node-name which will define what name your node has on eth2stats.

Prysm Sapphire Testnet

The first thing you should do is get a beacon chain client node running and connected to said beacon chain by joining the Prysm Sapphire Testnet.

You can then get eth2stats sending data by running the following command:

docker run -d --name eth2stats --restart always --network="host" \
      -v ~/eth2stats/data:/data \
      alethio/eth2stats-client:latest \
      run --v \
      --eth2stats.node-name="YourPrysmNode" \
      --data.folder="/data" \
      --eth2stats.addr="grpc.sapphire.eth2stats.io:443" --eth2stats.tls=true \
      --beacon.type="prysm" --beacon.addr="localhost:4000"

If you want to see your beacon node client's memory usage as well, make sure you have metrics enabled in Prysm and add this cli argument, pointing at the right host --beacon.metrics-addr="http://localhost:8080/metrics".

Lighthouse Testnet

The first thing you should do is get a beacon chain client node running and connected to said beacon chain by joining the Lighthouse Testnet.

You can then get eth2stats sending data by running the following command:

docker run -d --name eth2stats --restart always --network="host" \
      -v ~/eth2stats/data:/data \
      alethio/eth2stats-client:latest \
      run --v \
      --eth2stats.node-name="YourLighthouseNode" \
      --data.folder="/data" \
      --eth2stats.addr="grpc.summer.eth2stats.io:443" --eth2stats.tls=true \
      --beacon.type="lighthouse" --beacon.addr="http://localhost:5052"

You should now be able to see your node and it's stats on eth2stats.

Securing your gRPC connection to the Beacon Chain

If your Beacon node uses a TLS connection for its GRPC endpoint you need to provide a valid certificate to eth2stats-client via the --beacon.tls-cert flag:

docker run -d --name eth2stats --restart always --network="host" \
      -v ~/eth2stats/data:/data \
      ... # omitted for brevity
      --beacon.type="prysm" --beacon.addr="localhost:4000" --beacon.tls-cert "/data/cert.pem"

Have a look at Prysm's documentation to learn how to start their Beacon Chain with enabled TLS and how to generate and use self-signed certificates.

Building from source

Prerequisites

  • a working Golang environment (tested with go v1.13.5)
    • requires go modules (>=go v1.11)

Step-by-step

Clone the repo

git clone https://github.com/Alethio/eth2stats-client.git
cd eth2stats-client

Build the executable

We are using go modules, so it will automatically download the dependencies

make build

Run

Example for Lighthouse:

./eth2stats-client run \
                   --eth2stats.node-name="YourNode" \
                   --eth2stats.addr="grpc.summer.eth2stats.io:443" --eth2stats.tls=true \
                   --beacon.type="lighthouse" --beacon.addr="http://localhost:5052"

Note that since Prysm uses GRPC, the addr flag does not start with http://, unlike the others. So it would be like --beacon.addr="localhost:4000".

For the other clients, it is similar as lighthouse, except you replace the name.

Client names are prysm, lighthouse, teku, nimbus, lodestar.

Memory usage metrics

If you want to see your beacon node client's memory usage as well, make sure you have metrics enabled and add this cli argument, pointing at the right host --beacon.metrics-addr="http://127.0.0.1:8080/metrics".

Default metrics endpoints of supported clients:

  • Lighthouse: 127.0.0.1:5052/metrics (under regular http API address and port), currently not supporting the memory metric.
  • Teku: 127.0.0.1:8008/metrics (using --metrics-enabled=true in Teku options)
  • Prysm: 127.0.0.1:8080/metrics, monitoring enabled by default.
  • Nimbus: 127.0.0.1:8008/metrics (using --metrics --metrics-port=8008)
  • Lodestar: 127.0.0.1:5000/metrics (configure with "metrics": { "enabled": true, "serverPort": 5000} in config JSON)

The process_resident_memory_bytes gauge is extracted from the Prometheus metrics endpoint.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.