hyperledger-composer v1.1:无法实例化chaincode [英] hyperledger-composer v1.1:unable to instantiate chaincode
问题描述
我目前正在使用hyperLedger composer v1.1,并且正在按照教程进行操作.我设法将链码安装到网络上,但是实例化失败.有人可以告诉我为什么吗?感谢您的帮助.
I am currently working on hyperLedger composer v1.1 and am following the tutorials. I managed to install the chaincode onto the network however it fails at instantiation.Can somebody tell me why? Any help is appreciated.
命令:
composer网络启动--networkName教程-网络--networkVersion 0.0.1 --networkAdmin管理员--networkAdminEnrollSecret adminpw --card PeerAdmin @ hlfv1-文件networkadmin.card 在0.0.1版中启动业务网络教程-网络
composer network start --networkName tutorial-network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card Starting business network tutorial-network at version 0.0.1
处理以下网络管理员: 用户名:admin
Processing these Network Admins: userName: admin
✖启动业务网络定义.这可能需要一分钟...
错误:尝试启动业务网络时出错.错误:任何对等方均未提供有效响应.
来自对等通信尝试的响应是一个错误:错误:2未知:错误启动容器:无法生成特定于平台的docker构建:从构建返回的错误:1"npm ERR!代码EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR!
✖ Starting business network definition. This may take a minute... Error: Error trying to start business network. Error: No valid responses from any peers. Response from attempted peer comms was an error: Error: 2 UNKNOWN: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN npm ERR! errno EAI_AGAIN npm ERR! request to https://registry.npmjs.org/composer-common failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR!可以在以下位置找到此运行的完整日志: npm ERR! /root/.npm/_logs/2018-04-04T13_04_07_240Z-debug.log
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-04-04T13_04_07_240Z-debug.log
推荐答案
在构建链码期间,Fabric执行npm install
.似乎您在代理后面(npm install
无法访问 https://registry.npmjs.org/建议您使用代理,因此它无法解析上面的URL(在安装过程中拉取Composer npm模块/依赖项).因此,您需要按composer network install
命令顺序提供一个npmrc
文件-以便它可以配置npm install的行为-并访问一个已知的注册表,例如 https://hyperledger.github.io/composer/latest/managing/connector-information .用法示例为:composer network install -c PeerAdmin@hlfv1 -a digitalproperty-network.bna -o npmrcFile=/home/user1/config/npmConfig
During the chaincode build, Fabric does an npm install
. Looks like you're behind a proxy (npm install
not being able to access https://registry.npmjs.org/ suggests you're behind a proxy and therefore it can't resolve the URL above (to pull down a Composer npm module/dependency during install)). So you would need to provide an npmrc
file - in the composer network install
command sequence - so that it can configure the behaviour of the npm install - and access a known registry, like https://registry.npmjs.org/ . See more information on this here -> https://hyperledger.github.io/composer/latest/managing/connector-information . Example usage is: composer network install -c PeerAdmin@hlfv1 -a digitalproperty-network.bna -o npmrcFile=/home/user1/config/npmConfig
这篇关于hyperledger-composer v1.1:无法实例化chaincode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!