1
votes

I am trying to setup hyperledger fabric + composer setup with multi organizations locally. The steps I followed to setup hyperledger network is below.

Generate crypto materials and channel

  • cryptogen generate --config=./crypto-config.yaml configtxgen -profile OrdererGenesis -outputBlock ./channel-artifacts/genesis.block
  • configtxgen -profile Channel -CreateChannelTx ./channel-artifacts/channel.tx -channelID ehrchannel
  • configtxgen -profile Channel -outputAnchorPeersUpdate ./channel-artifacts/Hospital1MSPanchors.tx -channelID ehrchannel -asOrg Hospital1MSP
  • configtxgen -profile Channel -outputAnchorPeersUpdate ./channel-artifacts/Hospital2MSPanchors.tx -channelID ehrchannel -asOrg Hospital2MSP

    Start docker containors for two organisations Execute Below commands on cli containor

  • peer channel create -o orderer.ehr.com:7050 -c ehrchannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/ehr.com/orderers/orderer.ehr.com/msp/tlscacerts/tlsca.ehr.com-cert.pem

Having all peers join the channel with setting appropriate env veriables - peer channel join -b ehrchannel.block Updating anchor peers for two organisations by setting env variables

  • peer channel update -o orderer.ehr.com:7050 -c ehrchannel -f ./channel-artifacts/Hospital1MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/ehr.com/orderers/orderer.ehr.com/msp/tlscacerts/tlsca.ehr.com-cert.pem

After that I have followed Hyperledger composer document to configure composer. But on step 17 on the doc, I am getting an error

composer network start -c PeerAdmin@ehr-network-hos1 -a marbles-network.bna -o endorsementPolicyFile=/tmp/composer/endorsement-policy.json -A admin1 -C admin2/admin-pub.pem -A admin2 -C admin2/admin-pub.pem
Starting business network from archive: marbles-network.bna
Business network definition:
        Identifier: [email protected]
        Description: Marble Trading Network

Processing these Network Admins:
        userName: admin1
        userName: admin2

✖ Starting business network definition. This may take a minute...
Error: Error trying to instantiate composer runtime. Error: No valid responses from any peers.
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))
Response from attempted peer comms was an error: Error: 2 UNKNOWN: chaincode error (status: 500, message: cannot get package for chaincode (marbles-network:0.18.2))

Command failed

What are the potential issues? Thank you so much in advance.

2
Did you perform a composer runtime install ? if you did then you likely have got the -n parameter wrong. The error is saying it cannot find a composer runtime on the peer with the right name 'marbles-network'david_k

2 Answers

1
votes

What versions of Composer and Fabric are you using ? If you are using Composer v0.18.2 you need to have the GA version of Fabric v1.1.

The releases document for Composer details the compatible versions of Composer and Fabric. https://github.com/hyperledger/composer/releases

Also you might have a typo in your command ... -A admin1 -C admin2/admin-pub.pem -A admin2 -C admin2/admin-pub.pem are you specifying the wrong folder for admin1 ?

1
votes

Check fabric node logs to find clue:

docker logs [orderer/peer/...]