/validators endpoint streams Merkle Tree Hook insertions for one origin domain. Each new insertion wakes the Validator so it can check a checkpoint before the next poll. The Validator computes the Merkle root locally and signs only after verifying it against the on-chain root through its existing RPC endpoints.
Connect to an origin domain
If you run a Validator, setwebsocketUrl to the URL below without query parameters. The Validator adds the origin domain, requests confirmations when configured as a number, and handles RPC recovery.
domain in the URL. This browser example logs new insertions on Ethereum. The server subscribes the connection automatically.
Custom confirmation counts require near-head indexing for the domain. If the requested policy is unavailable, the server rejects the subscription. The Validator requests its configured depth for a numeric
blocks.reorgPeriod and uses the canonical stream for a block-tag policy.
Read the frames
The first frame on a successful connection isready. Check its domain and confirmation policy before processing insertions. For the canonical Ethereum connection it looks like this.
confirmations in ready. Each insertion identifies the hook, message, and source block. In this example, the message occupies leaf 5. The top-level sequence carries the same index as a decimal string.
Catch up and recover through RPC
The feed sends live events only. A client that maintains a complete tree needs RPC history on startup and after every reconnect.- Buffer insertion events as soon as you receive
ready. Events can arrive before thelive_startframe. - Use
live_startto find the block where RPC history and live coverage meet. Check the domain, confirmation policy, and hook address against your configuration. Verify the block hash through RPC and index through the advertised height. - Check the on-chain leaf count at the boundary and wait until RPC indexing covers that count. Compare any overlapping insertions against the RPC data. Apply the remaining buffered insertions in contiguous leaf order.
- If you receive
live_start_unavailable, keep indexing through RPC. On a disconnect, sequence gap, conflicting insertion, orrollback, return to RPC and verify a freshlive_startbefore switching back to live events.