Closed ashwinphatak closed 1 year 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?
The resolver is just using the tables already created by a normal eth-watcher-ts based watcher.
eth-watcher-ts could watch for multiple contracts and it creates tables like:
data.contract_id_1_state_1
- data about storage number 1 in contract id 1data.contract_id_1_state_2
- data about storage number 2 in contract id 1data.contract_id_2_state_1
- data about storage number 1 in contract id 2How to map graphql request balanceOf(blockHash, token, owner)
to contract ID and state?
Closing as outdated.
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.