前言
- CentOS Linux release 7.4.1708 (Core)
- 已安装Go (Centos 7安装go)
- github 地址:https://github.com/ethereum/go-ethereum
- 镜像地址:https://gitee.com/mirrors/go-ethereum
- 下载地址: https://geth.ethereum.org/downloads/
- Geth 1.9.8
Step1:下载 Geth
下载地址: https://geth.ethereum.org/downloads/
使用wget下载:
shell> wget https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.9.8-d62e9b28.tar.gz
验证下载文件的完整性:
shell> md5sum geth-alltools-linux-amd64-1.9.8-d62e9b28.tar.gz
7c2914f1d3cbb9b4c9af437a03a0f43b geth-alltools-linux-amd64-1.9.8-d62e9b28.tar.gz
注:对比md5,md5值与图中md5值一致,文件验证通过
解压:
tar -zxvf geth-alltools-linux-amd64-1.9.8-d62e9b28.tar.gz
解压后文件的完整路径为:/data/sde/geth/geth-alltools-linux-amd64-1.9.8-d62e9b28
Step2:配置PATH
修改profile:
shell> cp /etc/profile /etc/profile_bak_`date +%Y%m%d`
shell> echo "# config geth path" >> /etc/profile
shell> echo "export GETH_HOME=/data/sde/geth/geth-alltools-linux-amd64-1.9.8-d62e9b28" >> /etc/profile
shell> echo "export PATH=\$PATH:\$GETH_HOME" >> /etc/profile
shell> echo "" >> /etc/profile
确认修改后的profile是否正确:
shell> cat /etc/profile
...
export GETH_HOME=/data/sde/geth/geth-alltools-linux-amd64-1.9.8-d62e9b28
export PATH=$PATH:$GETH_HOME
让修改后的profile生效:
shell> source /etc/profile
Step3:验证
查看版本:
shell> geth version
Geth
Version: 1.9.8-stable
Git Commit: d62e9b285777c036c108b89fac0c78f7855ba314
Git Commit Date: 20191126
Architecture: amd64
Protocol Versions: [64 63]
Go Version: go1.13.4
Operating System: linux
GOPATH=/data/sde/go/go
GOROOT=/data/sde/go/go