Refactor job-runner CLI to cli package (#255)

* Fix eden-watcher server initialization

* Add an indexer method to watch subgraph contracts

* Refactor job-runner CLI to cli package

* Move watcher reset commands to refactored code
This commit is contained in:
prathamesh0
2022-11-23 18:20:16 +05:30
committed by GitHub
parent cc28474537
commit 4bfb007a7e
17 changed files with 222 additions and 505 deletions
@@ -491,6 +491,13 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getLatestStateIndexedBlock();
}
{{#if (subgraphPath)}}
async addContracts (): Promise<void> {
// Watching all the contracts in the subgraph.
await this._graphWatcher.addContracts();
}
{{/if}}
async watchContract (address: string, kind: string, checkpoint: boolean, startingBlock: number): Promise<void> {
return this._baseIndexer.watchContract(address, kind, checkpoint, startingBlock);
}
@@ -119,8 +119,7 @@ export const main = async (): Promise<any> => {
graphWatcher.setIndexer(indexer);
await graphWatcher.init();
// Watching all the contracts in the subgraph.
await graphWatcher.addContracts();
await indexer.addContracts();
{{/if}}
const jobRunner = new JobRunner(jobQueueConfig, indexer, jobQueue);