Skip to content

Commit

Permalink
Merge pull request #59 from Alethio/client-updates
Browse files Browse the repository at this point in the history
Update readme with new usage info
  • Loading branch information
protolambda authored Oct 9, 2020
2 parents 3e1aeb2 + 45dd85f commit 566c0b6
Showing 1 changed file with 48 additions and 38 deletions.
86 changes: 48 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
| Client | Supported | Protocols | Supported features |
|---------------|-----------|-----------|------------------------------------------------------|
| Prysm || GRPC | Version, head, sync stats, memory, attestation count |
| Lighthouse || HTTP | Version, head, sync stats, memory |
| Lighthouse (v1) || 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 |
Expand All @@ -19,7 +19,15 @@

## Current live deployments:

- [https://eth2stats.io/](https://eth2stats.io/) - Our main deployment. Will add new testnets to this as they arrive.
- [eth2stats.io/](https://eth2stats.io/) - Classic testnets:
- [Medalla](https://eth2stats.io/medalla-testnet)
- [Onyx](https://eth2stats.io/onyx-testnet)
- [Altona](https://eth2stats.io/altona-testnet)
- [Witti](https://eth2stats.io/witti-testnet)
- And previously Schelesi and Sapphire testnets.
- [atttacknet.eth2.wtf](https://atttacknet.eth2.wtf)
- [zinken.eth2.wtf](https://atttacknet.eth2.wtf)


## Getting Started

Expand All @@ -28,11 +36,12 @@ The following section uses Docker to run. If you want to build from source go [h
The most important variable to change is **`--eth2stats.node-name`** which will define what name your node has on [eth2stats](https://eth2stats.io).


### Prysm Sapphire Testnet
### Joining a 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](https://prylabs.net/participate).
The first thing you should do is get a beacon node running and connected to your Eth2 network of choice.

You can then get eth2stats sending data by running the following command:
The dashboard for the given testnet has a "Add your node" button. The client information is not always accurate however.
See below for options per client.

```shell script
docker run -d --name eth2stats --restart always --network="host" \
Expand All @@ -42,28 +51,22 @@ docker run -d --name eth2stats --restart always --network="host" \
--eth2stats.node-name="YourPrysmNode" \
--data.folder="/data" \
--eth2stats.addr="grpc.sapphire.eth2stats.io:443" --eth2stats.tls=true \
--beacon.type="prysm" --beacon.addr="localhost:4000"
--beacon.type="changeme" --beacon.addr="changeme" --beacon.metrics-addr="changeme" # insert client-specific options here
```

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](https://lighthouse-book.sigmaprime.io/become-a-validator.html).
### Client options

You can then get eth2stats sending data by running the following command:
| Client version | `--beacon.type` | `--beacon.addr` | `--beacon.metrics-addr` |
|---------------------------|------------------------|---------------------------|-------------------------------------------|
| Lighthouse v0.3.x | `v1` (standard API) | `http://localhost:5052` | `http://127.0.0.1:5054/metrics` (changed) |
| Lighthouse v0.2.x | `lighthouse` | `http://localhost:5052` | `http://127.0.0.1:5052/metrics` |
| Lodestar | `v1` (standard API) | `http://localhost:9596` | `http://127.0.0.1:8008/metrics` |
| Nimbus | `nimbus` | `http://localhost:9190` | `http://127.0.0.1:8008/metrics` |
| Prysm | `prysm` | `localhost:4000` (GRPC!) | `http://127.0.0.1:8080/metrics` |
| Teku | `teku` | `http://localhost:5051` | `http://127.0.0.1:8008/metrics` |

```shell script
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"
```
The metrics are only required if you want to see your beacon node client's memory usage on eth2stats.

You should now be able to see your node and it's stats on [eth2stats](https://eth2stats.io).

### Securing your gRPC connection to the Beacon Chain

Expand All @@ -78,12 +81,30 @@ docker run -d --name eth2stats --restart always --network="host" \

Have a look at Prysm's documentation to learn [how to start their Beacon Chain with enabled TLS](https://docs.prylabs.network/docs/prysm-usage/secure-grpc) and how to [generate and use self-signed certificates](https://docs.prylabs.network/docs/prysm-usage/secure-grpc#generating-self-signed-tls-certificates).

### 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, e.g. `--beacon.metrics-addr="http://127.0.0.1:8080/metrics"`.

Default metrics endpoints of supported clients:
- Lighthouse: `127.0.0.1:5054/metrics` (using `--metrics --metrics-address=127.0.0.1 --metrics-port=5054`)
- 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:8008/metrics` (configure with `"metrics": { "enabled": true, "serverPort": 8008}` in config JSON)

The `process_resident_memory_bytes` gauge is extracted from the Prometheus metrics endpoint.


## Building from source

### Prerequisites
- a working Golang environment (tested with go v1.13.5)

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

### Step-by-step

**Clone the repo**
```shell script
git clone https://github.com/Alethio/eth2stats-client.git
Expand All @@ -99,11 +120,13 @@ make build

**Run**

The `eth2stats-client` can run with `run` and flags as described per client.

Example for Lighthouse:
```shell script
./eth2stats-client run \
--eth2stats.node-name="YourNode" \
--eth2stats.addr="grpc.summer.eth2stats.io:443" --eth2stats.tls=true \
--eth2stats.addr="grpc.example.eth2stats.io:443" --eth2stats.tls=true \
--beacon.type="lighthouse" --beacon.addr="http://localhost:5052"
```

Expand All @@ -112,17 +135,4 @@ 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.
Client names are `prysm`, `lighthouse`, `teku`, `nimbus`, `lodestar`. And `v1` for standard API option, which clients are all planning to adopt.

0 comments on commit 566c0b6

Please sign in to comment.