Simon Mullaney
Simon Mullaney

Reputation: 447

Peer error when trying composer network start

I'm trying to start running my chaincode on a peer but when I do I get the following error in my peer logs:

simulateProposal() resulted in chaincode name:"lscc" response status 500 for txid

commands used:

mv ~/Downloads/creds_*_org2.json ./connection-profiles/${CHANNEL_NAME}/connection-profile-lessor.json
composer card create -f ca_Org2.card -p ./connection-profiles/${CHANNEL_NAME}/connection-profile-lessor.json -u admin -s ${LESSOR_SECRET}
composer card import -f ca_Org2.card -c ca_Org2
composer identity request --card ca_Org2 --path ./credentials/${CHANNEL_NAME}/lessor -u admin -s ${LESSOR_SECRET}

#Then sync reqeusted cert onto starter plan

composer card create -f adminCard_Org2-${CHANNEL_NAME}.card -p ./connection-profiles/${CHANNEL_NAME}/connection-profile-lessor.json -u admin -c ./credentials/${CHANNEL_NAME}/lessor/admin-pub.pem -k ./credentials/${CHANNEL_NAME}/lessor/admin-priv.pem --role PeerAdmin --role ChannelAdmin
composer card import -f adminCard_Org2-${CHANNEL_NAME}.card -c adminCardLessor-${CHANNEL_NAME}
composer network install -c adminCardLessor-${CHANNEL_NAME} -a ./contracts/blockaviation/dist/block-aviation-network.bna
composer network start -c adminCardLessor-defaultchannel -n block-aviation-network -V 0.0.1 -A admin -C ./credentials/defaultchannel/lessor/admin-pub.pem -f delete_me.card

This gives the folowing error in my terminal:

    composer network start -c adminCardLessor-defaultchannel -n block-aviation-network -V 0.0.1 -A admin -C ./credentials/defaultchannel/lessor/admin-pub.pem -f delete_me.card
Starting business network block-aviation-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: chaincode error (status: 500, message: chaincode exists block-aviation-network)
Command failed

Does anyone know what i'm doing wrong?

The above commands work for the first organisation in my network but fails with the above error for all other organisations.

If I do a ping with my card created for org1 I get the following result:

    composer network ping -c admin@block-aviation-network
The connection to the network was successfully tested: block-aviation-network
    Business network version: 0.0.1
    Composer runtime version: 0.19.5
    participant: org.hyperledger.composer.system.NetworkAdmin#admin
    identity: org.hyperledger.composer.system.Identity#818307ea1e01cc0c691d856cc747e9a721e8424b420b73c0b2e4ce1ce406fbf3

Package.json:

{
  "engines": {
    "composer": "^0.19.9"
  },
  "name": "block-aviation-network",
  "version": "0.0.1",
  "description": "Smart aircraft leasing Business Network",
  "scripts": {
    "pretest": "",
    "lint": "eslint .",
    "postlicchk": "npm run doc",
    "doc": "jsdoc --pedantic --recurse -c jsdoc.json",
    "test": "mocha -t 0 --recursive",
    "deployNetwork": "./deployNetwork.sh"
  },
  "author": "Simon Mullaney",
  "email": "simonpmullaney@gmail.com",
  "license": "Apache-2.0",
  "devDependencies": {
    "@types/googlemaps": "^3.30.7",
    "browserfs": "^1.2.0",
    "chai": "latest",
    "composer-admin": "^0.18.1",
    "composer-client": "^0.18.1",
    "composer-common": "^0.18.1",
    "composer-connector-embedded": "^0.18.1",
    "composer-playground-api": "^0.18.1",
    "composer-runtime": "^0.19.9",
    "composer-runtime-web": "^0.18.1",
    "eslint": "latest",
    "istanbul": "latest",
    "jsdoc": "latest",
    "mkdirp": "latest",
    "mocha": "latest",
    "moment": "latest",
    "passport-github": "^1.1.0",
    "sinon": "latest"
  },
  "license-check-config": {
    "src": [
      "**/*.js",
      "!./coverage/**/*",
      "!./node_modules/**/*",
      "!./out/**/*",
      "!./scripts/**/*"
    ],
    "path": "header.txt",
    "blocking": true,
    "logInfo": false,
    "logError": true
  },
  "dependencies": {
    "angular2-google-maps": "^0.17.0",
    "es6-promise": "latest",
    "fabric-client": "^1.0.4",
    "grpc": "1.10.1",
    "opentracing": "^0.14.1",
    "passport-github": "^1.1.0",
    "isomorphic-fetch": "latest"
  }
}

I dont understand why it works for my first organisation but not for my other organisations?

EDIT:

I updated the chaincode on the network to version 0.0.2 - Now the package.json and the network have the same version of composer - 0.19.9

 composer network ping -c admin@block-aviation-network
The connection to the network was successfully tested: block-aviation-network
    Business network version: 0.0.2
    Composer runtime version: 0.19.9
    participant: org.hyperledger.composer.system.NetworkAdmin#admin
    identity: org.hyperledger.composer.system.Identity#818307ea1e01cc0c691d856cc747e9a721e8424b420b73c0b2e4ce1ce406fbf3

The chaincode will still only run in the first organisation though - with all other orgs getting the same error as above.

If I follow on with commands to create a business network card to use on the business network for org2 I get the following:

composer card create -n block-aviation-network -p ./connection-profiles/${CHANNEL_NAME}/connection-profile-lessor.json -u lessor -c ./credentials/${CHANNEL_NAME}/lessor/admin-pub.pem -k ./credentials/${CHANNEL_NAME}/lessor/admin-priv.pem
composer card import -f ./lessor@block-aviation-network.card
composer network ping -c lessor@block-aviation-network

Error: Error trying to ping. Error: 2 UNKNOWN: error executing chaincode: could not get ChaincodeDeploymentSpec for block-aviation-network:0.0.2: get ChaincodeDeploymentSpec for block-aviation-network/defaultchannel from LSCC error: chaincode fingerprint mismatch data mismatch Command failed

Upvotes: 0

Views: 552

Answers (2)

Skadoosh
Skadoosh

Reputation: 715

you need to do "composer network install" on all the peers of the network . And then a single "composer network start" command .

If that doesn't upgrade the network - try using "composer network upgrade" command . Should work.

Upvotes: 0

R Thatcher
R Thatcher

Reputation: 5570

I have not tried this in IBM Starter Plan, but based on the Composer Multi Org tutorial you Install the network once per Organisation, but you only Start the network once per Network, and you supply Admin Certificates from both Organisations on the composer network start command.

So I think what you are seeing is that the Network is already running for Org 2, but the Admin for Org 2 does not have access as it was not specified on the start command line.

Upvotes: 1

Related Questions