基于区块链的毕业设计Ethereum 2.0 Network Stats and Monitoring – CLI Client – 以太坊2.0网络统计和监控-CLI客户端

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Ethereum 2.0 Network Stats and Monitoring – CLI Client – 以太坊2.0网络统计和监控-CLI客户端 是一篇很好的国外资料

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:

  • https://eth2stats.io/ – Our main deployment. Will add new testnets to this as they arrive.

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.


以太坊eth2.0网络统计和监控-CLI客户端先决条件

这是eth2stats网络监控套件的初始POC版本

它支持Prysm、Lighthouse、Teku、Nimbus和标准化api(Lodestar)的v1。一旦标准落地,客户机将被重构以支持这一点。

逐步

Client Supported Protocols Supported features
Prysm GRPC 版本、头、同步统计、内存、证明计数
灯塔 HTTP 版本、磁头、同步状态、内存
Teku HTTP 版本、磁头、同步状态、内存
Lodestar(v1) HTTP 版本、头、同步状态、内存、证明计数
Nimbus HTTP 版本、头、同步状态、内存
Trinity

内存使用指标

  • https://eth2stats.io/-我们的主要部署。将在它们到达时添加新的测试网。

Getting Started

以下部分使用Docker运行。如果你想从源代码构建到这里。

要更改的最重要变量是–eth2stats.node-名称,它将定义节点在eth2stats上的名称。

Prysm Sapphire Testnet

您应该做的第一件事是让一个信标链客户机节点运行并通过加入Prysm Sapphire Testnet连接到所述信标链。

然后,您可以通过运行以下命令来获取eth2stats发送数据:

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"

如果您还想查看beacon节点客户端的内存使用情况,请确保在Prysm中启用了度量,并添加此cli参数,指向正确的主机–信标.metrics-地址=“http://localhost:8080/公制”。

Lighthouse Testnet

您应该做的第一件事是让一个信标链客户机节点运行并通过加入灯塔测试网连接到所述信标链。

然后可以通过运行以下命令获得eth2stats发送数据:

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"

现在您应该能够看到您的节点及其在eth2stats上的状态。

Securing your gRPC connection to the Beacon Chain

如果您的Beacon节点使用TLS连接作为其GRPC端点,则需要通过–信标.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"

查看Prysm的文档,了解如何使用启用的TLS启动其信标链,以及如何生成和使用自签名证书。

Building from source

Prerequisites

  • 工作的Golang环境(使用go v1.13.5测试)需要go模块(>=go v1.11)

Step-by-step

克隆回购

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

构建可执行文件

我们使用的是go模块,因此它将自动下载依赖关系

make build

运行

例如,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"

注意,由于Prysm使用GRPC,addr标志不像其他的那样以http://开头。所以它会像–信标地址=”本地主机:4000″.

对于其他客户机,它与lighthouse类似,只是您替换了名称。

客户名称为prysm、lighthouse、teku、nimbus、lodestar。

Memory usage metrics

如果还想查看beacon节点客户机的内存使用情况,请确保启用了度量并添加此cli参数,指向正确的主机–信标.metrics-地址=“http://127.0.0.1:8080/公制”。

受支持客户机的默认度量终结点:

  • Lighthouse:127.0.0.1:5052/metrics(在常规http API地址和端口下),当前不支持内存度量。
  • Teku:127.0.0.1:8008/metrics(在Teku选项中使用–metrics enabled=true)
  • Prysm:127.0.0.1:8080/metrics,默认情况下启用监视。
  • Nimbus:127.0.0.1:8008/metrics(使用–metrics–metrics port=8008)
  • Lodestar:127.0.0.1:5000/metrics(在config JSON中配置“metrics”:{“enabled”:true,“serverPort”:5000})

从Prometheus metrics终结点提取进程驻留内存字节规范。

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/17465.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Ethereum 2.0 Network Stats and Monitoring – CLI Client – 以太坊2.0网络统计和监控-CLI客户端

提供最优质的资源集合

立即查看 了解详情