【以太坊】- Build go-ethereum-1.8.x

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wuzh1230/article/details/79983324

Note: golang version >=1.10 is required.

(Optional) prepare gimme

curl -sL -o /usr/local/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
chmod +x /usr/local/bin/gimme

prepare sources

$ git clone --depth=50 https://github.com/ethereum/go-ethereum.git ethereum/go-ethereum
$ git submodule update --init --recursive

(Optional)setup correct version of golang

this step is otptional, you can directly download from google.

$ GIMME_OUTPUT="$(gimme 1.10 | tee -a $HOME/.bashrc)" && eval "$GIMME_OUTPUT"
go version go1.10 linux/amd64

setup GOPATH and PATH

$ export GOPATH=$HOME/gopath
$ export PATH=/usr/local/go/bin:$HOME/gopath/bin:$PATH
$ mkdir -p $HOME/gopath/src/github.com/ethereum/go-ethereum
$ rsync -az ./ $HOME/gopath/src/github.com/ethereum/go-ethereum/
$ cd $HOME/gopath/src/github.com/ethereum/go-ethereum

(Optional) check env.

$ gimme version
v1.3.0
$ go version
go version go1.10 linux/amd64
go.env
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/travis/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/travis/gopath"
GORACE=""
GOROOT="/home/travis/.gimme/versions/go1.10.linux.amd64"
GOTMPDIR=""
GOTOOLDIR="/home/travis/.gimme/versions/go1.10.linux.amd64/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build312938573=/tmp/go-build -gno-record-gcc-switches"
Using Go 1.5 Vendoring, not checking for Godeps
install
$ true

(Optional) prepare fuse dev

The command "sudo modprobe fuse" exited with 0.
0.01s$ sudo chmod 666 /dev/fuse
The command "sudo chmod 666 /dev/fuse" exited with 0.
0.01s$ sudo chown root:$USER /etc/fuse.conf

Build and install

$ go run build/ci.go install

猜你喜欢

转载自blog.csdn.net/wuzh1230/article/details/79983324