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.

Termos relacionados

Transforme o conceito em uma chamada de API

Cada termo aqui corresponde a uma primitiva que você já pode chamar — recarregue créditos e publique.

Obter chave de API