centos下安装以太坊(ETH)节点

centos下安装以太坊(ETH)节点

1、安装golang

$ yum install golang

如果您使用的 Go 版本是 1.13 及以上 (推荐),如果不设置以下命令编译ETH源码时会编译出错

go env -w GO111MODULE=on

go env -w GOPROXY=https://goproxy.io,direct

# 设置不走 proxy 的私有仓库,多个用逗号相隔(可选)

go env -w GOPRIVATE=*.corp.example.com

2、准备源码

git clone https://github.com/ethereum/go-ethereum.git

编译go-ethereum

cd至go-ethereum目录,使用make命令进行build

make geth

make all

2.1 为geth配置环境变量

vi /etc/profile

export GETH=/data/git/go-ethereum/build

export PATH=$GETH/bin:$PATH

data/git/go-ethereum是git clone所在的地址,就是安装文件地址

重新启动环境变量,使它生效

source /etc/profile

2.2 检查geth是否安装成功,输入命令:geth version

 

centos下安装以太坊(ETH)节点_第1张图片

 

3、启动节点

geth --cache=2048 --maxpeers 9999 --rpc --rpcport 8545 --rpcaddr=127.0.0.1 --datadir /data/eth --networkid 1

三步完成以太坊节点安装。

 

 

 

你可能感兴趣的:(ETH,以太坊,centos,区块链,以太坊,数字货币)