Mac OS搭建Hyperledger Fabric官方Demo一
在嘗試Demo的時候遇到了不少坑,這裡記錄一下:
問題一
在執行./startFabric.sh
時報錯ERROR: manifest for hyperledger/fabric-couchdb:latest not found
# don't rewrite paths for Windows Git Bash users
export MSYS_NO_PATHCONV=1
docker-compose -f docker-compose.yml down
Removing network net_basic
docker-compose -f docker-compose.yml up -d ca.example.com orderer.example.com peer0.org1.example.com couchdb
Creating network "net_basic" with the default driver
Pulling couchdb (hyperledger/fabric-couchdb:latest)...
ERROR: manifest for hyperledger/fabric-couchdb:latest not found
解決辦法
查了一下,貌似是沒有配置Hyperledger Fabric Samples的工具庫
問題二
按照Hyperledger Fabric Samples的教程,在執行curl -sSL https://goo.gl/Gci9ZX | bash
時,卡死了,和可能是網路問題;
解決辦法:
在瀏覽器裡開啟https://goo.gl/Gci9ZX
,其程式碼如下
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
export VERSION=1.0.2
export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}')
#Set MARCH variable i.e ppc64le,s390x,x86_64,i386
MARCH=`uname -m`
dockerFabricPull() {
local FABRIC_TAG=$1
for IMAGES in peer orderer couchdb ccenv javaenv kafka zookeeper tools; do
echo "==> FABRIC IMAGE: $IMAGES"
echo
docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG
docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES
done
}
dockerCaPull() {
local CA_TAG=$1
echo "==> FABRIC CA IMAGE"
echo
docker pull hyperledger/fabric-ca:$CA_TAG
docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca
}
: ${CA_TAG:="$MARCH-$VERSION"}
: ${FABRIC_TAG:="$MARCH-$VERSION"}
echo "===> Downloading platform binaries"
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/${ARCH}-${VERSION}/hyperledger-fabric-${ARCH}-${VERSION}.tar.gz | tar xz
echo "===> Pulling fabric Images"
dockerFabricPull ${FABRIC_TAG}
echo "===> Pulling fabric ca Image"
dockerCaPull ${CA_TAG}
echo
echo "===> List out hyperledger docker images"
docker images | grep hyperledger*
將程式碼複製到fabric-samples/init.sh,然後執行./init.sh
開始自動下載需要的docker image,網速不給力,這裡需要較長時間,可以給Docker配置代理,配置代理教程
iMacdeiMac-2:fabric-samples imactwo$ ./init.sh
===> Downloading platform binaries
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 22.5M 100 22.5M 0 0 257k 0 0:01:29 0:01:29 --:--:-- 248k
===> Pulling fabric Images
==> FABRIC IMAGE: peer
x86_64-1.0.2: Pulling from hyperledger/fabric-peer
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
51fc526ed766: Already exists
e0386e9ee7cf: Pull complete
a75d8afcee28: Pull complete
Digest: sha256:ce6e3c3d0f71641020184e4fe0615c2e65b5181664bad3d05942091917b73e28
Status: Downloaded newer image for hyperledger/fabric-peer:x86_64-1.0.2
==> FABRIC IMAGE: orderer
x86_64-1.0.2: Pulling from hyperledger/fabric-orderer
Digest: sha256:6427715d8c56b8778de30c7895287d0dd7bb9adb2f895337aac2dd3d0dcabca7
Status: Downloaded newer image for hyperledger/fabric-orderer:x86_64-1.0.2
==> FABRIC IMAGE: couchdb
x86_64-1.0.2: Pulling from hyperledger/fabric-couchdb
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
6be6b5cbce6b: Already exists
c90d7a44426d: Pull complete
9767b1c8440b: Pull complete
b9b680c73863: Pull complete
910808d7b46d: Pull complete
b2b400af2b65: Pull complete
656c0e3d1026: Pull complete
fd537a07cc88: Pull complete
fb80790f85e2: Pull complete
6b4be879a573: Pull complete
24e26e38b19c: Pull complete
ba4d4ddd242e: Pull complete
Digest: sha256:5364d4f3e0844455195cc82626675cf01a873ba3b762d156efffb239740c2415
Status: Downloaded newer image for hyperledger/fabric-couchdb:x86_64-1.0.2
==> FABRIC IMAGE: ccenv
x86_64-1.0.2: Pulling from hyperledger/fabric-ccenv
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
6be6b5cbce6b: Already exists
c90d7a44426d: Already exists
9767b1c8440b: Already exists
b9b680c73863: Already exists
166a55562f41: Pull complete
3d603cc86908: Pull complete
5e68f74a4f28: Pull complete
Digest: sha256:3ad83a302e633dea8fa3d9d95b3e68919b7754d81bd521d1c3744bd251d5a526
Status: Downloaded newer image for hyperledger/fabric-ccenv:x86_64-1.0.2
==> FABRIC IMAGE: javaenv
x86_64-1.0.2: Pulling from hyperledger/fabric-javaenv
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
6be6b5cbce6b: Already exists
c90d7a44426d: Already exists
9767b1c8440b: Already exists
b9b680c73863: Already exists
f27ca7df950b: Pull complete
6bdffd82de79: Pull complete
b049ece410a1: Pull complete
d6a291b77d29: Pull complete
7cb4541e382f: Pull complete
b31b833bb285: Pull complete
643fd0d667f7: Pull complete
935ca4c299df: Pull complete
Digest: sha256:3cfb1ccb0b17e58a2a903a68959aa25e53dd3eaeefccd969944efd4b766541aa
Status: Downloaded newer image for hyperledger/fabric-javaenv:x86_64-1.0.2
==> FABRIC IMAGE: kafka
x86_64-1.0.2: Pulling from hyperledger/fabric-kafka
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
6be6b5cbce6b: Already exists
c90d7a44426d: Already exists
9767b1c8440b: Already exists
b9b680c73863: Already exists
acb25f369ac3: Pull complete
16930d8f4113: Pull complete
4641f537b20c: Pull complete
Digest: sha256:ebbfd837ed010eac27007b7203074d3621969431e07fd6a874dc4c057bfbf0a2
Status: Downloaded newer image for hyperledger/fabric-kafka:x86_64-1.0.2
==> FABRIC IMAGE: zookeeper
x86_64-1.0.2: Pulling from hyperledger/fabric-zookeeper
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
6be6b5cbce6b: Already exists
c90d7a44426d: Already exists
9767b1c8440b: Already exists
b9b680c73863: Already exists
44885f365644: Pull complete
46ece701894d: Pull complete
2d416318c4a3: Pull complete
f65b80d465e8: Pull complete
Digest: sha256:ef981366251ad87d20f2d6de85f1c3524dd31d3551e6f53274925066c5b1d849
Status: Downloaded newer image for hyperledger/fabric-zookeeper:x86_64-1.0.2
==> FABRIC IMAGE: tools
x86_64-1.0.2: Pulling from hyperledger/fabric-tools
d5c6f90da05d: Already exists
1300883d87d5: Already exists
c220aa3cfc1b: Already exists
2e9398f099dc: Already exists
dc27a084064f: Already exists
87675a6d4030: Already exists
93e601aafda8: Already exists
6be6b5cbce6b: Already exists
c90d7a44426d: Already exists
9767b1c8440b: Already exists
b9b680c73863: Already exists
0cb2dbc2f8a2: Pull complete
05edc6c8e54b: Pull complete
1a8edd3b0b2a: Pull complete
579fce528924: Pull complete
0c728eabbff4: Pull complete
Digest: sha256:9323ebacecc60f20562a49de201bd0a8b7852d3d9349a8916a66df1203fd38b0
Status: Downloaded newer image for hyperledger/fabric-tools:x86_64-1.0.2
===> Pulling fabric ca Image
==> FABRIC CA IMAGE
x86_64-1.0.2: Pulling from hyperledger/fabric-ca
aafe6b5e13de: Pull complete
0a2b43a72660: Pull complete
18bdd1e546d2: Pull complete
8198342c3e05: Pull complete
f56970a44fd4: Pull complete
e32b597e7839: Pull complete
a6e362fc71c4: Pull complete
b42cff702f8a: Pull complete
fd742d0d9134: Pull complete
1af663083463: Pull complete
aeef9e452233: Pull complete
Digest: sha256:25ab46a951c17b3034b3555b339ba4a985148668959f96152a1e91bbd1c7dd57
Status: Downloaded newer image for hyperledger/fabric-ca:x86_64-1.0.2
===> List out hyperledger docker images
hyperledger/fabric-ca latest 7e53be14f804 10 days ago 238 MB
hyperledger/fabric-ca x86_64-1.0.2 7e53be14f804 10 days ago 238 MB
hyperledger/fabric-tools latest ba9750b2565d 10 days ago 1.33 GB
hyperledger/fabric-tools x86_64-1.0.2 ba9750b2565d 10 days ago 1.33 GB
hyperledger/fabric-couchdb latest 3f922f54bd68 10 days ago 1.47 GB
hyperledger/fabric-couchdb x86_64-1.0.2 3f922f54bd68 10 days ago 1.47 GB
hyperledger/fabric-kafka latest 0b4b1d249e65 10 days ago 1.29 GB
hyperledger/fabric-kafka x86_64-1.0.2 0b4b1d249e65 10 days ago 1.29 GB
hyperledger/fabric-zookeeper latest 1efb063147d3 10 days ago 1.3 GB
hyperledger/fabric-zookeeper x86_64-1.0.2 1efb063147d3 10 days ago 1.3 GB
hyperledger/fabric-orderer latest 6efd17e86e65 10 days ago 151 MB
hyperledger/fabric-orderer x86_64-1.0.2 6efd17e86e65 10 days ago 151 MB
registry.docker-cn.com/hyperledger/fabric-orderer x86_64-1.0.2 6efd17e86e65 10 days ago 151 MB
hyperledger/fabric-peer latest 0e2ed51971c9 10 days ago 154 MB
hyperledger/fabric-peer x86_64-1.0.2 0e2ed51971c9 10 days ago 154 MB
hyperledger/fabric-javaenv latest 0be45dbd7ff4 10 days ago 1.41 GB
hyperledger/fabric-javaenv x86_64-1.0.2 0be45dbd7ff4 10 days ago 1.41 GB
hyperledger/fabric-ccenv latest d0f166e1a89e 10 days ago 1.28 GB
hyperledger/fabric-ccenv x86_64-1.0.2 d0f166e1a89e 10 days ago 1.28 GB
問題三
在npm install 時,因為使用了node版本管理器n,報錯如下:
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/fs'
╭─────────────────────────────────────╮
│ │
│ Update available 5.0.0 → 5.4.1 │
│ Run npm i -g npm to update │
│ │
╰─────────────────────────────────────╯
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/imactwo/.npm/_logs/2017-09-12T05_37_44_321Z-debug.log
解決辦法
此時node版本為8.0.0,先用n將node版本改為6.2.2,再使用npm i -g npm
安裝最新版的npm
問題四
在https://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html上有如下提示:
使用n安裝node 6.9.5,因為網路問題,下載特別慢,查到這個部落格,配置加速來提高下載速度
PROJECT_NAME="node" PROJECT_URL="https://npm.taobao.org/mirrors/node/" n project 6.9.5
相關文章
- Hyperledger Fabric(Hyperledger Fabric模型)模型
- Hyperledger Fabric 2.x 環境搭建
- Hyperledger Fabric 部署
- 2.01 hyperledger fabric概念
- Hyperledger Fabric 核心概念
- Hyperledger Fabric 手動搭建【區塊鏈學習三】區塊鏈
- 【Hyperledger Fabric】Fabric 2.2 手動安裝
- 2.02 hyperledger fabric入門
- 2.08 hyperledger fabric完整案例
- Hyperledger Fabric(分類賬)
- Hyperledger Fabric on SAP Cloud PlatformCloudPlatform
- fabric sdk : org.hyperledger.fabric.sdk.exception.ProposalExceptionException
- 在Ubantu16.04下Hyperledger fabric開發環境的搭建開發環境
- 2.04 hyperledger fabric共識排序排序
- 2.06 hyperledger fabric智慧合約
- 2.07 hyperledger fabric鏈碼案例
- Hyperledger Fabric 2.0 Alpha釋出了!
- 搭建Hyperledger Fabric 2.3.2開發環境及簡單案例執行開發環境
- Hyperledger Fabric部署的坑(更新中)
- Hyperledger Fabric的基本功能
- 2.03 hyperledger fabric系統架構架構
- 2.05 hyperledger fabric賬本儲存
- Hyperledger Fabric命令詳解之 up
- hyperledger fabric - chaincode fingerprint mismatch data mismatchAI
- Hyperledger Fabric部署與測試(Ubuntu)Ubuntu
- 1-Hyperledger Fabric概念詳解
- Hyperledger fabric 鏈碼篇GO(四)Go
- Hyperledger Fabric 超級賬本 java開發區塊鏈環境搭建Java區塊鏈
- ChainDesk :從 0 到 1-Hyperledger Fabric 開發精要 (一)AI
- Hyperledger Fabric系統鏈碼介紹
- 在Ubuntu上部署Hyperledger Fabric環境Ubuntu
- HyperLedger/Fabric SDK使用Docker容器映象快Docker
- Hyperledger Fabric 智慧合約開發及 fabric-sdk-go/fabric-gateway 使用示例GoGateway
- 區塊鏈開發Hyperledger Fabric入門區塊鏈
- 區塊鏈 2.0:Hyperledger Fabric 介紹(十)區塊鏈
- Hyperledger Fabric和FISCO BCOS技術對比
- Hyperledger Fabric原理詳解與實戰1
- Hyperledger Fabric原理詳解與實戰4
- 聯盟鏈 Hyperledger Fabric 應用場景