duaijiao0648 2019-06-14 17:43
浏览 390

在Hyperledger Fabric区块链上修改链码后升级网络配置

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 ;)

  • 写回答

1条回答 默认 最新

  • dongyun9120 2019-06-15 04:26
    关注

    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!

    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决