Ubuntu 18.04 ETH同步节点搭建
节点搭建的同时,小编边记录了搭建了的整个过程,当然仅仅记录了一种形式的搭建方式。
安装依赖
apt install git wget vim gcc g++ ntp
安装go语言
apt install software-properties-common
add-apt-repository ppa:longsleep/golang-backports
apt-get update
apt-get install golang-go
检查go版本
go version
下载ETH节点搭建代码
官方链接:https://github.com/ethereum/go-ethereum
mkdir -p /data/ethereum
cd /data/ethereum
git clone https://github.com/ethereum/go-ethereum.git
cd go-ethereum
国内需要切换Go包代理
go env -w GOPROXY=https://goproxy.cn
make all
添加环境变量
echo "export PATH=$PATH:/data/ethereum/go-ethereum/build/bin" >> /etc/profile
source /etc/profile
查看版本是否正确
geth version
启动节点同步
nohup geth --syncmode "fast" --networkid 1 --datadir /data --cache 2048 --identity "节点名称" --rpc --rpcapi "db,eth,net,web3" --rpccorsdomain "*" --rpcport 8545 --port 30303 --rpcaddr 127.0.0.1 & > nohup.out
查看执行日志
tail -f nohup.out