eth私有节点搭建

技术eth私有节点搭建 eth私有节点搭建一.单节点的搭建1.从github上下载源码git clone https://github.com/ethereum/go-ethereum.git2.源码编

Eth私有节点构建

1.单节点施工

1.从github下载源代码

git克隆https://github.com/ethereum/go-ethereum.git

2.源代码编译

cdgo-ethereum

制作geth

编译时的错误消息:

(1)env go111 module=on go run build/ci . go install。/cmd/geth

原因:golang未安装。

解决方案:在github上查看当前eth版本所需的golang版本。一般安装步骤:

wget-C https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz-O-| sudo tar-xz-C/usr/本地

vim /etc/profile

导出路径=$PATH:/usr/local/go/bin

来源/etc/profile

(2)Go : github.com/Azure/azure-pipeline-go@v0.2.2: get ' https://代理..省略

原因:要编译eth,需要下载golang的第三方包,但是网络被封锁,需要添加代理。

vim /etc/profile

GOPROXY=https://goproxy.io

来源/etc/个人资料

(3)如果有错误,执行几次,只要不是同一个错误。

3.准备genesis文件并初始化节点。

{

config': {

chainId': 908,

homesteadBlock': 0,

eip150Block': 0,

EIP 150 hash ' : '0x 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

eip155Block': 0,

eip158Block': 0,

byzantiumBlock': 0,

君士坦丁堡区块' : 0,

彼得斯堡街区' : 0,

istanbulBlock': 0,

ethash': {}

},

nonce': '0x0 ',

时间戳' : '0x5ddf8f3e ',

引渡数据' : '0x 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

gasLimit': '0x47b760 ',

难度' : '0xafa725 ',

mix hash ' : '0x 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

coin base ' : '0x 0000000000000000000000000000000000000000 ',

alloc': {

0x1e 82968 c 4624880 FD 1e 8e 818421841 E6 db 8d 1 fa 4 ' : { ' balance ' : ' 3000000000000000000000 ' }

},

编号' : '0x0 ',

gasUsed': '0x0 ',

括号' : '0x 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

}

初始化节点:geth-datadir data0nit./genesis.json

遇到的问题:(1) alloc字段不能为空,这个字段在一些博客上的genesis文件中是空白的,但是在我的版本中还没有验证过,所以找一个有这个字段的genesis文件;

(2)场的数值大小2)难度稍后会根据自己的区块输出速度自行调整。

4.启动节点

geth - datadir data0 - networkid 908控制台

从这里开始后,单个节点就可以操作了,交互命令在控制台中实现,但是节点不断显示info信息,但不影响交互。

5.开始跑步

新用户:personal.newAccount()

开始块:miner.start()

释放块后,您可以打包事务。默认情况下,块被释放时的第一个用户将被授予,其他操作可以稍后执行。

您可以使用miner.stop()来停止块,使用ctrl-D来关闭控制台,然后在以后想要使用时重复步骤4。

内容来源网络,如有侵权,联系删除,本文地址:https://www.230890.com/zhan/153034.html

(0)

相关推荐