基于区块链的毕业设计ETH2 Prysm Node – ETH2 Prysm节点

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计ETH2 Prysm Node – ETH2 Prysm节点 是一篇很好的国外资料

ETH2 Prysm Node

Helm Chart and utilities for deploying an ETH2 Prysm Node on Kubernetes Environments

This chart was built for my own purposes to deploy on my own private kubernetes cluster which runs on top of many of the products from Rancher.

However while I’ve taken some steps to try and make it generic so that it can be used on any cloud kubernetes deployment, I want to be clear, that it has not been tested by me on any other cloud provider. If anyone wants to test, and confirm, I’m happy to accept feedback and update the docs. Or feel free to make changes, and issue a PR.

Just wanted to try to make it easy to deploy an ETH2 Validator node on a resilient scalable infrastructure so that any can benefit.

Also I’d like to note that there are likely many improvements possible to further secure things. Better use of a more “robust” secrets manager for example would be ideal, but currently with the state of Prysm it doesn’t support direct integration to that type of service, so hacking one on would provide diminishing returns for the effort.

I will try to continue updating this in prep for the full ETH2 mainnet launch, but welcome any contributions and assistance.

Installing

Get the chart

These instructions assume you are using linux/unix like terminal with bash or something equivalent. Or WSL on windows, etc. First off, get this chart locally, so clone this repo

Customize your settings

Now edit the file in the root of the repo called custom-values.yaml to customize for your specific needs/environment.

Pay special attention to the web3ProviderURL field, ensure you’ve gone to infura, and setup your own account with an API key (for the appropriate networks)

Also pay attention to things like graffiti, the statsConfig section, and any hostnames/urls

This chart deploys resources with persistant storage. This is important because your beacon and validator will store sensitive info here

The defaults assume your kubernetes environment has a working Persistant Volume Provisioner which can provision a PVC (Persistant Volume Claim). And that it’s set as default. If this is not the case, you may have to customize the volume configs.

Also if you enable TLS on the ingress for the grafana dashboard, you may need cert-manager installed correctly to issue certs, or some equivalent in your kube environment.

Generate your validator keys/deposits

Use the official ETH2 Validator Launchpad at: https://medalla.launchpad.ethereum.org/

Go through the entire process, understand the risks, etc…

When complete, you will have a folder most likely named validator_keys with your deposit json files, and you will have transmitted the deposit transactions.

Ensure you keep these files safe. Along with your backup mnemonic phrases, etc.

Deploy to kubernetes

From the root of the repo, assuming you have your kubectl client configured correctly, first create a namespace:

kubectl create namespace my-prysm-node 

Now navigate to the folder which contains your validator_keys folder within it. (your current directory should be one folder above the validator_keys folder)

Once there, we will create a folder and file to contain your validator password you created during the launchpad process.

This is only temporary, and this file should be deleted when done to keep this password secure

mkdir passwords vi passwords/password.txt 

Now using vi, enter the password you provided to the launchpad on the first line of the file, in plain text. Then save the file.

The reason we use an editor to do this, is that we don’t want to have the password show up in your console command history, feel free to use method of your choice

Now that we have the file structure right, we need to create 2 kubernetes secrets in the namespace we have already created for your prysm node. These will separately contain the password, and the validator key files for import on validator node startup. Note the last line of this script deletes the password folder/file

kubectl --namespace my-prysm-node create secret generic validator-passwords --from-file=./passwords kubectl --namespace my-prysm-node create secret generic validator-keys --from-file=./validator_keys rm -rf ./passwords 

Finally we will deploy the helm chart to the prepared kubernetes environment.

(we will need to change working directory back to the root of the repo for this)

helm upgrade --namespace my-prysm-node --install prysm-node -f ./custom-values.yaml ./prysm-node 

Wait for everything to come up…

You can watch the pods coming up, wait until all pods are in ready state:

kubectl get pods --namespace my-prysm-node 

Once they are all in ready state, if you enabled the ingress for the grafana dashboard, you should be able to check it’s status with:

kubectl get ingress --namespace orb0-prysm-medalla 

There may be more to it than that if you enabled TLS, etc… But if you’ve configured those things I’m assuming you know how to check their status.

Provided all is working, you should eventually be able to hit up the grafana dashboard in your browser at the indicated host address for the ingress.

If you didn’t enable the ingress, then you can use kubernetes port forwarding to reach into the service which should be named prysm-grafana inside the namespace you created.

For more info

Prism

For details on the prysm project itself see:

https://prylabs.net/

https://github.com/prysmaticlabs/prysm

Validator/Staking Launchpad:

https://medalla.launchpad.ethereum.org/

Follow the process, will generate files, then deploy this helm chart…


ETH2 Prysm节点

用于在Kubernetes环境中部署ETH2 Prysm节点的Helm图表和实用程序

