【问题标题】:Is it possible to filter Ethereum pendingTransactions?是否可以过滤以太坊挂起交易?
【发布时间】:2020-05-26 21:03:25
【问题描述】:

要获取我的节点知道的待处理事务列表,我可以轻松调用eth_pendingTransactions jRPC call。这将给出一个待处理事务的大列表,所有这些都需要解析以找到我关心的客户端的待处理事务。

是否可以预先过滤交易? eth_newpendingtransactionfilterhttps://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newpendingtransactionfilter 有什么帮助吗?我似乎无法理解这与待处理交易有何关系。

【问题讨论】:

    标签: ethereum rpc json-rpc


    【解决方案1】:

    好的,我做了更多的挖掘,我找到了答案。

    • eth_pendingTransactions 无法过滤。
    • eth_newpendingtransactionfilter 不过滤任何内容,而是订阅客户端以在新的待处理事务进入事务池时接收事件。

    但是,在以太坊节点的 OpenEthereum 实现中有一个 JSON_RPC 方法允许过滤挂起的交易。

    parity_pendingtransactions

    示例:

    {
      "jsonrpc":"2.0",
      "method":"parity_pendingTransactions",
      "params":[
        null,
        {
          "to": { "eq": "0xe8b2d01ffa0a15736b2370b6e5064f9702c891b6" }
        }
      ],
      "id":1
    }
    

    显然这意味着运行一个 OpenEthereum 节点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-02
      • 2019-12-09
      • 1970-01-01
      • 2018-12-09
      • 2021-03-27
      • 2022-07-19
      • 2021-07-27
      相关资源
      最近更新 更多