目录
前提条件
1、安装Go
参见 Centos7 安装 Go_ling1998的博客-CSDN博客
2、安装Git(暂时没用)
参见 Centos7 安装 git_ling1998的博客-CSDN博客
安装Geth(版本1.10.16)
下载安装Geth
1、下载Geth
下载地址:https://geth.ethereum.org/downloads/
注:需要科学上网
[root@localhost src]# wget https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-amd64-1.10.16-20356e57.tar.gz
2、解压
[root@localhost src]# tar -zxvf geth-alltools-linux-amd64-1.10.16-20356e57.tar.gz
geth-alltools-linux-amd64-1.10.16-20356e57/
geth-alltools-linux-amd64-1.10.16-20356e57/COPYING
geth-alltools-linux-amd64-1.10.16-20356e57/abigen
geth-alltools-linux-amd64-1.10.16-20356e57/bootnode
geth-alltools-linux-amd64-1.10.16-20356e57/evm
geth-alltools-linux-amd64-1.10.16-20356e57/geth
geth-alltools-linux-amd64-1.10.16-20356e57/puppeth
geth-alltools-linux-amd64-1.10.16-20356e57/rlpdump
geth-alltools-linux-amd64-1.10.16-20356e57/clef
tar: geth-alltools-linux-amd64-1.10.16-20356e57: implausibly old time stamp 1970-01-01 08:00:00
3、重命名目录名称
[root@localhost src]# mv geth-alltools-linux-amd64-1.10.16-20356e57 geth-alltools-1.10.16
4、移动目录
[root@localhost src]# mv geth-alltools-1.10.16 /usr/local/
配置Geth环境变量
1、修改配置文件/etc/profile
[root@localhost src]# vi /etc/profile
在/etc/profile文件最后添加下面配置
#config geth path
export GETH_HOME=/usr/local/geth-alltools-1.10.16
export PATH=$PATH:$GETH_HOME
添加完成按Esc,输入:wq保存退出
2、使/etc/profile配置文件生效
[root@localhost src]# source /etc/profile
验证Geth安装是否成功
查看版本,出现如下信息证明安装成功。
[root@localhost src]# geth version
Geth
Version: 1.10.16-stable
Git Commit: 20356e57b119b4e70ce47665a71964434e15200d
Git Commit Date: 20220215
Architecture: amd64
Go Version: go1.17.5
Operating System: linux
GOPATH=/home/gopath
GOROOT=/usr/local/go
关于Geth私链搭建可参见:Geth-1.10.16 私链搭建_ling1998的博客-CSDN博客