Reputation: 31
I have been exploring idemix in hyperledger fabric v2.2. I tried submitting transactions via peer cli as idemix identity but it returns me an error when chaincode is in Java or Javascript, but works when Go chaincode is used. So I want to know if there are any restrictions on the chaincode language to be used if idemix identities are used to submit transactions. Following are sections of logs received.
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: transaction returned with failure: Could not create new client identity"
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
...
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."
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
...
https://hyperledger-fabric.readthedocs.io/en/release-2.2/idemix.html
https://hyperledger-fabric.readthedocs.io/en/release-2.2/idemixgen.html
Upvotes: 3
Views: 251
Reputation: 25
Yes, For the moment you can only use Idemix with go based chaincodes. As you wan see on the documentations of hyperledger fabric Idemix ,
The cid (Client Identity) library (for Go only) has been extended to support the GetAttributeValue function when an Idemix credential is used
Upvotes: 0