一、源码安装
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