【问题标题】:How to get a transaction history by specific transaction ID(txhash) in Corda如何通过 Corda 中的特定交易 ID(txhash) 获取交易历史
【发布时间】:2019-05-31 15:43:30
【问题描述】:

要获得状态,我可以使用 Vault,但交易呢?我怎样才能得到它们,例如,通过 txHash?是否可以通过 vaultService.queryBy(criteria) 做到这一点?

由于 internalVerifiedTransactionsSnapshot 方法现在已被弃用,从 Corda 4 开始,是否有任何方法可以使用 txhash 检索特定事务?

【问题讨论】:

    标签: corda


    【解决方案1】:

    节点内部可以调用:

    serviceHub.validatedTransactions.getTransaction(hash)
    

    通过 rpc 我认为你可以做到这一点:

    proxy.stateMachineRecordedTransactionMappingSnapshot().map { it.transactionId }.first { it == hash }
    

    但更好的解决方案是创建一个接收哈希、调用第一个 sn-p 并返回事务的流。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-08
      • 1970-01-01
      • 1970-01-01
      • 2021-12-28
      • 2020-12-24
      • 2012-04-26
      • 1970-01-01
      • 2023-03-14
      相关资源
      最近更新 更多