Add isFEVM flag in config to avoid filtering event logs by topics (#454)

* Pass upstream config to indexer instance

* Add isFEVM flag and refactor watcher config fields

* Codegen changes for indexer

* Add missing getter in dummy indexer for graph-node tests
This commit is contained in:
2023-11-07 12:07:49 +05:30
committed by GitHub
parent dd92b4feb2
commit 8547876764
22 changed files with 157 additions and 64 deletions
+12 -3
View File
@@ -17,7 +17,8 @@ import {
ServerConfig,
Clients,
EventWatcher,
GraphWatcherInterface
GraphWatcherInterface,
UpstreamConfig
} from '@cerc-io/util';
import { initClients } from './utils/index';
@@ -102,7 +103,10 @@ export class BaseCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
@@ -117,7 +121,12 @@ export class BaseCmd {
assert(this._ethProvider);
assert(this._jobQueue);
this._indexer = new Indexer(this._config.server, this._database, this._clients, this._ethProvider, this._jobQueue, graphWatcher);
const config = {
server: this._config.server,
upstream: this._config.upstream
};
this._indexer = new Indexer(config, this._database, this._clients, this._ethProvider, this._jobQueue, graphWatcher);
await this._indexer.init();
if (graphWatcher) {
+6 -2
View File
@@ -15,7 +15,8 @@ import {
ServerConfig,
Clients,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from '../base';
@@ -72,7 +73,10 @@ export class CreateCheckpointCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -17,7 +17,8 @@ import {
verifyCheckpointData,
GraphDatabase,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from '../base';
@@ -73,7 +74,10 @@ export class VerifyCheckpointCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -27,7 +27,8 @@ import {
StateKind,
createOrUpdateStateData,
getContractEntitiesMap,
prepareEntityStateFromGQLResponse
prepareEntityStateFromGQLResponse,
UpstreamConfig
} from '@cerc-io/util';
import { GraphQLClient } from '@cerc-io/ipld-eth-client';
@@ -97,7 +98,10 @@ export class CreateStateFromGQLCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -20,7 +20,8 @@ import {
StateKind,
Clients,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -78,7 +79,10 @@ export class ExportStateCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -20,7 +20,8 @@ import {
Clients,
fillBlocks,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -81,7 +82,10 @@ export class FillCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -23,7 +23,8 @@ import {
GraphWatcherInterface,
GraphDatabase,
updateEntitiesFromState,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -80,7 +81,10 @@ export class ImportStateCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -17,7 +17,8 @@ import {
Clients,
indexBlock,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -72,7 +73,10 @@ export class IndexBlockCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -18,7 +18,8 @@ import {
ServerConfig,
Clients,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -75,7 +76,10 @@ export class InspectCIDCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -19,7 +19,8 @@ import {
JobRunner,
GraphWatcherInterface,
startMetricsServer,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -81,7 +82,10 @@ export class JobRunnerCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -15,7 +15,8 @@ import {
ServerConfig,
Clients,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from '../base';
@@ -71,7 +72,10 @@ export class ResetWatcherCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -28,7 +28,8 @@ import {
Config,
PaymentsManager,
Consensus,
readParty
readParty,
UpstreamConfig
} from '@cerc-io/util';
import { TypeSource } from '@graphql-tools/utils';
import type {
@@ -111,7 +112,10 @@ export class ServerCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,
+6 -2
View File
@@ -16,7 +16,8 @@ import {
ServerConfig,
Clients,
GraphWatcherInterface,
Config
Config,
UpstreamConfig
} from '@cerc-io/util';
import { BaseCmd } from './base';
@@ -74,7 +75,10 @@ export class WatchContractCmd {
async initIndexer (
Indexer: new (
serverConfig: ServerConfig,
config: {
server: ServerConfig;
upstream: UpstreamConfig;
},
db: DatabaseInterface,
clients: Clients,
ethProvider: JsonRpcProvider,