Fabric Composer快速入门错误 [英] Fabric Composer Quickstart error

查看:84
本文介绍了Fabric Composer快速入门错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Fabric Composer快速入门指南中的'npm install'步骤出现问题-

I'm having problems with 'npm install' step in the the Fabric Composer Quickstart guide -- https://fabric-composer.github.io/installing/quickstart.html

我的系统级别为:

Ubuntu 16.04 LTS Docker版本1.12.6,内部版本78d1802 docker-compose版本1.12.0-rc2,内部版本08dc2a4 节点v6.9.4 git 2.7.4

Ubuntu 16.04 LTS Docker version 1.12.6, build 78d1802 docker-compose version 1.12.0-rc2, build 08dc2a4 node v6.9.4 git 2.7.4

我安装了命令行工具: npm install -g composer-cli

I installed the command line tools: npm install -g composer-cli

克隆了示例应用程序存储库: git clone https://github.com/fabric-composer/sample-applications.git

Cloned the sample apps repository: git clone https://github.com/fabric-composer/sample-applications.git

cd到示例应用程序目录: cd sample-applications/packages/getting-started

cd'ed to the sample apps dir: cd sample-applications/packages/getting-started

运行"npm install",在从archivedigitalPropertyNetwork.bna步骤进行的部署业务网络"中出现以下错误:

ran 'npm install' where I got the following error in the Deploying business network from archive digitalPropertyNetwork.bna step:

... 成立: 描述:数字财产网络 名称:数字财产网络 标识符:digitalproperty-network@0.0.6

... Found: Description:Digital Property Network Name:digitalproperty-network Identifier:digitalproperty-network@0.0.6

书面业务网络定义存档文件到digitalPropertyNetwork.bna 命令成功完成. 从存档digitalPropertyNetwork.bna部署业务网络 业务网络定义: 标识符:digitalproperty-network@0.0.6 说明:数字财产网络 events.js:160 投掷者//未处理的错误"事件 ^

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 ^

错误 在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)

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!代码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!退出状态1 npm ERR! npm ERR!在入门@ 1.0.0 deployNetwork脚本'composer归档文件中失败-创建--sourceName digitalproperty-network --sourceType模块--archiveFile digitalPropertyNetwork.bna&作曲者网络部署--archiveFile digitalPropertyNetwork.bna --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d&&作曲者网络列表-n digitalproperty-network --enrollId WebAppAdmin --enrollSecret DJY27pEnl16d'. npm ERR!确保您已安装最新版本的node.js和npm. npm ERR!如果这样做,这很可能是入门软件包的问题, npm ERR!不与npm本身. ...

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. ...

有什么想法吗?

在根据netstat -a运行nps install之前,似乎没有使用结构容器(7050-7054)使用的端口.

none of the ports which appear to be used by the fabric containers (7050-7054) are in use prior to running nps install according to netstat -a.

我将在运行后附加来自'npm install'的完整输出以及'docker ps'命令结果:

I'm attaching the full output from 'npm install' along with the 'docker ps' command result after it runs:

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$ 


包括在运行teardown.sh,download-hyperledger.sh和start-hyperledger.sh之后来自docker ps -s的输出:


including output from docker ps -s after running teardown.sh, download-hyperledger.sh, and start-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日志的输出:

and here is the output from docker logs for the failed peer container:

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$ 

推荐答案

第一次回答,请原谅我的坏作风.

first time answering, so forgive my bad style I guess.

无论如何,我遇到了同样的问题,就我而言,这是计算机运行缓慢的问题.换句话说,当对等vp0尝试连接时,membersrvc没有启动.

Anyway I had the same issue and in my case it was a matter of a slow computer. In other words the membersrvc was not up when the peer vp0 was trying to connect.

我通过将start-hyperledger.sh脚本更改为休眠60秒来修复它,以确保:

I fixed it by changing the start-hyperledger.sh script to sleep an extra 60 seconds just to be sure:

`# 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中建立对等容器:

And also added some extra time before building the peer container in the composer file, 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`

这两个更改为我修复了它.希望对您有帮助

Those two changes fixed it for me. So hope it helps

这篇关于Fabric Composer快速入门错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