Home > database >  How can I get the creator of a State for Hyperledger Fabric in chaincode?
How can I get the creator of a State for Hyperledger Fabric in chaincode?

Time:10-26

I want to read the certificate of the creator of a state. I know that I can get the certificate during an invoke or a query. However, I could not find any documentation on Fabric Go Chaincode about retrieving the certificate of the creator.

CodePudding user response:

No there isn't an api to do this. It may be possible to do this client side by first invoking chaincode to get the history for a key, then you can invoke the qscc chaincode to retrieve the transaction from the id you got from the history (which created the key). You would then need to decode that response and get the creator certificate.

Someone may have already worked out how to do this and published a code example but there isn't an official fabric sample.

The alternative is that you manage this yourself within your chaincode implementation

  • Related