mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 00:44:06 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user