mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-09 04:48:05 +00:00
Call subgraph block handlers and fix eden-watcher dependency (#52)
* Call subgraph block handler in watchers * Fix eden-watcher dependency for build Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
This commit is contained in:
parent
ec3a8a31a7
commit
d76268e506
@ -35,6 +35,7 @@
|
|||||||
"@vulcanize/ipld-eth-client": "^0.1.0",
|
"@vulcanize/ipld-eth-client": "^0.1.0",
|
||||||
"@vulcanize/solidity-mapper": "^0.1.0",
|
"@vulcanize/solidity-mapper": "^0.1.0",
|
||||||
"@vulcanize/util": "^0.1.0",
|
"@vulcanize/util": "^0.1.0",
|
||||||
|
"@vulcanize/graph-node": "^0.1.0",
|
||||||
"apollo-server-express": "^2.25.0",
|
"apollo-server-express": "^2.25.0",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
|
@ -543,6 +543,11 @@ export class Indexer implements IndexerInterface {
|
|||||||
await this.triggerIndexingOnEvent(event);
|
await this.triggerIndexingOnEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async processBlock (blockHash: string): Promise<void> {
|
||||||
|
// Call subgraph handler for block.
|
||||||
|
await this._graphWatcher.handleBlock(blockHash);
|
||||||
|
}
|
||||||
|
|
||||||
parseEventNameAndArgs (kind: string, logObj: any): any {
|
parseEventNameAndArgs (kind: string, logObj: any): any {
|
||||||
let eventName = UNKNOWN_EVENT_NAME;
|
let eventName = UNKNOWN_EVENT_NAME;
|
||||||
let eventInfo = {};
|
let eventInfo = {};
|
||||||
|
@ -21,7 +21,8 @@ import {
|
|||||||
QUEUE_IPFS,
|
QUEUE_IPFS,
|
||||||
JobQueueConfig,
|
JobQueueConfig,
|
||||||
DEFAULT_CONFIG_PATH,
|
DEFAULT_CONFIG_PATH,
|
||||||
initClients
|
initClients,
|
||||||
|
JOB_KIND_INDEX
|
||||||
} from '@vulcanize/util';
|
} from '@vulcanize/util';
|
||||||
import { GraphWatcher, Database as GraphDatabase } from '@vulcanize/graph-node';
|
import { GraphWatcher, Database as GraphDatabase } from '@vulcanize/graph-node';
|
||||||
|
|
||||||
@ -57,6 +58,12 @@ export class JobRunner {
|
|||||||
|
|
||||||
await this._baseJobRunner.processBlock(job);
|
await this._baseJobRunner.processBlock(job);
|
||||||
|
|
||||||
|
const { data: { kind, blockHash } } = job;
|
||||||
|
|
||||||
|
if (kind === JOB_KIND_INDEX) {
|
||||||
|
await this._indexer.processBlock(blockHash);
|
||||||
|
}
|
||||||
|
|
||||||
await this._jobQueue.markComplete(job);
|
await this._jobQueue.markComplete(job);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -553,6 +553,11 @@ export class Indexer implements IndexerInterface {
|
|||||||
await this.triggerIndexingOnEvent(event);
|
await this.triggerIndexingOnEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async processBlock (blockHash: string): Promise<void> {
|
||||||
|
// Call subgraph handler for block.
|
||||||
|
await this._graphWatcher.handleBlock(blockHash);
|
||||||
|
}
|
||||||
|
|
||||||
parseEventNameAndArgs (kind: string, logObj: any): any {
|
parseEventNameAndArgs (kind: string, logObj: any): any {
|
||||||
let eventName = UNKNOWN_EVENT_NAME;
|
let eventName = UNKNOWN_EVENT_NAME;
|
||||||
let eventInfo = {};
|
let eventInfo = {};
|
||||||
|
@ -21,7 +21,8 @@ import {
|
|||||||
QUEUE_IPFS,
|
QUEUE_IPFS,
|
||||||
JobQueueConfig,
|
JobQueueConfig,
|
||||||
DEFAULT_CONFIG_PATH,
|
DEFAULT_CONFIG_PATH,
|
||||||
initClients
|
initClients,
|
||||||
|
JOB_KIND_INDEX
|
||||||
} from '@vulcanize/util';
|
} from '@vulcanize/util';
|
||||||
import { GraphWatcher, Database as GraphDatabase } from '@vulcanize/graph-node';
|
import { GraphWatcher, Database as GraphDatabase } from '@vulcanize/graph-node';
|
||||||
|
|
||||||
@ -57,6 +58,12 @@ export class JobRunner {
|
|||||||
|
|
||||||
await this._baseJobRunner.processBlock(job);
|
await this._baseJobRunner.processBlock(job);
|
||||||
|
|
||||||
|
const { data: { kind, blockHash } } = job;
|
||||||
|
|
||||||
|
if (kind === JOB_KIND_INDEX) {
|
||||||
|
await this._indexer.processBlock(blockHash);
|
||||||
|
}
|
||||||
|
|
||||||
await this._jobQueue.markComplete(job);
|
await this._jobQueue.markComplete(job);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user