Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(torii): index events #895

Merged
merged 2 commits into from
Sep 21, 2023
Merged

feat(torii): index events #895

merged 2 commits into from
Sep 21, 2023

Conversation

broody
Copy link
Collaborator

@broody broody commented Sep 15, 2023

We'll remove the state redirection in another PR, enabling this so we can start retrieving events from graphql

@broody broody requested a review from tarrencev September 15, 2023 18:16
@@ -70,12 +70,11 @@ CREATE INDEX idx_entities_keys ON entities (keys);
CREATE INDEX idx_entities_keys_create_on ON entities (keys, created_at);

CREATE TABLE events (
id TEXT NOT NULL PRIMARY KEY,
system_call_id INTEGER NOT NULL,
id INTEGER PRIMARY KEY AUTOINCREMENT,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we will want this to be a computed value, so we can use upserts to make indexing idempotent. something like block_id:event_idx (in ethereum, event index is relative to the block it is included in). afaik starknet doesn't currently have unique event id's but I assume they will follow ethereums approach

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, I've used the event_idx relative to tx receipt for now and so computed id is tx_hash:event_idx

@tarrencev tarrencev merged commit 3ad9ad6 into main Sep 21, 2023
@tarrencev tarrencev deleted the torii-index-events branch September 21, 2023 14:42
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.

2 participants