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 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序