一、基本环节搭建

说明

本文操作是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
6
wget 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
8
git 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
4
cd && 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
2
systemctl enable ntpd
systemctl start ntpd

防火墙和开放默认# 另外geth会用到8078和30303端口,放开防火墙端口 8078与30303

坚持原创技术分享,您的支持将鼓励我继续创作!