使用Hyperledger Composer启动Hyperledger Fabric网络时出错 [英] Error in starting hyperledger fabric network with hyperledger composer
问题描述
我正在尝试使用超级分类帐撰写器建立网络,为此我遵循了 用于创建Hyperledger Composer解决方案的开发人员教程 但是当我使用命令
I am trying to set up a network using hyper ledger composer, for which I followed the Developer tutorial for creating a Hyperledger Composer solution but when I use the command
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
Processing these Network Admins: userName: admin
✖ 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-runtime-hlfv1 failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-04-10T10_10_13_361Z-debug.log " Command failed
我尝试撕下布料并重新启动布料,但这没有帮助.
I have tried tearing down the fabric and starting the fabric again but it didn't help.
推荐答案
-
您是否在代理/防火墙后面?如果是,则在
composer network install
命令中需要一个-o npmrcFile
参数来解析NPM注册表.例如registry=https://mycompanynpmregistry.com:4873
(或解析的IP地址),如composer network install -c PeerAdmin@hlfv1 -a digitalproperty-network.bna -o npmrcFile=/tmp/npmrcFile
中所示.参见 https://hyperledger.github.io/composer/latest/managing/connector -信息
Are you behind a proxy / firewall ? If so in the
composer network install
command you require a-o npmrcFile
parameter, to resolve the NPM registry. egregistry=https://mycompanynpmregistry.com:4873
(or the resolved IP address) as incomposer network install -c PeerAdmin@hlfv1 -a digitalproperty-network.bna -o npmrcFile=/tmp/npmrcFile
. See https://hyperledger.github.io/composer/latest/managing/connector-information
如果发现在启动或升级请求中收到REQUEST_TIMEOUT,则可以尝试增加启动默认超时的结构默认超时.
If you are finding that you get a REQUEST_TIMEOUT on a start or upgrade request, you could try increasing the timeout of the fabric default for startup timeout.
如果您使用的是简单的Hyperledger Composer,则开发服务器环境composer-tools
github repo中的a>,然后您可以将以下内容添加到对等定义中,以查看它是否解决了问题:
If you are using our simple Hyperledger Composer development server environment from composer-tools
github repo, then you can add the following to the peer definition to see if it addresses the problem:
- CORE_CHAINCODE_STARTUPTIMEOUT = 1200s
例如,以上是对等定义的摘录.您必须先执行docker-compose stop
-然后从该目录位置执行docker-compose start
才能生效.
in the file ~/fabric-tools/fabric-scripts/hlfv11/composer/docker-compose.yml
eg, the above is a snippet from the peer definition. You would have to do a docker-compose stop
- then docker-compose start
from that directory location to take effect.
脚注:
除了上述更改CORE_CHAINCODE_STARTUPTIMEOUT之外-您还必须在执行作曲家网络启动命令的卡的connection.json
文件中更新匹配(例如CORE_CHAINCODE_STARTUPTIMEOUT)的超时值以匹配(例如,$中的PeerAdmin卡) HOME/.composer).您将在节连接"下的客户端"部分中看到4个超时(对等端3个,订单1个).默认情况下,这些设置为300秒-将每个设置的值增加到1200
.请注意,CORE_CHAINCODE_STARTUPTIMEOUT必须具有'trailing s',而以上定义的这4个超时-则没有.
In addition to CORE_CHAINCODE_STARTUPTIMEOUT change above - you MUST ALSO UPDATE the timeout values to match (ie CORE_CHAINCODE_STARTUPTIMEOUT), in the connection.json
file for the card(s) that performs the composer network start command (eg. PeerAdmin card in $HOME/.composer). You will see 4 timeouts (3 for a Peer and 1 for the Order) in the 'client' section, under the stanza "connection". By default, these are set to 300 seconds - Increase the value to 1200
for each. Do note that CORE_CHAINCODE_STARTUPTIMEOUT must have the 'trailing s' , whereas these 4 timeouts defined above - don't have this.
这篇关于使用Hyperledger Composer启动Hyperledger Fabric网络时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!