hyperledger-fabric - Instantiate chaincode from Java SDK
问题描述
I am trying to instantiate a chaincode from a Fabric Java SDK Client using code from this example
When i am trying to add imports inside chaincode ie
github.com/hyperledger/fabric/core/chaincode/lib/ci
I am getting error from the peer
2018-05-30 17:03:24.813 UTC [endorser] simulateProposal -> ERRO 038 [mychannel][6326fbfe] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/github.com/ify/ify.go:40:2: cannot find package "github.com/hyperledger/fabric/core/chaincode/lib/cid" in any of:
/opt/go/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOROOT)
/chaincode/input/src/github.com/hyperledger/fabric/core/chaincode/lib/cid (from $GOPATH)
/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/lib/cid
where should i install the packages inside peer in order to be visible from the go builder?
解决方案
You have to put everything in vendor, as stated in the coding guidelines: Hyperledger Fabric uses Go Vendoring for package management. In this way you can import external libraries in the chaincode.
推荐阅读
- javascript - 如何在 Angular 应用程序中使用 BokehJS?
- reactjs - 如何使用 useEffect 从 Redux 获取更新的状态
- excel - 试图过滤包含“-M”的数据,但它给了我一个错误
- python - Docker 容器随机分段错误
- html - 在 CSS 中定位单个图像
- javascript - 为什么使用文档片段可以提高性能?
- java - 解析方法时加载约束冲突
- excel - 如何使用 Excel PowerQuery 动态过滤到仅 2 个月内的日期
- testing - 使用基于 Chromium 的浏览器使用 Selenium 更改窗口大小
- android - 应用内购买(IOS 和 Android),用于具有自己身份验证的应用