How to read Block data received by transaction id in Hyperledger Fabric Go?

跟風遠走 提交于 2019-12-11 16:48:48

问题


I am working on reading the Block data received by transaction id. I have queried the ledger and received the block but not able to find a way to decode the internal data of a block.

MyCode

block, err := ledgerClient.QueryBlockByTxID(transactionID)
if err != nil {
    return nil, errors.WithMessage(err, "QueryBlockByTransactionID return error")
}

if block == nil {
    return nil, errors.WithMessage(nil,"Block info not available")
}

here in this query, it returns the block created by a transaction. So, now how to decode this block, so then I can able to read the content of the block

please suggest me some solution.

来源:https://stackoverflow.com/questions/56961434/how-to-read-block-data-received-by-transaction-id-in-hyperledger-fabric-go

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!