Centos7以太坊客户端Geth安装教程
一、环境配置
Geth是基于Golang语言写的以太坊客户端,因此需要先安装Golang环境。
- 下载golang语言压缩包
wget https://dl.google.com/go/go1.16.linux-amd64.tar.gz
可以根据不同版本更改url
``
- 解压压缩包
sudo tar -C /usr/local -xzf go1.16.linux-amd64.tar.gz
- 添加全局变量
vim /etc/profile
#在文件中添加
export PATH=$PATH:/usr/local/go/bin
#最后激活文件
source /etc/profile
二、下载Geth源码并安装
- git下载Geth源码
如果网络出错可以下载gitee中的镜像
git clone https://github.com/ethereum/go-ethereum.git
- make安装
cd go-ethereum
make geth
如果报网络错误connection refused,则更改源:
go env -w GOPROXY=https://goproxy.cn
- 添加全局变量
cd /etc/profile
#添加如下路径
export PATH=$PATH:<path of go-ethereum>/build/bin