dongyong6332 2016-07-20 05:09
浏览 789
已采纳

Hyperledger自定义Chaincode部署错误

I'm using Hyperledger to work on a POC. I've set the chaincode setup as mentioned here . I'm following the Option 1 mentioned in the link(using vagrant to run a CA server and one VP). In my current setup, I'm running with security disabled. My VP is running fine, and I'm able to start and register the chaincode just fine (as per mentioned here. But, when I'm trying to deploy my chaincode via CLI with the following command :

peer chaincode deploy -n mycc -c '{"Function":"init", "Args": `["hi there"]}'`

I am getting the following error

Error: Error building chaincode: rpc error: code = 2 desc = "Error getting chaincode package bytes: Cannot generate hashcode from empty chaincode path"

I tried specifically mentioning the path where I've stored my custom chaincode, I get the following error :

Error: Error building chaincode: rpc error: code = 2 desc = "Path to chaincode does not exist: /opt/gopath/src/ProductBC/ProductBC/finished/"

Has anyone faced a similar issue or any points on what can be done to overcome this ?

  • 写回答

1条回答

  • dongtan5555 2016-07-20 05:22
    关注

    It looks like that you use full path to your chaincode “/opt/gopath/src/ProductBC/ProductBC/finished/” but peer will try to find chaincode in you gopath by default.

    Just try to run CLI command with “ProductBC/ProductBC/finished/“ instead.

    peer chaincode deploy -p ProductBC/ProductBC/finished -c '{"Function":"init", "Args": `["hi there"]}'`
    

    in this case peer will try to find this chaincode in $GOPATH/src/ProductBC/ProductBC/finished

    P.S. Updated after discussion in chat.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?