我在使用go get命令安装Fabric CA时遇到错误



执行

go get -u github.com/hyperledger/fabric-ca/cmd/

我得到以下错误:

go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.   
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
# github.com/hyperledger/fabric-ca/internal/pkg/util
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/internal/pkg/util/csp.go:117:12: undefined: bccsp.RSA2048KeyGenOpts
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/internal/pkg/util/csp.go:119:12: undefined: bccsp.RSA3072KeyGenOpts
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/internal/pkg/util/csp.go:121:12: undefined: bccsp.RSA4096KeyGenOpts
# github.com/hyperledger/fabric-ca/lib/server/operations
/opt/go/pkg/mod/github.com/hyperledger/fabric-ca@v1.5.2/lib/server/operations/system.go:173:23: not enough arguments in call to s.statsd.SendLoop
have (<-chan time.Time, string, string)
want (context.Context, <-chan time.Time, string, string)

去版本

go version go1.17.2 linux/amd64

go 1.17.2不是fabric-ca 1.5.2支持的版本,请查看发行说明中支持的版本https://github.com/hyperledger/fabric-ca/releases/tag/v1.5.2

然而,也有一个依赖关系的问题,它已经改变了一个api,这样在go get上使用-u选项意味着它将下载并使用不兼容的版本。这只适用于服务器,所以对于服务器

go get github.com/hyperledger/fabric-ca/cmd/fabric-ca-server

应该可以,但是你也可以使用

go get github.com/hyperledger/fabric-ca/cmd/...

包含客户端构建

你当然可以从https://github.com/hyperledger/fabric-ca/releases/tag/v1.5.2

获得官方版本

最新更新