L0vdL0vd

eth_newBlockFilter

Creates a filter that reports new block hashes; poll it with eth_getFilterChanges.

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_newBlockFilter","params":[]}'

响应示例

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x050000000000000025ecda100596be70"
}
参数与您的端点

参数

此方法没有参数。

返回值

string Filter ID.

适用场景

Get notified of new blocks by polling, for example to trigger work on every new head.

如何解读结果

Filter ID; eth_getFilterChanges then returns the hashes of blocks added since the last poll.

提示

  • Polling eth_blockNumber is an equally good, stateless alternative.

相关方法