SexyMF
SexyMF

Reputation: 11165

Hyperledger composer not accepting chaincode changes (Same version)

I am deploying changes within the same version as the following without any errors:

#re-generating the updated bna file    
composer archive create -t dir -n .

#restarting the entire network
../../fabric-dev-servers/stopFabric.sh && ../../fabric-dev-servers/startFabric.sh

#installing the generated bna file
composer network install -c PeerAdmin@hlfv1 -a [email protected]

#starting the network again.
composer network start --networkName network --networkVersion 0.0.1 --networkAdmin admin --networkAdminEnrollSecret adminpw --card PeerAdmin@hlfv1 --file networkadmin.card

I am not getting any error.
I can see the changes in the file [email protected] using VIM as expected.

Did I miss something here?
Should I deploy differently?

Upvotes: 0

Views: 214

Answers (1)

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

yes (you did / you should). Your script mentions "re-generating the updated bna file" so from that I assume you want to update your business network chaincode, one you previously deployed? What you've actually done in your script, by re-running ./startFabric.sh - is you will start up a WHOLE NEW FABRIC dev environment, with a peer(s) that no longer have any chaincode packages installed (and each time you run the current script, that's the case). I'm not sure you want to do this, if you're merely making 'chaincode changes' - then remove the ./startFabric.sh invocation for starters.

To upgrade a business network (eg, v0.0.1 as the initial install version in your package.json) previously installed - see step 14 onwards in ANSWER of this Stack Overflow -> Hyperledger Composer CLI Ping to a Business Network returns AccessException - it provides the correct steps for upgrade (so that you can see your 'chaincode changes', using the new version, eg. 0.0.2).

Composer is in line with the way Fabric works, with a new container for each new version. You can stop and remove the older container, and also remove the old image for that.

Upvotes: 2

Related Questions