我對hyperledger fabric1.1.0的執著(二):Fabric環境部署
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