天天看點

Ubuntu 18.04 ETH同步節點搭建Ubuntu 18.04 ETH同步節點搭建

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
           

繼續閱讀