说明
本文操作是centos环境下操作,其他linux版本/mac环境类似
操作脚本
基本环境1
sudo yum update -y && yum install git wget bzip2 vim gcc-c++ ntp epel-release nodejs cmake -y
go环境搭建1
2
3
4
5
6wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
tar zxvf go1.9.linux-amd64.tar.gz
mv go /usr/local/
echo “export GOROOT=/usr/local/go” >> /etc/profile
echo “export PATH=$PATH:/usr/local/go/bin” >> /etc/profile
source /etc/profile
go-ethereum安装1
2
3
4
5
6
7
8git clone https://github.com/ethereum/go-ethereum.git
cd go-ethereum
git checkout v1.7.2
make geth
make all
geth version
echo “export PATH=$PATH:/root/go-ethereum/build/bin” >> /etc/profile
source /etc/profile
cmake安装1
2
3
4cd && wget https://cmake.org/files/v3.9/cmake-3.9.2.tar.gz
tar -xzvf cmake-3.9.2.tar.gz
cd cmaker-3.9.2
./bootstrap && make && makeinstall
矫正本地时间1
2systemctl enable ntpd
systemctl start ntpd
防火墙和开放默认# 另外geth会用到8078和30303端口,放开防火墙端口 8078与30303