此图表是为我自己的目的而构建的,用于部署在我自己的私有Kubernetes集群上,该集群运行在Rancher的许多产品之上。

然而,尽管我已经采取了一些措施尝试使其通用,以便可以在任何云kubernetes部署中使用,但我想说的是,我还没有在任何其他云提供商上测试过它。如果有人想测试和确认,我很乐意接受反馈并更新文档。或者可以随意进行更改,并发出PR。

只是想让在弹性可伸缩基础设施上部署ETH2验证器节点变得容易,这样任何人都可以受益。

另外,我还想指出,可能有许多改进可以进一步确保安全。例如,更好地使用一个更“健壮”的秘密管理器将是理想的,但目前Prysm的状态不支持直接集成到该类型的服务中,因此黑客攻击一个秘密管理器将为这项工作带来越来越少的回报。

我将继续更新此内容,为ETH2 mainnet的全面发布做准备,但欢迎任何贡献和帮助。

安装

获取图表

这些说明假设您使用的是带有bash或其他等效设备的linux/unix类终端。首先,在本地获取此图表,然后克隆此存储库

自定义设置

现在编辑名为custom的repo根目录中的文件-值.yaml根据您的特定需求/环境进行定制。

请特别注意web3ProviderURL字段,确保您已转到infura,并使用API密钥设置自己的帐户(适用于相应的网络)

还要注意涂鸦、statconfig部分和任何主机名/url。

此图表使用持久存储部署资源。这一点很重要,因为您的信标和验证器将在这里存储敏感信息

默认情况下,您的kubernetes环境有一个工作的persistent Volume Provisioner,它可以提供一个PVC(persistent Volume Claim)。它被设为默认值。如果不是这样,您可能需要自定义卷配置。

另外,如果您在grafana仪表板的入口上启用TLS,则可能需要正确安装证书管理器才能颁发证书,或者在kube环境中安装一些等效的证书。

生成验证程序密钥/存款

使用官方ETH2验证器启动板:https://medalla.launchpad.ethereum.org/

完成整个流程,了解风险等。。。

完成后,您将拥有一个名为validator_keys的文件夹,其中包含存款json文件,并且您已经传输了存款交易。

确保这些文件的安全。除了备份助记符短语等之外,

部署到kubernetes

来自repo的根目录,假设您正确配置了kubectl客户机,首先创建一个名称空间:

kubectl create namespace my-prysm-node 

现在导航到包含validatoru keys文件夹的文件夹。(您当前的目录应该是validator_keys文件夹上方的一个文件夹)

一旦到达,我们将创建一个文件夹和文件,其中包含您在启动板过程中创建的验证程序密码。

这只是临时的,完成后应该删除此文件以确保密码的安全

mkdir passwords vi passwords/password.txt 

现在使用vi,在文件的第一行以明文形式输入您提供给启动板的密码。然后保存文件。

我们使用编辑器执行此操作的原因是,我们不希望密码显示在您的控制台命令历史记录中,请随意使用您选择的方法

既然文件结构正确,我们需要在已经为您的prysm节点创建的命名空间中创建2个kubernetes机密。这些文件将分别包含密码和验证程序密钥文件,以便在验证程序节点启动时导入。注意这个脚本的最后一行删除了密码文件夹/文件

kubectl --namespace my-prysm-node create secret generic validator-passwords --from-file=./passwords kubectl --namespace my-prysm-node create secret generic validator-keys --from-file=./validator_keys rm -rf ./passwords 

最后我们将把helm图表部署到准备好的kubernetes环境中。

(为此,我们需要将工作目录改回repo的根目录)

helm upgrade --namespace my-prysm-node --install prysm-node -f ./custom-values.yaml ./prysm-node 

等待一切就绪。。。

您可以观察即将出现的pods,直到所有pod都处于就绪状态:

kubectl get pods --namespace my-prysm-node 

一旦它们都处于就绪状态,如果您为grafana仪表板启用了入口,您应该可以使用以下命令检查它的状态:

kubectl get ingress --namespace orb0-prysm-medalla 

可能还有更多内容如果你启用了TLS等等。。。但如果你配置了这些东西,我假设你知道如何检查它们的状态。

如果一切正常,您最终应该能够在浏览器中的指定主机地址打开grafana仪表板。

如果您没有启用入口,那么您可以使用kubernetes端口转发来访问应该在您创建的名称空间内命名为prysm grafana的服务。

更多信息

棱镜

有关prysm项目本身的详细信息,请参见:

https://prylabs.net/

https://github.com/prysmaticlabs/prysm

验证器/立桩启动板:

https://medalla.launchpad.ethereum.org/

遵循流程,将生成文件,然后部署此舵图。。。

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计ETH2 Prysm Node – ETH2 Prysm节点

提供最优质的资源集合

立即查看 了解详情