Fabric Composer 快速入门错误
Fabric Composer Quickstart error
我在执行 Fabric Composer 快速入门指南中的 'npm install' 步骤时遇到问题 -- https://fabric-composer.github.io/installing/quickstart.html
我的系统等级是:
Ubuntu 16.04 LTS
Docker 版本 1.12.6,内部版本 78d1802
docker-compose version 1.12.0-rc2, build 08dc2a4
节点 v6.9.4
git2.7.4
我安装了命令行工具:
npm install -g composer-cli
克隆了示例 apps 存储库:
git 克隆 https://github.com/fabric-composer/sample-applications.git
cd 到示例 apps 目录:
cd sample-applications/packages/getting-started
运行 'npm install' 我在从存档部署业务网络 digitalPropertyNetwork.bna 步骤中遇到以下错误:
...
成立:
Description:Digital 属性 网络
Name:digitalproperty-网络
Identifier:digitalproperty-网络@0.0.6
将业务网络定义存档文件写入 digitalPropertyNetwork.bna
命令成功完成。
从存档中部署业务网络 digitalPropertyNetwork.bna
业务网络定义:
标识符:digitalproperty-network@0.0.6
说明:Digital属性网络
events.js:160
扔呃; // 未处理的 'error' 事件
^
错误
在 ClientDuplexStream._emitStatusIfDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:189:19)
在 ClientDuplexStream._readsDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:158:8)
在 readCallback (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:217:12)
npm 错误!代码生命周期
错误!错误号 1
错误!入门@1.0.0 部署网络:composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
错误!退出状态 1
错误!
错误!在 getting-started@1.0.0 deployNetwork 脚本 'composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d' 失败。
错误!确保安装了最新版本的 node.js 和 npm。
错误!如果你这样做,这很可能是入门包的问题,
错误!不是 npm 本身。
...
有什么想法吗?
none 似乎由结构容器 (7050-7054) 使用的端口在 运行 nps 根据 netstat -a 安装之前正在使用。
我附上 'npm install' 的完整输出以及 'docker ps' 命令运行后的结果:
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started$ npm install
> getting-started@1.0.0 preinstall /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started
> composer --version || echo 'Please first run npm install -g composer-cli'
composer-cli v0.5.6
composer-admin v0.5.6
composer-client v0.5.6
composer-common v0.5.6
composer-runtime-hlf v0.5.6
composer-connector-hlf v0.5.6
> getting-started@1.0.0 install /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started
> scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork
# Grab the current directory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd
dirname "${BASH_SOURCE[0]}"
# Shut down the Docker containers that might be currently running.
cd "${DIR}"/scripts
docker-compose kill && docker-compose down
Removing scripts_vp0_1 ... done
Removing scripts_membersrvc_1 ... done
# TODO change this to alter the default profile which is, by convention, a local running hyperledger fabric
rm -rf ~/.composer-connection-profiles/defaultProfile/*
rm -rf ~/.composer-credentials/*
# delete all existing containers and images
# This is not used in general usage but this might
#read -p "Press y to delete all docker containers images" -n 1 -r
#echo # (optional) move to a new line
#if [[ $REPLY =~ ^[Yy]$ ]]
#then
# docker rm $(docker ps -a -q) -f
# docker rmi $(docker images -q) -f
#fi
# Pull and tag the latest Hyperledger Fabric base image.
docker pull hyperledger/fabric-baseimage:x86_64-0.1.0
x86_64-0.1.0: Pulling from hyperledger/fabric-baseimage
Digest: sha256:ac6a2784cfd028ae62f5688f4436f95d7a60eeacd8506eb303c9c6335328c388
Status: Image is up to date for hyperledger/fabric-baseimage:x86_64-0.1.0
docker tag hyperledger/fabric-baseimage:x86_64-0.1.0 hyperledger/fabric-baseimage:latest
# Grab the current directorydirectory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd
dirname "${BASH_SOURCE[0]}"
#
cd "${DIR}"/scripts
# Start up the Hyperledger Fabric
docker-compose up -d --build
Creating scripts_membersrvc_1
Creating scripts_vp0_1
# Wait for the Hyperledger Fabric to start.
while ! nc localhost 7051 </dev/null; do sleep 1; done
while ! nc localhost 7053 </dev/null; do sleep 1; done
while ! nc localhost 7054 </dev/null; do sleep 1; done
sleep 5
> getting-started@1.0.0 deployNetwork /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started
> composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
Creating Business Network Archive
Node module search path :
undefined
Looking for package.json of Business Network Definition in /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/digitalproperty-network
Found:
Description:Digital Property Network
Name:digitalproperty-network
Identifier:digitalproperty-network@0.0.6
Written Business Network Definition Archive file to digitalPropertyNetwork.bna
Command completed successfully.
Deploying business network from archive digitalPropertyNetwork.bna
Business network definition:
Identifier: digitalproperty-network@0.0.6
Description: Digital Property Network
events.js:160
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:217:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! getting-started@1.0.0 deployNetwork: `composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the getting-started@1.0.0 deployNetwork script 'composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls getting-started
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bill/.npm/_logs/2017-04-08T23_44_23_838Z-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! getting-started@1.0.0 install: `scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the getting-started@1.0.0 install script 'scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls getting-started
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bill/.npm/_logs/2017-04-08T23_44_23_862Z-debug.log
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
24bb54c9fec3 hyperledger/fabric-membersrvc "membersrvc" 14 seconds ago Up 13 seconds 0.0.0.0:7054->7054/tcp scripts_membersrvc_1
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started$
包括 docker ps -s 在 运行 teardown.sh、下载-hyperledger.sh 和开始-hyperledger.sh 之后的输出:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fdccb0a2ce8c hyperledger/fabric-peer "sh -c 'sleep 5; peer" 18 minutes ago Exited (1) 18 minutes ago scripts_vp0_1
a9d625859d2b hyperledger/fabric-membersrvc "membersrvc" 18 minutes ago Up 18 minutes 0.0.0.0:7054->7054/tcp scripts_membersrvc_1
这里是失败对等容器的 docker 日志的输出:
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started/scripts$ docker logs fdccb0a2ce8c
21:43:33.321 [logging] LoggingInit -> DEBU 001 Setting default logging level to DEBUG for command 'node'
21:43:33.322 [peer] func1 -> INFO 002 Auto detected peer address: 172.18.0.3:7051
21:43:33.322 [peer] func1 -> INFO 003 Auto detected peer address: 172.18.0.3:7051
21:43:33.324 [eventhub_producer] AddEventType -> DEBU 004 registering BLOCK
21:43:33.325 [eventhub_producer] AddEventType -> DEBU 005 registering CHAINCODE
21:43:33.325 [eventhub_producer] AddEventType -> DEBU 006 registering REJECTION
21:43:33.325 [eventhub_producer] AddEventType -> DEBU 007 registering REGISTER
21:43:33.325 [nodeCmd] serve -> INFO 008 Security enabled status: true
21:43:33.325 [nodeCmd] serve -> INFO 009 Privacy enabled status: false
21:43:33.325 [eventhub_producer] start -> INFO 00a event processor started
21:43:33.325 [db] open -> DEBU 00b Is db path [/var/hyperledger/production/db] empty [true]
21:43:33.326 [db] open -> INFO 00c Setting rocksdb maxLogFileSize to 10485760
21:43:33.326 [db] open -> INFO 00d Setting rocksdb keepLogFileNum to 10
21:43:34.513 [nodeCmd] func1 -> DEBU 00e Registering validator with enroll ID: test_vp0
21:43:34.513 [crypto] RegisterValidator -> INFO 00f Registering validator [test_vp0] with name [test_vp0]...
21:43:34.517 [crypto] Debugf -> DEBU 010 [validator.test_vp0] Data will be stored at [/var/hyperledger/production/crypto/validator/test_vp0]
21:43:34.517 [crypto] Debugf -> DEBU 011 [validator.test_vp0] Keystore path [/var/hyperledger/production/crypto/validator/test_vp0/ks] missing [true]: [<clean>]
21:43:34.518 [crypto] Debugf -> DEBU 012 [validator.test_vp0] Creating Keystore at [/var/hyperledger/production/crypto/validator/test_vp0/ks]...
21:43:34.518 [crypto] Debug -> DEBU 013 [validator.test_vp0] Open Keystore DB...
21:43:34.518 [crypto] Debug -> DEBU 014 [validator.test_vp0] Ping Keystore DB...
21:43:34.519 [crypto] Debugf -> DEBU 015 [validator.test_vp0] Keystore created at [/var/hyperledger/production/crypto/validator/test_vp0/ks].
21:43:34.520 [crypto] Debugf -> DEBU 016 [validator.test_vp0] Keystore opened at [/var/hyperledger/production/crypto/validator/test_vp0/ks]...done
21:43:34.520 [crypto] Debug -> DEBU 017 [validator.test_vp0] Registering node crypto engine...
21:43:34.520 [crypto] Debug -> DEBU 018 [validator.test_vp0] Initiliazing TLS...
21:43:34.520 [crypto] Debug -> DEBU 019 [validator.test_vp0] Initiliazing TLS...Disabled!!!
21:43:34.521 [crypto] Debug -> DEBU 01a [validator.test_vp0] Getting ECA client...
21:43:34.521 [crypto] Debugf -> DEBU 01b [validator.test_vp0] Dial to addr:[membersrvc:7054], with serverName:[tlsca]...
21:43:34.521 [crypto] Debug -> DEBU 01c [validator.test_vp0] TLS disabled...
21:43:34.521 [crypto] Debug -> DEBU 01d [validator.test_vp0] Getting ECA client...done
21:43:34.522 [crypto] Errorf -> ERRO 01e [validator.test_vp0] Failed requesting read certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.522 [crypto] Errorf -> ERRO 01f [validator.test_vp0] Failed requesting ECA certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 020 [validator.test_vp0] Failed getting ECA certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 021 [validator.test_vp0] Failed retrieving ECA certs chain [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 022 [validator.test_vp0] Failed registering node crypto engine [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 023 [validator.test_vp0] Failed registering peer [test_vp0]: [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure]
2017/04/09 21:43:34 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 172.18.0.2:7054: getsockopt: connection refused"; Reconnecting to {"membersrvc:7054" <nil>}
2017/04/09 21:43:34 Failed to dial membersrvc:7054: grpc: the connection is closing; please retry.
21:43:34.523 [crypto] Errorf -> ERRO 024 [validator.test_vp0] Failed registering [test_vp0]: [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure]
21:43:34.523 [crypto] RegisterValidator -> ERRO 025 Failed registering validator [test_vp0] with name [test_vp0] [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
Error: rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure
Usage:
peer node start [flags]
Flags:
-h, --help help for start
--peer-chaincodedev Whether peer in chaincode development mode
Global Flags:
--logging-level string Default logging level and overrides, see core.yaml for full syntax
--test.coverprofile string Done (default "coverage.cov")
-v, --version Display current version of fabric peer server
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started/scripts$
似乎与网络有关:transport: dial tcp 172.18.0.2:7054: getsockopt: connection refused
第一次回答,请见谅我的拙劣作风。
无论如何,我遇到了同样的问题,就我而言,这是电脑速度慢的问题。换句话说,当对等 vp0 试图连接时,membersrvc 没有启动。
我通过更改 start-hyperledger.sh 脚本来修复它,使其额外休眠 60 秒以确保:
`# Wait for the Hyperledger Fabric to start.
while ! nc localhost 7051 </dev/null; do sleep 1; done
while ! nc localhost 7053 </dev/null; do sleep 1; done
while ! nc localhost 7054 </dev/null; do sleep 1; done
sleep 65
`
并且还在 composer 文件中构建对等容器之前添加了一些额外的时间,docker-compose.yml:
`vp0:
image: hyperledger/fabric-peer
ports:
- '7050:7050'
- '7051:7051'
- '7052:7052'
- '7053:7053'
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=vp0
- CORE_PEER_PKI_ECA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TCA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054
- CORE_SECURITY_ENABLED=true
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
links:
- membersrvc
command: sh -c 'sleep 25; peer node start'
volumes:
- /var/run/docker.sock:/var/run/docker.sock`
这两个更改为我修复了它。希望对您有所帮助
我在执行 Fabric Composer 快速入门指南中的 'npm install' 步骤时遇到问题 -- https://fabric-composer.github.io/installing/quickstart.html
我的系统等级是:
Ubuntu 16.04 LTS Docker 版本 1.12.6,内部版本 78d1802 docker-compose version 1.12.0-rc2, build 08dc2a4 节点 v6.9.4 git2.7.4
我安装了命令行工具: npm install -g composer-cli
克隆了示例 apps 存储库: git 克隆 https://github.com/fabric-composer/sample-applications.git
cd 到示例 apps 目录: cd sample-applications/packages/getting-started
运行 'npm install' 我在从存档部署业务网络 digitalPropertyNetwork.bna 步骤中遇到以下错误:
... 成立: Description:Digital 属性 网络 Name:digitalproperty-网络 Identifier:digitalproperty-网络@0.0.6
将业务网络定义存档文件写入 digitalPropertyNetwork.bna 命令成功完成。 从存档中部署业务网络 digitalPropertyNetwork.bna 业务网络定义: 标识符:digitalproperty-network@0.0.6 说明:Digital属性网络 events.js:160 扔呃; // 未处理的 'error' 事件 ^
错误 在 ClientDuplexStream._emitStatusIfDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:189:19) 在 ClientDuplexStream._readsDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:158:8) 在 readCallback (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:217:12)
npm 错误!代码生命周期
错误!错误号 1
错误!入门@1.0.0 部署网络:composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
错误!退出状态 1
错误!
错误!在 getting-started@1.0.0 deployNetwork 脚本 'composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d' 失败。
错误!确保安装了最新版本的 node.js 和 npm。
错误!如果你这样做,这很可能是入门包的问题,
错误!不是 npm 本身。
...
有什么想法吗?
none 似乎由结构容器 (7050-7054) 使用的端口在 运行 nps 根据 netstat -a 安装之前正在使用。
我附上 'npm install' 的完整输出以及 'docker ps' 命令运行后的结果:
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started$ npm install
> getting-started@1.0.0 preinstall /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started
> composer --version || echo 'Please first run npm install -g composer-cli'
composer-cli v0.5.6
composer-admin v0.5.6
composer-client v0.5.6
composer-common v0.5.6
composer-runtime-hlf v0.5.6
composer-connector-hlf v0.5.6
> getting-started@1.0.0 install /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started
> scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork
# Grab the current directory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd
dirname "${BASH_SOURCE[0]}"
# Shut down the Docker containers that might be currently running.
cd "${DIR}"/scripts
docker-compose kill && docker-compose down
Removing scripts_vp0_1 ... done
Removing scripts_membersrvc_1 ... done
# TODO change this to alter the default profile which is, by convention, a local running hyperledger fabric
rm -rf ~/.composer-connection-profiles/defaultProfile/*
rm -rf ~/.composer-credentials/*
# delete all existing containers and images
# This is not used in general usage but this might
#read -p "Press y to delete all docker containers images" -n 1 -r
#echo # (optional) move to a new line
#if [[ $REPLY =~ ^[Yy]$ ]]
#then
# docker rm $(docker ps -a -q) -f
# docker rmi $(docker images -q) -f
#fi
# Pull and tag the latest Hyperledger Fabric base image.
docker pull hyperledger/fabric-baseimage:x86_64-0.1.0
x86_64-0.1.0: Pulling from hyperledger/fabric-baseimage
Digest: sha256:ac6a2784cfd028ae62f5688f4436f95d7a60eeacd8506eb303c9c6335328c388
Status: Image is up to date for hyperledger/fabric-baseimage:x86_64-0.1.0
docker tag hyperledger/fabric-baseimage:x86_64-0.1.0 hyperledger/fabric-baseimage:latest
# Grab the current directorydirectory.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd
dirname "${BASH_SOURCE[0]}"
#
cd "${DIR}"/scripts
# Start up the Hyperledger Fabric
docker-compose up -d --build
Creating scripts_membersrvc_1
Creating scripts_vp0_1
# Wait for the Hyperledger Fabric to start.
while ! nc localhost 7051 </dev/null; do sleep 1; done
while ! nc localhost 7053 </dev/null; do sleep 1; done
while ! nc localhost 7054 </dev/null; do sleep 1; done
sleep 5
> getting-started@1.0.0 deployNetwork /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started
> composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
Creating Business Network Archive
Node module search path :
undefined
Looking for package.json of Business Network Definition in /home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/digitalproperty-network
Found:
Description:Digital Property Network
Name:digitalproperty-network
Identifier:digitalproperty-network@0.0.6
Written Business Network Definition Archive file to digitalPropertyNetwork.bna
Command completed successfully.
Deploying business network from archive digitalPropertyNetwork.bna
Business network definition:
Identifier: digitalproperty-network@0.0.6
Description: Digital Property Network
events.js:160
throw er; // Unhandled 'error' event
^
Error
at ClientDuplexStream._emitStatusIfDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._readsDone (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:158:8)
at readCallback (/home/bill/blockchain-fabric-composer/sample-applications/packages/getting-started/node_modules/grpc/src/node/src/client.js:217:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! getting-started@1.0.0 deployNetwork: `composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the getting-started@1.0.0 deployNetwork script 'composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! composer archive create --sourceName digitalproperty-network --sourceType module --archiveFile digitalPropertyNetwork.bna && composer network deploy --archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d && composer network list -n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls getting-started
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bill/.npm/_logs/2017-04-08T23_44_23_838Z-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! getting-started@1.0.0 install: `scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the getting-started@1.0.0 install script 'scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! scripts/download-hyperledger.sh && scripts/start-hyperledger.sh && npm run deployNetwork
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls getting-started
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bill/.npm/_logs/2017-04-08T23_44_23_862Z-debug.log
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
24bb54c9fec3 hyperledger/fabric-membersrvc "membersrvc" 14 seconds ago Up 13 seconds 0.0.0.0:7054->7054/tcp scripts_membersrvc_1
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started$
包括 docker ps -s 在 运行 teardown.sh、下载-hyperledger.sh 和开始-hyperledger.sh 之后的输出:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fdccb0a2ce8c hyperledger/fabric-peer "sh -c 'sleep 5; peer" 18 minutes ago Exited (1) 18 minutes ago scripts_vp0_1
a9d625859d2b hyperledger/fabric-membersrvc "membersrvc" 18 minutes ago Up 18 minutes 0.0.0.0:7054->7054/tcp scripts_membersrvc_1
这里是失败对等容器的 docker 日志的输出:
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started/scripts$ docker logs fdccb0a2ce8c
21:43:33.321 [logging] LoggingInit -> DEBU 001 Setting default logging level to DEBUG for command 'node'
21:43:33.322 [peer] func1 -> INFO 002 Auto detected peer address: 172.18.0.3:7051
21:43:33.322 [peer] func1 -> INFO 003 Auto detected peer address: 172.18.0.3:7051
21:43:33.324 [eventhub_producer] AddEventType -> DEBU 004 registering BLOCK
21:43:33.325 [eventhub_producer] AddEventType -> DEBU 005 registering CHAINCODE
21:43:33.325 [eventhub_producer] AddEventType -> DEBU 006 registering REJECTION
21:43:33.325 [eventhub_producer] AddEventType -> DEBU 007 registering REGISTER
21:43:33.325 [nodeCmd] serve -> INFO 008 Security enabled status: true
21:43:33.325 [nodeCmd] serve -> INFO 009 Privacy enabled status: false
21:43:33.325 [eventhub_producer] start -> INFO 00a event processor started
21:43:33.325 [db] open -> DEBU 00b Is db path [/var/hyperledger/production/db] empty [true]
21:43:33.326 [db] open -> INFO 00c Setting rocksdb maxLogFileSize to 10485760
21:43:33.326 [db] open -> INFO 00d Setting rocksdb keepLogFileNum to 10
21:43:34.513 [nodeCmd] func1 -> DEBU 00e Registering validator with enroll ID: test_vp0
21:43:34.513 [crypto] RegisterValidator -> INFO 00f Registering validator [test_vp0] with name [test_vp0]...
21:43:34.517 [crypto] Debugf -> DEBU 010 [validator.test_vp0] Data will be stored at [/var/hyperledger/production/crypto/validator/test_vp0]
21:43:34.517 [crypto] Debugf -> DEBU 011 [validator.test_vp0] Keystore path [/var/hyperledger/production/crypto/validator/test_vp0/ks] missing [true]: [<clean>]
21:43:34.518 [crypto] Debugf -> DEBU 012 [validator.test_vp0] Creating Keystore at [/var/hyperledger/production/crypto/validator/test_vp0/ks]...
21:43:34.518 [crypto] Debug -> DEBU 013 [validator.test_vp0] Open Keystore DB...
21:43:34.518 [crypto] Debug -> DEBU 014 [validator.test_vp0] Ping Keystore DB...
21:43:34.519 [crypto] Debugf -> DEBU 015 [validator.test_vp0] Keystore created at [/var/hyperledger/production/crypto/validator/test_vp0/ks].
21:43:34.520 [crypto] Debugf -> DEBU 016 [validator.test_vp0] Keystore opened at [/var/hyperledger/production/crypto/validator/test_vp0/ks]...done
21:43:34.520 [crypto] Debug -> DEBU 017 [validator.test_vp0] Registering node crypto engine...
21:43:34.520 [crypto] Debug -> DEBU 018 [validator.test_vp0] Initiliazing TLS...
21:43:34.520 [crypto] Debug -> DEBU 019 [validator.test_vp0] Initiliazing TLS...Disabled!!!
21:43:34.521 [crypto] Debug -> DEBU 01a [validator.test_vp0] Getting ECA client...
21:43:34.521 [crypto] Debugf -> DEBU 01b [validator.test_vp0] Dial to addr:[membersrvc:7054], with serverName:[tlsca]...
21:43:34.521 [crypto] Debug -> DEBU 01c [validator.test_vp0] TLS disabled...
21:43:34.521 [crypto] Debug -> DEBU 01d [validator.test_vp0] Getting ECA client...done
21:43:34.522 [crypto] Errorf -> ERRO 01e [validator.test_vp0] Failed requesting read certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.522 [crypto] Errorf -> ERRO 01f [validator.test_vp0] Failed requesting ECA certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 020 [validator.test_vp0] Failed getting ECA certificate [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 021 [validator.test_vp0] Failed retrieving ECA certs chain [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 022 [validator.test_vp0] Failed registering node crypto engine [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
21:43:34.523 [crypto] Errorf -> ERRO 023 [validator.test_vp0] Failed registering peer [test_vp0]: [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure]
2017/04/09 21:43:34 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 172.18.0.2:7054: getsockopt: connection refused"; Reconnecting to {"membersrvc:7054" <nil>}
2017/04/09 21:43:34 Failed to dial membersrvc:7054: grpc: the connection is closing; please retry.
21:43:34.523 [crypto] Errorf -> ERRO 024 [validator.test_vp0] Failed registering [test_vp0]: [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure]
21:43:34.523 [crypto] RegisterValidator -> ERRO 025 Failed registering validator [test_vp0] with name [test_vp0] [rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure].
Error: rpc error: code = 14 desc = grpc: RPC failed fast due to transport failure
Usage:
peer node start [flags]
Flags:
-h, --help help for start
--peer-chaincodedev Whether peer in chaincode development mode
Global Flags:
--logging-level string Default logging level and overrides, see core.yaml for full syntax
--test.coverprofile string Done (default "coverage.cov")
-v, --version Display current version of fabric peer server
bill@bill-ubuntu:~/blockchain-fabric-composer/sample-applications/packages/getting-started/scripts$
似乎与网络有关:transport: dial tcp 172.18.0.2:7054: getsockopt: connection refused
第一次回答,请见谅我的拙劣作风。
无论如何,我遇到了同样的问题,就我而言,这是电脑速度慢的问题。换句话说,当对等 vp0 试图连接时,membersrvc 没有启动。
我通过更改 start-hyperledger.sh 脚本来修复它,使其额外休眠 60 秒以确保:
`# Wait for the Hyperledger Fabric to start.
while ! nc localhost 7051 </dev/null; do sleep 1; done
while ! nc localhost 7053 </dev/null; do sleep 1; done
while ! nc localhost 7054 </dev/null; do sleep 1; done
sleep 65
`
并且还在 composer 文件中构建对等容器之前添加了一些额外的时间,docker-compose.yml:
`vp0:
image: hyperledger/fabric-peer
ports:
- '7050:7050'
- '7051:7051'
- '7052:7052'
- '7053:7053'
environment:
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_VM_ENDPOINT=unix:///var/run/docker.sock
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_ID=vp0
- CORE_PEER_PKI_ECA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TCA_PADDR=membersrvc:7054
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc:7054
- CORE_SECURITY_ENABLED=true
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
links:
- membersrvc
command: sh -c 'sleep 25; peer node start'
volumes:
- /var/run/docker.sock:/var/run/docker.sock`
这两个更改为我修复了它。希望对您有所帮助