[Filter] eth_subscribe
Creates a new subscription to specific events by using either RPC Pub/Sub over WebSockets or filters over HTTP. It allows clients to wait for events instead of polling for them.
The node will return a subscription id for each subscription created. For each event that matches the subscription, a notification with relevant data is sent together with the subscription id. If a connection is closed, all subscriptions created over the connection are removed.
JSONRPC: eth_subscribe
Request
- application/json
Body
params NotificationType (string)[]
Possible values: [newHeads
, logs
]
A notification type: "newHeads" or "logs"