一、源碼安裝
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