导入“ shim / ext / statebased”时,Fabric v1.3链码无法实例化

时间:2018-12-12 02:58:28

标签: hyperledger-fabric

由于我尝试了doc中的Fabric v1.3的新功能,因此必须通过KeyEndorsementPolicy.Policy()函数生成密钥级的认可策略。

但是,导入包key-level-endorsement

后,我无法实例化链码。

以下是错误日志:

github.com/hyperledger/fabric/core/chaincode/shim/ext/statebased

我知道这意味着2018-12-11 09:58:25.518 UTC [dockercontroller] deployImage -> ERRO 053 Error building images: Failed to generate platform-specific docker build: Error returned from build: 1 "opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim/ext/statebased/statebasedimpl.go:14:2: cannot find package "github.com/hyperledger/fabric/common/cauthdsl" in any of: /opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric/common/cauthdsl (vendor tree) /opt/go/src/github.com/hyperledger/fabric/common/cauthdsl (from $GOROOT) /chaincode/input/src/github.com/hyperledger/fabric/common/cauthdsl (from $GOPATH) /opt/gopath/src/github.com/hyperledger/fabric/common/cauthdsl " 容器缺乏这种依赖性,因此我尝试将gopath下的ccenv目录添加到实例化请求的chaincode路径目录中。然后我再次尝试,仍然有错误:

vendor

我怀疑2018-12-12 02:06:32.976 UTC [endorser] callChaincode -> INFO 092 [channelforkvepdemo][75cd50e5] Exit chaincode: name:"lscc" (34907ms) 2018-12-12 02:06:32.976 UTC [endorser] SimulateProposal -> ERRO 093 [channelforkvepdemo][75cd50e5] failed to invoke chaincode name:"lscc" , error: Failed to generate platform-specific docker build: Error returned from build: 2 "# github.com/chaincode/vendor/golang.org/x/crypto/sha3 chaincode/input/src/github.com/chaincode/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go:13:6: missing function body # github.com/chaincode/vendor/golang.org/x/sys/unix chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go:13:6: missing function body chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_linux_gc.go:10:6: missing function body chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_linux_gc.go:14:6: missing function body chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:12:6: missing function body chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:13:6: missing function body chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:14:6: missing function body chaincode/input/src/github.com/chaincode/vendor/golang.org/x/sys/unix/syscall_unix_gc.go:15:6: missing function body " error starting container 映像中仍然缺少一些c / c ++库。

那么,如何在没有ccenv的情况下生成密钥级认可策略[]byte?或者,如何导入此KeyEndorsementPolicy包?

1 个答案:

答案 0 :(得分:0)

那是因为fabric-sdk-node有一个错误,这里是link

升级到fabric-client@1.3.0后,问题已解决:

npm install fabric-client@1.3.0
npm install fabric-ca-client@1.3.0