Skip to content

feat: poll blockchain for events instead of websocket streaming#751

Open
kilianglas wants to merge 3 commits into
mainfrom
kilianglas/pull-based-indexer-sync
Open

feat: poll blockchain for events instead of websocket streaming#751
kilianglas wants to merge 3 commits into
mainfrom
kilianglas/pull-based-indexer-sync

Conversation

@kilianglas
Copy link
Copy Markdown
Contributor

@kilianglas kilianglas commented May 23, 2026

Summary

Switches the indexer's blockchain provider from WebSocket subscriptions to periodic HTTP polling.

Previously the indexer backfilled over HTTP and then transitioned to live WebSocket streaming, which required a separate WS_URL endpoint and the provider-ws alloy feature, and reconnected on every dropped socket. It now syncs entirely over HTTP RPC, polling for new events on a fixed interval.

Changes

  • blockchain/mod.rs: replace backfill_and_stream_events (websocket) with pull_events (periodic HTTP polling)
  • Remove WS_URL / ws_rpc_url config, the MissingWsUrl error, and the provider-ws alloy feature
  • Add BLOCKCHAIN_POLL_INTERVAL_SECS (default 1) to control the poll interval
  • Update .env.example, README, and integration tests accordingly

@kilianglas kilianglas requested a review from a team as a code owner May 23, 2026 21:53
@kilianglas kilianglas force-pushed the kilianglas/pull-based-indexer-sync branch from c750a33 to 0e1c285 Compare May 28, 2026 20:21
@kilianglas kilianglas changed the base branch from main to kilianglas/better-tree-rollback May 28, 2026 20:22
@kilianglas kilianglas force-pushed the kilianglas/pull-based-indexer-sync branch from 0e1c285 to 9990a3b Compare May 28, 2026 20:44
@kilianglas kilianglas changed the base branch from kilianglas/better-tree-rollback to main May 28, 2026 20:44
@kilianglas kilianglas changed the title feat: pull-based indexer sync feat: poll blockchain for events instead of websocket streaming May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant