vulcanize / uniswap-watcher-ts

GNU Affero General Public License v3.0
1 stars 0 forks source link

Create new resolver that serves GQL requests using watched data (e.g. from Postgres) with proofs #3

Closed ashwinphatak closed 1 year ago

ashwinphatak commented 3 years ago

https://github.com/vulcanize/erc20-watcher/blob/main/packages/server/src/gql.ts#L7

When MOCK=1 ENV VAR is present, it should use the mock resovler. Else, it should use a new resolver that returns data from the new watcher we're writing.

ramilexe commented 3 years ago

As far as I understood from the conversation with Rick, this resolver should be connected to IPLD database (db0). But to be able to serve queries like balanceOf(blockHash, token, owner), allowance(blockHash, token, owner, spender) we need to have prepared indexed data. In that case, the resolver should be connected to the watcher database, right? Do have a database design for watcher db?

Next question, how to populate this watcher database? Do we have a list of contract addresses that we need to watch? If a user provides the contract's address first how do we process it? Run a separate process of watcher for this specific address?

ashwinphatak commented 3 years ago

The resolver is just using the tables already created by a normal eth-watcher-ts based watcher.

ramilexe commented 3 years ago

eth-watcher-ts could watch for multiple contracts and it creates tables like:

How to map graphql request balanceOf(blockHash, token, owner) to contract ID and state?

prathamesh0 commented 1 year ago

Closing as outdated.