登录
首页 >  Golang >  Go问答

安装fabric-sdk-go和其依赖项遇到问题

来源:stackoverflow

时间:2024-03-26 09:09:32 209浏览 收藏

在尝试使用 `go get` 命令在 Linux VM 中安装 Fabric-SDK-Go 及其依赖项时,遇到了错误。这些错误可能与 Go 版本不匹配或依赖项版本不兼容有关。第一个错误源于 go-kit 版本差异,而第二个错误是由于 cfssl 版本过高。值得注意的是,Fabric-SDK-Go 没有二进制输出,因此不应使用 `go get` 进行安装。

问题内容

我正在尝试在 linux vm 中使用以下命令下载 fabric-sdk-go 库及其所有依赖项。

go get -u github.com/hyperledger/fabric-sdk-go/...

出现以下错误。

# github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations
../github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations/system.go:227:23: not enough arguments in call to s.statsd.sendloop
        have (<-chan time.time, string, string)
        want (context.context, <-chan time.time, string, string)
# github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util
../github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:47:8: cannot convert nil to type csr.keyrequest
../github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:132:37: cannot use req.keyrequest (type *csr.keyrequest) as type csr.keyrequest in argument to getbccspkeyopts

这可能是因为 go 版本不匹配还是其他什么原因?这是我在 linux vm 中使用的 go 版本

go version go1.12.8 linux/amd64

解决方案


如果模块未打开,go get 将获取某些依赖项的错误版本。大多数其他依赖工具也是如此。

第一个错误 # github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric/core/operations 是由于 v0.8.0 和 v0.9.0 之间的 go-kit 差异造成的。

第二个错误 # github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util 是由于 cfssl 版本比支持的更新版本造成的。

sdk 没有实际的二进制输出,因此在任何情况下我们都不应该对其进行 go get'ting。

文中关于的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《安装fabric-sdk-go和其依赖项遇到问题》文章吧,也可关注golang学习网公众号了解相关技术文章。

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>