hyperledger-fabrichyperledger-fabric-sdk-go

There is something wrong with fabric-sdk-go when I run go build(with dep)


When I run go build and got the following error:

vendor/github.com/hyperledger/fabric-sdk-go/internal/github.com/hyperledger/fabric-ca/util/csp.go:47:8: cannot convert nil to type csr.KeyRequest
vendor/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

I use dep to do package management, this is my Gopkg.toml:

[[constraint]]
  # Release v1.0.0-alpha4
  name = "github.com/hyperledger/fabric-sdk-go"
  revision = "a906355f73d060d7bf95874a9e90dc17589edbb3"

Solution

  • You will need to add some [[override]] clauses for several dependencies that do not work at their current version, but worked at the time when the library was created.

    Alternatively, use go modules, as the most recent release is module enabled.

    This is specifically a requirement on a version of cfssl.

    In dep form, this is:

    [[override]]
      revision = "4e2dcbde500472449917533851bf4bae9bdff562"
      name = "github.com/cloudflare/cfssl"
    

    In modules form this is: github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004