Skip to main content

eth-v1-events


/eth/v1/events

Subscribe to beacon node events.

Gives subscribers to the beacon node's Server-Sent-Events stream an endpoint. To listen in on those events, users need use eventsource implementation.

SSE comments starting with: may be sent by servers for any reason, including maintaining the event stream connection when proxy servers are present.

Example Request and Result for /v1/events

In this section, we provide an illustrative example of a request made to retrieve details contents using the /v1/events endpoint. Additionally, we present the resulting response containing information about subscribing to beacon node events.

Parameters

FieldsTypeDescription

topics*

array<string>

Event types to subscribe to

Available values : head, block, block_gossip, attestation, voluntary_exit, bls_to_execution_change, proposer_slashing, attester_slashing, finalized_checkpoint, chain_reorg, contribution_and_proof, light_client_finality_update, light_client_optimistic_update, payload_attributes, blob_sidecar

info

The example in this section uses a non-existing project id.

Make sure you replace it with your Ethereum Holesky Beacon endpoint when issuing the API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Subscribe to beacon node events.

GET https://eth-holesky-beacon.blastapi.io/<project-id>/eth/v1/events

Query Parameters

NameTypeDescription
topics*stringhead
event: head
data: {"slot":"10", "block":"0x9a2fefd2fdb57f74993c7780ea5b9030d2897b615b89f808011ca5aebed54eaf", "state":"0x600e852a08c1200654ddf11025f1ceacb3c2e74bdd5c630cde0838b2591b69f9", "epoch_transition":false, "previous_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "current_duty_dependent_root":"0x5e0043f107cb57913498fbf2f99ff55e730bf1e151f02f221e977c91a90a0e91", "execution_optimistic": false}
info

Example Description

The node has finished processing, resulting in a new head. previous_duty_dependent_root is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch - 1) - 1) and current_duty_dependent_root is get_block_root_at_slot(state, compute_start_slot_at_epoch(epoch) - 1). Both dependent roots use the genesis block root in the case of underflow.

Curl Request example

curl -X 'GET' \
'https://eth-holesky-beacon.blastapi.io/<project-id>/eth/v1/events?topics=head' \
-H 'accept: text/event-stream'