go - Hyperledger Custom Chaincode部署错误

标签 go blockchain hyperledger

我正在使用 Hyperledger 处理 POC。我已经按照 here 所述设置了链码设置.我遵循链接中提到的选项 1(使用 vagrant 运行 CA 服务器和一个副总裁)。在我当前的设置中,我在禁用安全性的情况下运行。我的 VP 运行良好,我能够很好地启动和注册链码(如前所述 here 。但是,当我尝试使用以下命令通过 CLI 部署我的链码时:

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

我收到以下错误

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

我试着特别提到我存储自定义链代码的路径,但我收到以下错误:

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

有没有人遇到过类似的问题或关于如何克服这个问题的任何要点?

最佳答案

看起来您使用链代码的完整路径“/opt/gopath/src/ProductBC/ProductBC/finished/”,但 peer 默认会尝试在您的 gopath 中查找链代码。

只需尝试使用“ProductBC/ProductBC/finished/”运行 CLI 命令即可。

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

在这种情况下,节点将尝试在 $GOPATH/src/ProductBC/ProductBC/finished 中找到这个链码

附言在聊天中讨论后更新。

关于go - Hyperledger Custom Chaincode部署错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38472750/

相关文章:

windows - 使用 Windows 10 编写第一个应用程序时出现 hyperledger Fabric 错误

hyperledger-fabric - 如何使用 raft 在正在运行的 super 账本结构网络中添加新的排序节点?

amazon-web-services - 无需通过服务器即可将大文件上传到 S3

reactjs - 服务器重定向不适用于 ReactJS 代理服务器

戈朗 : Can I apply helper function to one of the returned arguments

performance - 我们可以在 Hyperledger Fabric 中的单个事务中发送多大的有效负载。我们可以在一次交易中投入多少 Assets ?

ubuntu - gasLimit 随时间减少

python - Aca-py 0.6.0 : INFO Ledger instance not provided error/bug?

go - 为什么 os/exec.CombinedOutput() 没有竞争条件?

hyperledger-fabric - Hyperledger Fabric 1.0 中的账本加密