linux+geth+不能同步公链数据,以太坊公链Geth同步

1、安装所需基础工具

yum update -y && yum install git wget bzip2 vim gcc-c++ ntp epel-release nodejs cmake -y

2、安装Go

wget https://dl.google.com/go/go1.10.linux-amd64.tar.gz

tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz

echo 'export GOROOT=/usr/local/go' >> /etc/profile

echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/profile

echo 'export GOPATH=/root/go' >> /etc/profile

echo 'export PATH=$PATH:$GOPATH/bin' >> /etc/profile

source /etc/profile

验证

$ go version

go version go1.10 linux/amd64

3、克隆编译项目go-ethereum

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

cd go-ethereum

make all

在path中加入geth路径

echo 'export PATH=$PATH:/opt/go-ethereum/build/bin' >> /etc/profile

source /etc/profile

验证

[root@iZrj9hk3x36fkle13532jaZ ~]# geth version

INFO [08-16|10:12:12.117] Bumping default cache on mainnet provided=1024 updated=4096

Geth

Version: 1.9.2-unstable

Git Commit: c9cdf144d55f6bbd75314e812eeefc18d7e8c40e

Git Commit Date: 20190808

Architecture: amd64

Protocol Versions: [63]

Network Id: 1

Go Version: go1.10

Operating System: linux

GOPATH=/root/go

GOROOT=/usr/local/go

4、同步以太坊区块

nohup geth --syncmode "fast" --port "30303" --cache=4096 --datadir /data/geth --rpc --rpcapi db,eth,net,web3,personal,admin,miner --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --maxpeers 999 --maxpendpeers 999 > output.log 2>&1 &

5、进入geth控制台

geth attach ipc:/data/geth/geth.ipc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值