基于区块链的毕业设计Dockerized Ethereum / Swarm Node – 对接以太坊/群节点

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Dockerized Ethereum / Swarm Node – 对接以太坊/群节点 是一篇很好的国外资料

Dockerized Ethereum / Swarm Node

A dockerized Ethereum related node setup, using docker-compose.

Warning(s):

  • The docker-compose setup builds images locally, since official docker images are only built for x86_64 and I wanted this to compile onto ARM variants as well. Make sure the system has enough resources to do the compilation (1GB of RAM should do).
  • This setup was designed for running on locally networked hardware. I take no responsibility if services are exposed to the Internet and you are not adequately firewalled.

Config

Secrets are handled through environment variables, which can be set by renaming .config.env.example to .config.env and changing account values to your own.

Grafana default credentials are admin:admin. Change them as soon as Grafana is up and running.

Requirements

  • Adequate storage space (Ideally >300Gb. This is a full-node setup, but could be tweaked otherwise)
  • Minimum of 4GB RAM (If you have 4GB, enable a swap partition to avoid issues!)
  • systemd (or some equivalent such as supervisord)
  • docker (With systemd daemon, or equivalent running)
  • docker-compose
  • An Ethereum account

Installing

  1. Clone this repository:
git clone https://github.com/Chadsr/ethereum_node.git 
  1. Init and update Git submodules
git submodule init git submodule update 
  1. Copy the example config to .config.env:
cp .config.env.example .config.env 
  1. Edit the values in .config.env to your preference.

Note: An Ethereum account will NOT automatically be generated. It is assumed that you have already created one.

systemd installation

An example systemd unit file:

[Unit] Description=Ethereum Dockerized Services Requires=docker.service After=docker.service  [Service] EnvironmentFile=/path/to/ethereum_node/.config.env WorkingDirectory=/path/to/ethereum_node Restart=always  ExecStart=/usr/bin/docker-compose -f compose_files/geth.yml -f compose_files/swarm.yml -f compose_files/metrics.yml up --build  ExecStop=/usr/bin/docker-compose down  [Install] WantedBy=multi-user.target 
  1. Write the above to a file named /etc/systemd/system/ethereum.service and update the working directory to point to the cloned repository.

  2. Enable the systemd service:

sudo systemctl enable ethereum.service 
  1. Start the systemd service:
sudo systemctl start ethereum.service 
  1. (Optionally) monitor the output of your newly running service:
sudo journalctl -f -u ethereum.service 

Notes

Architecture Support

Since this setup is designed to build the docker images locally, it should work on any common CPU architecture. I am personally running it on aarch64 (ARMv8).

Geth

Current version: v1.9.19

Swarm

Current version: v0.5.7


对接以太坊eth/Swarm节点

一个与以太坊eth相关的DockerCompose节点设置,使用docker compose。

警告:

  • docker撰写安装程序构建映像在本地,因为官方的docker映像只为x86_64构建,我希望它也能编译到ARM变体上。确保系统有足够的资源来进行编译(1GB的RAM应该可以完成)。
  • 此设置是为在本地联网硬件上运行而设计的。我不承担任何责任,如果服务暴露在互联网上,你没有充分的防火墙。

配置

机密是通过环境变量处理的,这些变量可以通过重命名来设置。config.env.示例到。配置环境并将帐户值更改为您自己的值。

Grafana的默认凭据是管理员:管理员。一旦Grafana启动并运行,就立即更换它们。

需求

  • 足够的存储空间(理想情况下是大于300Gb)。这是一个完整的节点设置,但可以进行其他调整)
  • 最小4GB RAM(如果有4GB,请启用交换分区以避免问题!)
  • systemd(或类似的工具,如supervisord)
  • docker(带systemd守护程序,或等效运行)
  • docker compose
  • 一个以太坊eth帐户

系统安装

  1. 克隆这个存储库:
git clone https://github.com/Chadsr/ethereum_node.git 
  1. 初始化并更新Git子模块
git submodule init git submodule update 
  1. 将示例配置复制到。配置环境:
cp .config.env.example .config.env 
  1. 编辑中的值。配置环境按你的喜好。

注意:不会自动生成以太坊eth帐户。假设您已经创建了一个。

注意事项

一个示例systemd单元文件:

[Unit] Description=Ethereum Dockerized Services Requires=docker.service After=docker.service  [Service] EnvironmentFile=/path/to/ethereum_node/.config.env WorkingDirectory=/path/to/ethereum_node Restart=always  ExecStart=/usr/bin/docker-compose -f compose_files/geth.yml -f compose_files/swarm.yml -f compose_files/metrics.yml up --build  ExecStop=/usr/bin/docker-compose down  [Install] WantedBy=multi-user.target 
  1. 将上述内容写入名为/etc/systemd/system的文件/以太坊eth服务并更新工作目录以指向克隆的存储库。
  2. 启用systemd服务:
sudo systemctl enable ethereum.service 
  1. 启动systemd服务:
sudo systemctl start ethereum.service 
  1. (可选)监视新运行服务的输出:
sudo journalctl -f -u ethereum.service 

架构支持

Geth

由于此设置是为在本地构建docker映像而设计的,因此它应该适用于任何常见的CPU架构。我个人在aarch64(ARMv8)上运行它。

Geth

当前版本:v1.9.19

Swarm

当前版本:v0.5.7

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情