从入门到精通Fabric开发实战(二)

2.1、fabric源码安装

下载项目到go目录并checkout到1.1分支

创建文件夹:

mkdir -p $GOPATH/src/github.com/hyperledger

进入文件夹:

cd $GOPATH/src/github.com/hyperledger

下载fabric:

git clone https://github.com/hyperledger/fabric.git

注意:若提示git命令不可用,可yum install git安装一下,再执行下载命令。

进入fabric文件夹:

cd fabric

查看版本:

git branch -a

切换到1.1版本:

git checkout release-1.1

2.2、查看脚本中的版本是否是1.1:

cat /opt/gopath/src/github.com/hyperledger/fabric/scripts/bootstrap.sh

2.3、下载镜像:

cd $GOPATH/src/github.com/hyperledger/fabric

分别执行以下命令来下载镜像:

docker pull hyperledger/fabric-tools:x86_64-1.1.0
docker pull hyperledger/fabric-peer:x86_64-1.1.0
docker pull hyperledger/fabric-orderer:x86_64-1.1.0
docker pull hyperledger/fabric-ca:x86_64-1.1.0
docker pull hyperledger/fabric-ccenv:x86_64-1.1.0
docker pull hyperledger/fabric-javaenv:x86_64-1.1.0
docker pull hyperledger/fabric-couchdb:x86_64-0.4.6
docker pull hyperledger/fabric-baseos:x86_64-0.4.6
docker pull hyperledger/fabric-kafka:x86_64-0.4.6
docker pull hyperledger/fabric-zookeeper:x86_64-0.4.6

查看镜像:docker images

2.4、给镜像打tag:

docker tag hyperledger/fabric-tools:x86_64-1.1.0 docker.io/hyperledger/fabric-tools:latest

docker tag hyperledger/fabric-peer:x86_64-1.1.0 docker.io/hyperledger/fabric-peer:latest

docker tag hyperledger/fabric-orderer:x86_64-1.1.0 docker.io/hyperledger/fabric-orderer:latest

docker tag hyperledger/fabric-ca:x86_64-1.1.0 docker.io/hyperledger/fabric-ca:latest

docker tag hyperledger/fabric-ccenv:x86_64-1.1.0 docker.io/hyperledger/fabric-ccenv:latest

docker tag hyperledger/fabric-javaenv:x86_64-1.1.0 docker.io/hyperledger/fabric-javaenv:latest

docker tag hyperledger/fabric-couchdb:x86_64-0.4.6 docker.io/hyperledger/fabric-couchdb:latest

docker tag hyperledger/fabric-baseos:x86_64-0.4.6 docker.io/hyperledger/fabric-baseos:latest

docker tag hyperledger/fabric-kafka:x86_64-0.4.6 docker.io/hyperledger/fabric-kafka:latest

docker tag hyperledger/fabric-zookeeper:x86_64-0.4.6 docker.io/hyperledger/fabric-zookeeper:latest

2.5、.执行bootstrap.sh 会下载所需要的镜像文件还有指定的二进制文件 和配置文件:

cd scripts/
./bootstrap.sh

2.6、查看镜像:docker images

你可能感兴趣的:(区块链开发)