Subscription methods
Subscription methods are available for WebSocket connections only, and allow you to wait for events instead of polling for them. For example, dapps can subscribe to logs and receive notifications when a specific event occurs.
The following subscription methods are available on mainnet:
eth_subscribe
- Create a subscription to a particular eventeth_unsubscribe
- Cancel an active subscription
info
We recommend you use the WSS protocol to set up bidirectional stateful subscriptions. Stateless HTTP WebSockets are also supported.