-
Notifications
You must be signed in to change notification settings - Fork 193
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(common): add indexer URL to chain configs #2771
Conversation
🦋 Changeset detectedLatest commit: 8dbaa34 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -96,7 +97,7 @@ export async function createStoreSync<config extends StoreConfig = StoreConfig>( | |||
filters, | |||
initialState, | |||
initialBlockLogs, | |||
indexerUrl, | |||
indexerUrl: indexerUrl ?? (publicClient.chain as MUDChain).indexerUrl, |
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.
Do we want to pass the chain more explicitly to avoid this cast?
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.
no, I don't want to have a potential deviation between publicClient's chain and a chain passed in
this cast is fine but you could be super defensive with something like
"indexerUrl" in publicClient.chain && typeof publicClient.chain.indexerUrl === 'string' ? publicClient.chain.indexerUrl : undefined
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.
we prob also still want some way to turn off the indexer if needed
maybe we also allow indexerUrl: false
here?
Co-authored-by: Kevin Ingersoll <[email protected]>
Co-authored-by: Kevin Ingersoll <[email protected]>
.changeset/rotten-rules-switch.md
Outdated
|
||
Added an optional `indexerUrl` property to `MUDChain` which is used as the default indexer URL in `createStoreSync`. | ||
|
||
Also added indexer URL's to the Redstone and Garnet chain configs. |
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.
can we add a changelog for store-sync that talks about createStoreSync
defaulting to chain.indexerUrl
(or false
to intentionally unset/not default)
and then this one can just focus on adding indexerUrl
to MUDChain
and filling it in for redstone, garnet chains
Co-authored-by: Kevin Ingersoll <[email protected]>
No description provided.