在Hyperledger Fabric中使用Idemix的链码语言是否有任何限制? Cli Chaincode容器对等容器 Cli Chaincode容器对等容器

问题描述

在Hyperledger Fabric中使用Idemix提交交易

我一直在Hyperledger Fabric v2.2中探索idemix。我尝试通过对等cli作为idemix身份提交事务,但是当链码使用Java或Javascript时,它返回一个错误,但使用Go链码时可以使用。因此,我想知道如果使用idemix身份来提交事务,则对使用的链码语言是否有任何限制。以下是收到的日志部分。

java的错误日志

Cli

Error: endorsement failure during invoke. response: status:500 message:"error in simulation: transaction returned with failure: Could not create new client identity"

Chaincode容器

11:42:24:528 SEVERE  org.hyperledger.fabric.Logger error Could not create new client identityorg.hyperledger.fabric.contract.ContractRuntimeException: Could not create new client identity
    at org.hyperledger.fabric.contract.Context.<init>(Context.java:59)
... 11 more
Caused by: java.io.IOException: Empty input
    at java.base/sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:106)
    ... 14 more
caused by ..Could not parse certificate: java.io.IOException: Empty input java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input
    at java.base/sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:110)
    at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:355)
...

对等容器

2020-09-21 11:42:24.396 UTC [endorser] callChaincode -> INFO 06b finished chaincode: basic duration: 104ms channel=mychannel txID=5ec99579
2020-09-21 11:42:24.398 UTC [endorser] SimulateProposal -> ERRO 06c Failed to invoke chaincode basic,error: transaction returned with failure: Could not create new client identity
github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:182
...

javascript的错误日志

Cli

Error: endorsement failure during invoke. response: status:500 message:"error in simulation: transaction returned with failure: Error: Failed to find start line or end line of the certificate."

Chaincode容器

2020-09-22T08:41:44.648Z error [c-api:contracts-spi/chaincodefromcontract.js]     [mychannel-a91f4fa4] Error: Failed to find start line or end line of the certificate.
2020-09-22T08:41:44.652Z error [c-api:lib/handler.js]                             [mychannel-a91f4fa4] Calling chaincode Invoke() returned error response [Error: Failed to find start line or end line of the certificate.
    at normalizeX509 (/usr/local/src/node_modules/fabric-shim/lib/chaincode.js:387:15)
    at new ClientIdentity (/usr/local/src/node_modules/fabric-shim/lib/chaincode.js:258:32)
    at ChaincodeFromContract.invokeFunctionality (/usr/local/src/node_modules/fabric-shim/lib/contract-spi/chaincodefromcontract.js:354:35)
    at ChaincodeFromContract.Invoke (/usr/local/src/node_modules/fabric-shim/lib/contract-spi/chaincodefromcontract.js:315:21)
    at handleMessage (/usr/local/src/node_modules/fabric-shim/lib/handler.js:602:47)
    at ChaincodeMessageHandler.handleTransaction (/usr/local/src/node_modules/fabric-shim/lib/handler.js:390:9)
    at ClientDuplexStreamImpl.<anonymous> (/usr/local/src/node_modules/fabric-shim/lib/handler.js:330:30)
    at ClientDuplexStreamImpl.emit (events.js:311:20)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)]. Sending ERROR message back to peer

对等容器

2020-09-22 08:41:44.658 UTC [endorser] callChaincode -> INFO 06c finished chaincode: basic duration: 25ms channel=mychannel txID=a91f4fa4
2020-09-22 08:41:44.658 UTC [endorser] SimulateProposal -> ERRO 06d Failed to invoke chaincode basic,error: transaction returned with failure: Error: Failed to find start line or end line of the certificate.
github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
    /go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:182
...

设置信息

  • 结构版本:2.2
  • 使用idemixgen工具生成
  • idemix身份
  • 使用liligengen工具生成
  • X.509身份
  • 使用对等链码调用命令调用的链码
  • 链码:基本资产转移
  • 链码语言:java,javascript
  • repository link to fabric samples
  • 在docker compose上使用结构部署

参考文献

https://hyperledger-fabric.readthedocs.io/en/release-2.2/idemix.html
https://hyperledger-fabric.readthedocs.io/en/release-2.2/idemixgen.html

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)