dreamer2014520 2017-12-29 15:47 采纳率: 0%
浏览 105
已采纳

从对等方删除ChainCode

I made a mistake my chaincode and installed them on the peers on my network. When I tried to instantiate the chaincode in the channels, I found the error.

  1. Is there a way to debug chaincode before installing it on peers ? It seems to only get flagged when you instantiate it.
  2. Is there a way to delete the chaincode from the peers without having to restart the network?
  • 写回答

2条回答 默认 最新

  • douxia5179 2017-12-30 17:45
    关注
    1. Depends on what you mean by mistake / debug. You should make sure it compiles first. That eliminates all typos, syntax, missing libraries, etc. But there is no way to debug functionality except to install and instantiate.

    2. Technically, no. You can delete all the storage (/var/hyperledger/production/peer, /var/hyperledger/production/orderer, the kafka/zookeeper files, and CouchDB). Not a real big deal, but you do have to restart the network and recreate the channel, join it, install and instantiate the cc, etc. But you can install as a different name. Just change the name in your app connection definition to match. You can also upgrade by changing the version number but keeping the same name.

    I just change the name until I get to a fairly settled spot and then do the deletes and restart all to clean up. A full cleanup (4 peers, 3 orderers, 4 kafka,3 zoopkeeper) takes me maybe 30 minutes. Normally, I keep a CLI open with install ccname1 and instantiate ccname1 in the buffer and can easily increment to ccname2,3,4,5. It only takes a few seconds that way.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • dousao6313 2018-06-22 06:38
    关注

    If the error is (chaincode is already present in the peers)

    You can try installing the chain code with different version number or different chain code name.

    You can initiate chaincode in the channel only once. Next time you have to follow the procedure of upgrade chaincode steps.

    Note : Before installing chain code you can check the syntax errors form the machine by installing go and compile the chain code.

    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 k210显示failed init to model
  • ¥15 Evil-droid生成的APK手机已经下载但无法建立任务
  • ¥25 c语言韩信点兵的变式
  • ¥15 怎么根据书上的例子完成这个问题呢?
  • ¥15 ECharts 增加Zoom,整行包括右边的Text一起滑动
  • ¥15 关于网上一个easyx制作的见缝插针小游戏(c++)
  • ¥15 开地址法双散列函数处理碰撞
  • ¥15 想问一下这个是什么情况 虚拟机Linux打不开了
  • ¥15 联通光猫掉注册了怎么重新注册上去
  • ¥15 关于unity开发steamvr程序遇到的问题