-
Notifications
You must be signed in to change notification settings - Fork 196
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(store-indexer,store-sync): filter by table and key #1794
Changes from 2 commits
8a9ff88
2b9ab10
89d37c5
ab0139c
e7844a3
02707b5
60aa7f4
5cd34b6
e2f965a
7ef8939
b165960
bf91e95
1b4764f
5e0bcea
f7a366a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,14 @@ export type TableWithRecords = Table & { records: TableRecord[] }; | |
export type StoreEventsLog = Log<bigint, number, false, StoreEventsAbiItem, true, StoreEventsAbi>; | ||
export type BlockLogs = { blockNumber: StoreEventsLog["blockNumber"]; logs: StoreEventsLog[] }; | ||
|
||
// TODO: should we add address here? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's best if we keep |
||
export type SyncFilter = { | ||
tableId?: Hex; | ||
key0?: Hex; | ||
key1?: Hex; | ||
// TODO: decide how many keys to support | ||
}; | ||
|
||
export type SyncOptions<TConfig extends StoreConfig = StoreConfig> = { | ||
/** | ||
* MUD config | ||
|
@@ -42,9 +50,9 @@ export type SyncOptions<TConfig extends StoreConfig = StoreConfig> = { | |
*/ | ||
address?: Address; | ||
/** | ||
* Optional table IDs to filter indexer state and RPC state. | ||
* Optional filters for indexer and RPC state. Useful to narrow down the data received by the client for large worlds. | ||
*/ | ||
tableIds?: Hex[]; | ||
holic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
filters?: SyncFilter[]; | ||
/** | ||
* Optional block number to start indexing from. Useful for resuming the indexer from a particular point in time or starting after a particular contract deployment. | ||
*/ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add this to the changeset? Might make it easier to update in the docs later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up making
tableId
required for now, so this comment doesn't really apply but I left it here so that we revisit this once we maketableId
optional.