Comments (1)
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:
- Create a new
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. - Add a new wrapper component in
_app.ts
which suspends the normal app tree until this data is available. - Trigger an effect somewhere that performs a one-off graphql query and places the data either in the store (preferable) or just in some global state somewhere
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 usingurql
)
![Screenshot 2024-07-02 at 2 31 36 PM](https://private-user-images.githubusercontent.com/710751/345153217-bbbf8270-ba66-4ac6-9b44-5c43c166c7dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NzI0NDQsIm5iZiI6MTcyMTc3MjE0NCwicGF0aCI6Ii83MTA3NTEvMzQ1MTUzMjE3LWJiYmY4MjcwLWJhNjYtNGFjNi05YjQ0LTVjNDNjMTY2YzdkYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyM1QyMjAyMjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iYWE0N2M4YzdhMWI5NzA3OTdlY2EyODY0NjViOGNhNDZhOWUzZGNmNjJhZjQ3ZjA2YWZjZmIyMjUxMjU2ZGZlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.ngR_mk7uvvul2kRCbJ6-l_ebE7BKeWq2bGRMZbraoM8)
![Screenshot 2024-07-02 at 2 32 18 PM](https://private-user-images.githubusercontent.com/710751/345153396-1d1e8749-cb5e-47ae-b6d8-2a5861729f8a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NzI0NDQsIm5iZiI6MTcyMTc3MjE0NCwicGF0aCI6Ii83MTA3NTEvMzQ1MTUzMzk2LTFkMWU4NzQ5LWNiNWUtNDdhZS1iNmQ4LTJhNTg2MTcyOWY4YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyM1QyMjAyMjRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYjE4MzU2NWUxZjllMzI2M2U5ZmRlNGI0NTJiYWZmZWJhODk0MWE2MjhmYTk4NDkxYzIyNTEwMmE4ODk0NzAxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.7fRHh-j7oxugXXWWkYzqB3vbzPmilIouh1m_Zw4DaZw)
from hyperlane-explorer.
Related Issues (20)
- Explorer should work with 32-byte addresses from GraphQL queries
- Redesign chain filters and filter testnet by default + add PI from registry
- Smoother incremental additions to feed
- still pending status
- `data` url query doesn't show deliveries or message content
- Decode warp route messages
- Decode ISM metadata
- Cosmos message support
- Cosmos delivery checking
- Cosmos message debugging
- Solana message support
- Solana delivery checking
- Solana message debugging
- Improve scalability of PI message search
- Harden explorer API to abuse HOT 3
- Improve test coverage of explorer PI utilities
- Add support to show DApp name in explorer. HOT 2
- Search query error when change selected chain
- Add duration information to message details page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperlane-explorer.