1

I am working with this blockchain application for medics traceability (https://github.com/rastringer/medication-blockchain) based on hyperledger fabric blockchain.

It's exactly the same app as this project (https://github.com/hyperledger/education/tree/master/LFS171x/fabric-material/tuna-app) except that this project is for tuna traceability.

I modify the chaincode file (the file is "drug-chaincode.go"), and now apparently I need to reconfigure all my network in "basic-network" folder so that the modification is add, but I don't how I can do this.

I tried to follow this link without results (How to upgrade a chaincode after modification?)

Anyhelp is welcome, thank you in advance ;)

Bagoos
  • 21
  • 1

1 Answers1

0

if u r trying to build hyperledger project similar to drug-app. Then do following things:

Delete node_modules:
drug-blockchain/drug-app/node_modules

Then change every parameter which states the drug blockchain, basically u have to change parameters to Yours on following sources:

drug-chaincode.go
startFabric.sh
server.js
routes.js
registerUser.js
registerAdmin.js
package.json
controller.js
recordDrug.js
queryDrug.js
queryAllDrug.js
changeDrugHolder.js
app.ja
index.html

In the end re-run the network:

cd drug-blockchain/drug-app
$./startFabric.sh
$npm install -g
$node registerAdmin.js
$node registerUser.js
$node server.js

if u do change parameters properly, it should work fine, otherwise recheck, there shouldn't be any data of previous drug-blockchain!

  • This solution not resolve the problem, sadly. I can run the application without problem, I can do the 4 principal action with the application etc... and now I only modify the "drug-chaincode.go" file at the part with the 10 test data to get new data (for example I just changed some 'manufacturer' value or some 'older' value). And after that when I restart the server, remove 'node-modules' folder, reinstall node module etc ... the new value is not added (it's still the old value) – Bagoos Jun 15 '19 at 16:45
  • I found the solution at this problem here: https://stackoverflow.com/questions/49855723/hyperledger-fabric-chaincode-not-updated – Bagoos Jun 15 '19 at 16:56