我正在尝试在 Linux 虚拟机中使用以下命令下载 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 虚拟机中使用的 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之间的go-kit差异造成的和 v0.9.0。
第二个错误# github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util
是由于cfssl版本比支持的更新造成的.
sdk 没有实际的二进制输出,因此在任何情况下我们都不应该go get
'ting 它。
关于go - 无法安装fabric-sdk-go及其依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57941472/