WebSocket subscription

A WebSocket subscription is a long-lived connection to a node through which the client subscribes to a stream — new heads, pending transactions or logs — and receives events pushed as they happen.

Polling wastes calls and adds latency; a WebSocket subscription flips the model so the node pushes updates the moment they occur. Common streams are newHeads for each block, logs matching a filter, and pending transactions. This suits live dashboards and payment detection that need the chain tip without repeated requests. Subscriptions cover the live edge; for backfilling missed history you still page through eth_getLogs against the archive RPC, so most systems combine a live stream with archive queries.

相关术语

把概念变成一次 API 调用

这里的每个术语都对应一个今天即可调用的原语——充值额度即可上线。

获取 API 密钥