Reputation: 23
I am following the HyperLedger Fabric v1.4.4 "Writing Your First Application" tutorial[1], but I am having a problem running the code ./startFabric.sh javascript
:
+ echo 'Instantiating smart contract on mychannel'
Instantiating smart contract on mychannel
+ docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C mychannel -n fabcar -l node -v 1.0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
2019-11-25 16:14:38.470 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-11-25 16:14:38.470 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: 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/fabric-shim 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/2019-11-25T16_17_00_000Z-debug.log
"
I think that error is related to the docker image, because it occurs when the following code is executed:
echo "Instantiating smart contract on mychannel"
docker exec \
-e CORE_PEER_LOCALMSPID=Org1MSP \
-e CORE_PEER_MSPCONFIGPATH=${ORG1_MSPCONFIGPATH} \
cli \
peer chaincode instantiate \
-o orderer.example.com:7050 \
-C mychannel \
-n fabcar \
-l "$CC_RUNTIME_LANGUAGE" \
-v 1.0 \
-c '{"Args":[]}' \
-P "AND('Org1MSP.member','Org2MSP.member')" \
--tls \
--cafile ${ORDERER_TLS_ROOTCERT_FILE} \
--peerAddresses peer0.org1.example.com:7051 \
--tlsRootCertFiles ${ORG1_TLS_ROOTCERT_FILE}
I don't know much about docker, but I'm learning. Until then, does anyone help me with this problem?
[1] https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html
The same error was observed when I run ./byfn.sh up -l node
, but no error for ./byfn.sh up
. I think the error is connected to fabric-shim. I am still looking for an answer to this error.
Upvotes: 1
Views: 378
Reputation: 5570
The command to Instantiate the smart contract will be trying to start a new chaincode container, and this is failing because the new container cannot successfully run npm install
commands.
The problem could be a Docker DNS issue, or an npm registry connection problem due to the country or company you are connecting from.
The following 2 previous answers should help you: Network calls fail during image build on corporate network
Error while running fabcar sample in javascript
Upvotes: 2