Skip to content

Add Starknet RPC event indexing package - #221

Draft
loothero wants to merge 23 commits into
apibara:mainfrom
loothero:feat/starknet-rpc-events
Draft

Add Starknet RPC event indexing package#221
loothero wants to merge 23 commits into
apibara:mainfrom
loothero:feat/starknet-rpc-events

Conversation

@loothero

@loothero loothero commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Adds @apibara/starknet-rpc, a Starknet JSON-RPC v0.10 event indexing package.

The package supports accepted historical backfill over HTTP with starknet_getEvents, plus live event indexing over WebSocket subscriptions with reconnect handling,
reorg messages, cursor resume logic, and pre-confirmed indexing by default.

Included

  • HTTP event backfill with continuation tokens, chunking, and configurable range sizing
  • WebSocket live event subscriptions with reconnects, idle timeout, bounded queues, and rollback messages
  • Cursor normalization, finality-aware resume behavior, event deduping, and block metadata caching
  • StarknetRpcStream, an Apibara RpcStreamConfig adapter for accepted event blocks
  • CLI/runtime support for RpcStreamConfig sources without requiring a DNA streamUrl
  • README documentation and tests

Notes

  • Historical backfill uses accepted events from starknet_getEvents
  • finalityStatus applies to live WebSocket subscriptions
  • Callers should persist cursor finality and rollback cursors with application state for correct restart and reorg handling
  • Large backfills should tune chunkSize, getEventsRangeSize, and node infrastructure according to rate limits

Verification

  • pnpm --filter @apibara/starknet-rpc lint
  • pnpm --filter @apibara/starknet-rpc typecheck
  • pnpm --filter @apibara/starknet-rpc test:ci
  • pnpm --filter @apibara/starknet-rpc build
  • pnpm --filter @apibara/indexer lint
  • pnpm --filter @apibara/indexer typecheck
  • pnpm --filter @apibara/indexer test:ci
  • pnpm --filter @apibara/indexer build
  • pnpm --filter apibara lint
  • pnpm --filter apibara typecheck
  • pnpm --filter apibara build
  • pnpm beachball check

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2dc1c528-79d1-4a5f-b605-c1f005a631d7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fracek
fracek self-requested a review June 15, 2026 17:07
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