Ubuntu 18.04 ETH synchronization node construction

Ubuntu 18.04 ETH synchronization node construction

While building the nodes, the editor recorded the whole process of building, of course, only one form of building method was recorded.

Installation dependencies

apt install git wget vim gcc g++ ntp

Install go language

apt install software-properties-common
add-apt-repository ppa:longsleep/golang-backports
apt-get update
apt-get install golang-go

Check go version

go version

Download the ETH node building code
Official link: 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

Need to switch Go package agent in China

go env -w GOPROXY=https://goproxy.cn
make all

Add environment variables

echo "export PATH=$PATH:/data/ethereum/go-ethereum/build/bin" >> /etc/profile
source /etc/profile

Check if the version is correct

geth version

Start node synchronization

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

View execution log

tail -f nohup.out

Guess you like

Origin blog.csdn.net/weixin_46174775/article/details/109748788