最近公司需要开发以一个基于以太坊的 DApp, 使用 ETH 作为中转介质,需要开发一个简易版的以太坊的钱包组件。考虑到 API 的并发,为了保证 DApp 的稳定运行, 不能使用 Infura 的免费接口,所以还是决定自己搭建钱包节点。本文就是记录了整个节点搭建的过程,供有需要的同学参考。
Recently, companies need to develop an Ether based Dapp, using ETH as a medium for transit, and a simple version of Ether's wallet component. Considering API co-publishing, it is not possible to use Infoura's free interface to ensure the steady operation of Dapp, so it is decided to set up the wallet node itself. This is a document of the whole node set-up process for those students who need it.
首先一个良好的建议是,不管你的机器配置有多好,请不要把钱包和应用部署在同一台云主机上。 否则可能会发生一些你意想不到的后果。
我们公司是在阿里云买的 ECS 云主机,配置使用的是"中产阶级配置",系统是 Ubuntu 16.04 LTS. Our company bought the ECS cloud mainframe in Alien, configured to use &quat; middle class configuration &quat; system Ubuntu 16.04 LTS. 目前搭建以太坊钱包节点的主流的有两种,一种是使用官方的 geth 工具,一种是使用 parity 工具搭建。我们这次技术选型选的是 geth, 你要问我为什么不用 parity,是因为我觉得官方的更靠谱一些,而且我的 API 用的是 web3, 最重要的原因是 parity 我不熟,呵呵... There are two types of mainstream that are currently being built in the Taiyo wallet nodes, one using the official geth tool, and the other using the parity tool. Our technical selection is getting. You have to ask me why I don't use the parity because I think the official is more reliable, and my API is using the web3, and the most important reason is that I'm not familiar, huh... 根据自己操作系统类型,选择对应的版本,我安装的是 liunx 64 位系统版本的 Select the corresponding version, depending on the type of operating system, and I install the libx 64-bit version. 这里我们采用编译以太坊官方的源码来安装,
我安装的时候最新版本是 v1.8.17, 大家具体根据自己情况下载对应的版本,下载地址:https://github.com/ethereum/go-ethereum/tags (opens new window) The latest version of my installation is v1.8.17, downloading the corresponding version according to their own circumstances: , downloading addresses: 编译完成之后在 build/bin 目录下会生成很多可执行文件, 就是其中一个. When compiled, a lot of executables will be generated in the build/bin directory, which is one of them. 编辑 文件,添加 geth 和 go 语言的环境变量 Edit files, add environmental variables in geth and go languages 重启服务器或者执行 source /etc/environment 命令使环境配置生效 Restart the server or execute the source/ etc/ environment command to give effect to the environment configuration 然后在终端输入 geth version 命令就会返回如下输出: Then enter the geth command at the terminal and return the following output: 打印出 geth 的版本,go 语言版本,以及 GOROOT 这些环境变量,说明 geth 已经安装成功了. Prints the version of the geth, the go language version, and the GoROOT environment variables that indicate that the geth has been installed. 这里我直接给出一个启动脚本,如果要了解 geth 命令的详细用法的话,这里推荐一篇比较好的博客
以太坊客户端Geth命令用法-参数详解 (opens new window) Here I give a kick-start script which, if I want to know the detailed usage of the geth command, I recommend a better blog in order to understand the detailed usage of the geth command # 土豪配置
# 中产阶级配置
# 贫民配置
# 1. 配置 go 语言运行环境
# 2. 安装 geth
, # 3. 配置环境变量
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论