1、安装node.js
sudo yum install epel-release
sudo yum install nodejs
查看:
node --version
npm --version
2、fabric源码安装
(2.1)下载项目到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
3、查看脚本中的版本是否是1.1,如图:
cat /opt/gopath/src/github.com/hyperledger/fabric/scripts/bootstrap.sh
4、下载镜像(我采用的方法):
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
5、给镜像打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
最后执行docker images如下:
-----------------------------------------------------------------------------------------------------------------------------------------
以下为网上其他更简便的下载镜像和二进制文件的方法,可代替上述步骤4和5,亲测能下载镜像成功,并且下载完就已打好tag。
4、.执行bootstrap.sh 会下载所需要的镜像文件还有指定的二进制文件 和配置文件:
cd scripts/
./bootstrap.sh
5、查看镜像:docker images