Compilation Environment Deployment Documentation

A feasible way of fabric compilation environment deployment centos

Prepare environment dependencies

Install go environment

wget https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
#配置GOROOT
echo 'export GOROOT=/usr/local/go' >> /etc/profile
echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/profile
#配置GOPATH
echo 'export GOPATH=$HOME/go' >> /etc/profile
echo 'export PATH=$PATH:$GOPATH/bin' >> /etc/profile
echo 'export GO111MODULE=off' >> /etc/profile
source /etc/profile

install docker

yum update
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce-17.06.1.ce
systemctl start docker
docker version 

Install docker-compose

curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s `-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose -v

install make

yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
make --v

install git

yum -y install git

Install the libltdl development library

yum install libtool-ltdl-devel

install bzip2

yum -y install bzip2

download source code

Create three directories bin, pkg, and src under the GOPATH directory. Create a new github.com/hyperledger/ directory under src. Put the source code folder to be compiled in this directory. The final fabric source location is /root/go/src/github.com/hyperledger/fabric

Compile the binary

#清除上次编译的内容
cd release
rm -rf linux-amd64/bin
#重新编译
cd ..
make release

insert image description here

Compile the image file

#清除上次编译的内容
make clean

insert image description here

#准备编译所需文件
打开fabric下的Makefile文件。
将IMAGES 后面的 待编译镜像删除到只剩下ccenv 即:IMAGES = ccenv  
将周边/ccenv-bin/下的文件 移动到编译机器的GOPATH/bin目录

insert image description here

#重新编译
make docker 开始下载chaintool文件 需要翻墙  ctrl+c退出

insert image description here


cp $GOPATH/bin/chaintool build/bin/
cp $GOPATH/bin/protoc-gen-go build/docker/gotools/bin/
chmod 777 ./scripts/goListFiles.sh
make docker

insert image description here


​ Note, the drawings are for reference only.
For the source of ccenv-bin, refer to the Makefile under gotool and the Makefile under fabric. The problem with direct execution is that most of the dependencies used need to go over the wall. So look for the downloaded resources to use. Please refer to the source reference for the specific process.

Guess you like

Origin blog.csdn.net/qq_42750537/article/details/105122336