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(common): add indexer URL to chain configs #2771

Merged
merged 13 commits into from
Apr 30, 2024

Conversation

yonadaaa
Copy link
Contributor

No description provided.

@yonadaaa yonadaaa requested review from alvrs and holic as code owners April 30, 2024 12:30
Copy link

changeset-bot bot commented Apr 30, 2024

🦋 Changeset detected

Latest commit: 8dbaa34

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@latticexyz/store-sync Patch
@latticexyz/common Patch
@latticexyz/dev-tools Patch
@latticexyz/store-indexer Patch
@latticexyz/block-logs-stream Patch
@latticexyz/cli Patch
@latticexyz/config Patch
@latticexyz/faucet Patch
@latticexyz/protocol-parser Patch
@latticexyz/query Patch
@latticexyz/store Patch
@latticexyz/world-modules Patch
@latticexyz/world Patch
mock-game-contracts Patch
@latticexyz/react Patch
@latticexyz/abi-ts Patch
create-mud Patch
@latticexyz/gas-report Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/utils Patch

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

holic
holic previously approved these changes Apr 30, 2024
@@ -96,7 +97,7 @@ export async function createStoreSync<config extends StoreConfig = StoreConfig>(
filters,
initialState,
initialBlockLogs,
indexerUrl,
indexerUrl: indexerUrl ?? (publicClient.chain as MUDChain).indexerUrl,
Copy link
Contributor Author

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?

Copy link
Member

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

Copy link
Member

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?

yonadaaa and others added 2 commits April 30, 2024 15:11
Co-authored-by: Kevin Ingersoll <[email protected]>
Co-authored-by: Kevin Ingersoll <[email protected]>
@yonadaaa yonadaaa requested a review from holic April 30, 2024 15:17

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.
Copy link
Member

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

@yonadaaa yonadaaa merged commit 764ca0a into main Apr 30, 2024
12 checks passed
@yonadaaa yonadaaa deleted the yonadaaa/indexer-chain-config branch April 30, 2024 21:10
dhvanipa pushed a commit to tenetxyz/mud that referenced this pull request May 24, 2024
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