Graph improvements; into the multichainverse #1265
Replies: 2 comments 15 replies
-
Ya the GraphIDs being overlapping is a problem. I think prefixing with chainID is a reasonable way to disambiguate, I just hope the migration to that new format isn't too painful As far as supporting multi-chain, what do you think about (1) just having multiple clients (one per chain) vs (2) supporting a single client connecting to multiple chains? |
Beta Was this translation helpful? Give feedback.
-
+1 for adding IPFS integration to the graph. The current solution won't scale at all for any operations with regards to filtering/sorting, as you'd have to pull in metadata for all hypercerts separately. |
Beta Was this translation helpful? Give feedback.
-
A place to discuss what we can do to improve the Graph. Since we're pushing the SDKs and marketplace everywhere this week, I think we can work on improving the Graph starting next week.
The most obvious issue is that we can't support x-chain instances since
Additionally we can implement IPFS in the Graph for faster loading of hypercerts data.
The SDK connects to a single Graph
For 1, since we're using urql, we can add an exchange that splits routes:
example 1
example 2
Then, we can let the client query endpoints by mapping over the supported chainIDs.
The SDK requires a user to connect to determine which Graph to show
When we have that implemented, we can work on 2 by separating "test" and "production". This would allow a user to connect in readOnly mode for test or prod using:
const client = new HypercertClient("test")
with a log warning that this is readonlyconst client = new HypercertClient(chain: { id: 11155111})
defaults to test but should block tx calls on non-11155111 hypercertsTo identify those hypercerts, we will update the hypercert IDs.
Graph IDs are overlapping
Currently the hypercerts ID is a concatenation of
{contractAddress}-{tokenID}
. We could update this to{chainId}-{contractAddress}-{tokenID}
, with chainID being human readable integers (e.g. 11155111).We can work on refactoring the IDs and connecting to multiple Graph instances at the same time. The are both requirements for "test" and "production" instances of the SDK.
@Jipperism could you provide some feedback?
Beta Was this translation helpful? Give feedback.
All reactions