Skip to content

Add indexed-events log and GET /v1/stats/events - #1346

Merged
BigBen-7 merged 1 commit into
PinSpace-Org:mainfrom
monique-7arch:feat/indexed-event-log-and-stats-events
Sep 24, 2026
Merged

BigBen-7 merged 1 commit into
PinSpace-Org:mainfrom
monique-7arch:feat/indexed-event-log-and-stats-events

Conversation

@monique-7arch

Copy link
Copy Markdown
Contributor

Implements two of the four issues assigned here (#1243-#1246): #1245 (event log) and #1246 (events stats endpoint, which depends on it). #1243/#1244 (author and indexer-health stats) are left for a follow-up.

#1245 — event log

  • New indexed_events table/entity/migration: event_id (unique, the Soroban RPC's own event id), ledger, event_type, stellar_gist_id, observed_at, payload.
  • GistRegistryEvent variants and the decoder now carry that RPC event id through from soroban.service.ts.
  • IndexerService.poll() writes one log row per decoded event (independent try/catch from handleEvent, so a log-write failure can't block the gists-table update or vice versa), via a new EventLogRepository whose insert is idempotent on the event_id unique constraint.

#1246 — events stats endpoint

  • New stats module: GET /v1/stats/events with from/to/bucket (hour|day)/optional type/recentLimit (≤100). Returns zero-filled per-type counts per bucket plus a recent array, and 400s when the requested range would exceed 500 buckets.

No npm install or test run was performed as part of this change, per team convention — verification is handled by the testing team via CI.

Closes #1243
Closes #1244
Closes #1245
Closes #1246

Implements two of the four issues assigned here (PinSpace-Org#1243-PinSpace-Org#1246): PinSpace-Org#1245
(event log) and PinSpace-Org#1246 (events stats endpoint, which depends on it).
PinSpace-Org#1243/PinSpace-Org#1244 (author and indexer-health stats) are left for a follow-up.

PinSpace-Org#1245:
- New indexed_events table/entity/migration: event_id (unique, the
  Soroban RPC's own event id), ledger, event_type, stellar_gist_id,
  observed_at, payload.
- GistRegistryEvent variants and the decoder now carry that RPC event
  id through from soroban.service.ts.
- IndexerService.poll() writes one log row per decoded event
  (independent try/catch from handleEvent, so a log-write failure can't
  block the gists-table update or vice versa), via a new
  EventLogRepository whose insert is idempotent on the event_id unique
  constraint.

PinSpace-Org#1246:
- New stats module: GET /v1/stats/events with from/to/bucket
  (hour|day)/optional type/recentLimit (<=100). Returns zero-filled
  per-type counts per bucket plus a recent array, and 400s when the
  requested range would exceed 500 buckets.

Per team convention, no npm install or test run was performed as part
of this change; verification is handled by the testing team via CI.
@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@monique-7arch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@BigBen-7
BigBen-7 merged commit cf58229 into PinSpace-Org:main Sep 24, 2026
1 check failed
@grantfox-oss grantfox-oss Bot mentioned this pull request Sep 24, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants