Open jmrossy opened 1 month ago
The general approach here is to remove uses of CoreChains
from @hyperlane-xyz/registry
and instead query the domain
table via Hasura's GraphQL API. See below for pics of the domain table.
If the scraped chain list could be retrieved synchronously, this would be an easy change: just swap that in where we currently reach for the registry export. That's not possible here; it will need to be fetched via an async GraphQL query via the urql
lib.
There are a few ways to solve this kind of problem in a react app:
useDatabaseChains()
hook which executes a query. Depending on how well urql caches the data, we may need to push that data into the zustand state store. _app.ts
which suspends the normal app tree until this data is available. Either way, given that utils like isPiChain
currently assume this data is globally and synchronously available, some refactoring will be needed. Overall, not a small task but not huge either.
Some relevant files:
src/features/chains/utils.ts
src/components/search/SearchFilterBar.tsx
src/store.ts
src/features/messages/MessageSearch.tsx
src/features/messages/queries/useMessageQuery.ts
(for an example of using urql
)
Currently it imports CoreChains from the Registry lib to determine if scraped. It would be better to query the DB for this information.
Once this is done, remove the hard-coded CoreChains list from the registry as it's no longer needed.
https://discord.com/channels/935678348330434570/935678739663192184/1241041835976294442