Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
822 views
in Technique[技术] by (71.8m points)

npm - Error in starting hyperledger fabric network with 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

It is giving the following error :

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  1. 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. eg registry=https://mycompanynpmregistry.com:4873 (or the resolved IP address) as in composer network install -c PeerAdmin@hlfv1 -a digitalproperty-network.bna -o npmrcFile=/tmp/npmrcFile . See https://hyperledger.github.io/composer/latest/managing/connector-information

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

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

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.

Footnote:

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...