hypercerts-org / hypercerts

Hypercerts are a tool to build scalable retrospective reward systems for impact.
https://hypercerts.org/
Other
93 stars 30 forks source link

Explore chainsauce as an indexing solution #734

Closed ryscheng closed 11 months ago

ryscheng commented 1 year ago

What is it?

Chainsauce is an indexing solution that allows you to setup up custom event handlers client or server side.

On a server it would serve as an indexer and we can expose an API endpoint to query data.

Client side, it's possible to store state in -for example- a sqlite DB

I've had issues building it client side (because polyfills) so made a fork that's browser native.

Here are the packages:

OG Chainsauce: https://www.npmjs.com/package/chainsauce My fork: https://www.npmjs.com/package/chainsauce-web

For us, it might be interesting to set up an instance somewhere (like on railway) and expose an endpoint

bitbeckers commented 1 year ago

I'm using it fully client side here: https://github.com/bitbeckers/cookie-jar/tree/main/src/utils

You can see a lot of handlers and with hypercerts and the number of data points, we probably want to run a BE service somewhere that does the indexing.

ryscheng commented 1 year ago

We currently index for the following use cases:

@bitbeckers Could you help share your thoughts on the pros/cons of replacing any one of these with chainsauce? Is it worth using chainsauce for everything? Or should we be doing more stuff in the Graph?

bitbeckers commented 1 year ago

Since OpenZeppelin monitors a event and executes a DB mutation for one specific event, that sounds like a good place to start. Also because there's the 120 request rate limit.

ryscheng commented 1 year ago

If that's the only use case that's worth shooting for at the moment, I'm inclined to defer this until there's a bigger pain that needs to be addressed. It's a pretty big refactor for relatively small benefit.

bitbeckers commented 1 year ago

@ryscheng you're working with Dune now right? I'm taking my name of this ticket for a clean(er) board