1

我正在尝试使用 EncCC 链码测试 1.1 版中引入的 Fabric 链码加密功能。github上的教程从假设已经安装了chaincode的那一刻开始。我设法通过导入 bcssp 和 ext/entities 来安装链代码,但实例化失败并显示以下消息:

Error: Error endorsing chaincode: rpc error: code = Unknown desc = error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/enccc_example/vendor/github.com/hyperledger/fabric/bccsp/pkcs11/impl.go:31:2: cannot find package "github.com/miekg/pkcs11" in any of:
        /chaincode/input/src/enccc_example/vendor/github.com/miekg/pkcs11 (vendor tree)
        /opt/go/src/github.com/miekg/pkcs11 (from $GOROOT)
        /chaincode/input/src/github.com/miekg/pkcs11 (from $GOPATH)
        /opt/gopath/src/github.com/miekg/pkcs11 chaincode/input/src/enccc_example/vendor/github.com/hyperledger/fabric/bccsp/pkcs11/pkcs11.go:20:2: cannot find package "github.com/op/go-logging" in any of:
        /chaincode/input/src/enccc_example/vendor/github.com/op/go-logging (vendor tree)
        /opt/go/src/github.com/op/go-logging (from $GOROOT)
        /chaincode/input/src/github.com/op/go-logging (from $GOPATH)
        /opt/gopath/src/github.com/op/go-logging chaincode/input/src/enccc_example/vendor/github.com/hyperledger/fabric/bccsp/sw/conf.go:25:2: cannot find package "golang.org/x/crypto/sha3" in any of:
        /chaincode/input/src/enccc_example/vendor/golang.org/x/crypto/sha3 (vendor tree)
        /opt/go/src/golang.org/x/crypto/sha3 (from $GOROOT)
        /chaincode/input/src/golang.org/x/crypto/sha3 (from $GOPATH)
        /opt/gopath/src/golang.org/x/crypto/sha3 chaincode/input/src/enccc_example/vendor/github.com/hyperledger/fabric/protos/peer/admin.pb.go:80:2: cannot find package "golang.org/x/net/context" in any of:
        /chaincode/input/src/enccc_example/vendor/golang.org/x/net/context (vendor tree)
        /opt/go/src/golang.org/x/net/context (from $GOROOT)
        /chaincode/input/src/golang.org/x/net/context (from $GOPATH)
        /opt/gopath/src/golang.org/x/net/context chaincode/input/src/enccc_example/vendor/github.com/hyperledger/fabric/protos/peer/admin.pb.go:81:2: cannot find package "google.golang.org/grpc" in any of:
        /chaincode/input/src/enccc_example/vendor/google.golang.org/grpc (vendor tree)
        /opt/go/src/google.golang.org/grpc (from $GOROOT)
        /chaincode/input/src/google.golang.org/grpc (from $GOPATH)
        /opt/gopath/src/google.golang.org/grpc

我尝试将这些库导入到 CLI 和对等方,但没有成功。我目前正在运行 1.1-alpha 图像。任何建议将不胜感激。

4

1 回答 1

0

您可以使用 govendor 添加您的依赖项,

做 govendor 获取 github.com/hyperledger/fabric/core/chaincode/lib/cid

于 2018-04-17T15:00:29.110 回答