通过 hyperledger fabric 中的交易 ID 获取发件人证书

get certificate of sender by a transaction id in hyperledger fabric

我正在使用 GoLang SDK 在链码中与 Fabric 网络交互,但我找不到从交易 ID 获取证书的方法来找出谁签署了交易。

对于客户端SDK,您可以使用QueryTransaction作为found here which returns a ProcessedTransaction object based on the tx id. This will have information of the signer of the transaction. The object will look like this. You then use the object in this function获取交易信封,最后使用GetSignature功能。这将 return 字节,因此您必须转换为字符串。