以太坊学习-geth相关开发

一、源码安装

 1、 从github中获取相应的go-ethereum作为以太网客户端

git clone https://github.com/ethereum/go-ethereum.git

2、构建Geth,切换到源代码目录使用make命令

cd go-ethereum/
make geth

 3、在build/bin中执行geth version查看返回,确定安装成功

[root@mike bin]# ./geth version
Geth
Version: 1.9.13-unstable
Git Commit: 0e6ea9199ca701ee4c96220e873884327c8d18ff
Git Commit Date: 20200319
Architecture: amd64
Protocol Versions: [65 64 63]
Go Version: go1.13.5
Operating System: linux
GOPATH=/opt/gopath
GOROOT=/opt/golang/go

二、运行geth

 1、启动geth,将数据保存在data目录下

./build/bin/geth --datadir ./data

2、以快速模式同步区块,指挥下载灭个区块头和区块体,不执行验证所有的交易。节省了交易时间.缺省值为full

./build/bin/geth --datadir ./data --syncmode fast

同步测试区块的网络

geth --testnet --datadir ./data --syncmode fast

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值