mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-04 18:46:47 +00:00
* Upgrade eslint and additional lint changes * Upgrade typescript version to v5 --------- Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
This commit is contained in:
parent
0f239c360e
commit
ee63e33cc5
@ -1,4 +1,4 @@
|
|||||||
FROM node:16.13.1-alpine3.14
|
FROM node:18.15.0-alpine3.16
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -51,10 +51,10 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
|
@ -12,8 +12,8 @@ import { BlockProgress } from './entity/BlockProgress';
|
|||||||
import { Trace } from './entity/Trace';
|
import { Trace } from './entity/Trace';
|
||||||
|
|
||||||
export class Database {
|
export class Database {
|
||||||
_config: ConnectionOptions
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection
|
_conn!: Connection;
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
@ -20,5 +20,5 @@ export class BlockProgress {
|
|||||||
numTracedTx!: number;
|
numTracedTx!: number;
|
||||||
|
|
||||||
@Column('boolean')
|
@Column('boolean')
|
||||||
isComplete!: boolean
|
isComplete!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -23,5 +23,5 @@ export class Trace {
|
|||||||
trace!: string;
|
trace!: string;
|
||||||
|
|
||||||
@ManyToMany(() => Account, account => account.appearances, { eager: true, cascade: ['insert'] })
|
@ManyToMany(() => Account, account => account.appearances, { eager: true, cascade: ['insert'] })
|
||||||
accounts: Account[]
|
accounts: Account[];
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,10 @@ import { BlockProgress } from './entity/BlockProgress';
|
|||||||
const log = debug('vulcanize:indexer');
|
const log = debug('vulcanize:indexer');
|
||||||
|
|
||||||
export class Indexer {
|
export class Indexer {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_getStorageAt: GetStorageAt
|
_getStorageAt: GetStorageAt;
|
||||||
_tracingClient: TracingClient
|
_tracingClient: TracingClient;
|
||||||
|
|
||||||
constructor (db: Database, ethClient: EthClient, tracingClient: TracingClient) {
|
constructor (db: Database, ethClient: EthClient, tracingClient: TracingClient) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -19,11 +19,11 @@ export const BlockProgressEvent = 'block-progress-event';
|
|||||||
export const QUEUE_TX_TRACING = 'tx-tracing';
|
export const QUEUE_TX_TRACING = 'tx-tracing';
|
||||||
|
|
||||||
export class TxWatcher {
|
export class TxWatcher {
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_indexer: Indexer
|
_indexer: Indexer;
|
||||||
_pubsub: PubSub
|
_pubsub: PubSub;
|
||||||
_watchTxSubscription: ZenObservable.Subscription | undefined
|
_watchTxSubscription: ZenObservable.Subscription | undefined;
|
||||||
_jobQueue: JobQueue
|
_jobQueue: JobQueue;
|
||||||
|
|
||||||
constructor (ethClient: EthClient, indexer: Indexer, pubsub: PubSub, jobQueue: JobQueue) {
|
constructor (ethClient: EthClient, indexer: Indexer, pubsub: PubSub, jobQueue: JobQueue) {
|
||||||
this._ethClient = ethClient;
|
this._ethClient = ethClient;
|
||||||
|
1
packages/cache/.eslintrc.json
vendored
1
packages/cache/.eslintrc.json
vendored
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"error",
|
"error",
|
||||||
|
4
packages/cache/package.json
vendored
4
packages/cache/package.json
vendored
@ -31,10 +31,10 @@
|
|||||||
"@types/level": "^6.0.0",
|
"@types/level": "^6.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0"
|
"eslint-plugin-standard": "^5.0.0"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -32,10 +32,10 @@
|
|||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^5.0.0",
|
"eslint-config-standard": "^5.0.0",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"typescript": "^4.9.4"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ export class BaseCmd {
|
|||||||
_config?: Config;
|
_config?: Config;
|
||||||
_clients?: Clients;
|
_clients?: Clients;
|
||||||
_ethProvider?: JsonRpcProvider;
|
_ethProvider?: JsonRpcProvider;
|
||||||
_jobQueue?: JobQueue
|
_jobQueue?: JobQueue;
|
||||||
_database?: DatabaseInterface;
|
_database?: DatabaseInterface;
|
||||||
_indexer?: IndexerInterface;
|
_indexer?: IndexerInterface;
|
||||||
_eventWatcher?: EventWatcher;
|
_eventWatcher?: EventWatcher;
|
||||||
|
@ -29,8 +29,8 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class CreateCheckpointCmd {
|
export class CreateCheckpointCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
this._baseCmd = new BaseCmd();
|
this._baseCmd = new BaseCmd();
|
||||||
|
@ -30,8 +30,8 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class VerifyCheckpointCmd {
|
export class VerifyCheckpointCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
this._baseCmd = new BaseCmd();
|
this._baseCmd = new BaseCmd();
|
||||||
|
@ -34,7 +34,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ExportStateCmd {
|
export class ExportStateCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -37,7 +37,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class FillCmd {
|
export class FillCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -36,7 +36,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ImportStateCmd {
|
export class ImportStateCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -31,7 +31,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class InspectCIDCmd {
|
export class InspectCIDCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -29,7 +29,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class JobRunnerCmd {
|
export class JobRunnerCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -22,9 +22,9 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ResetStateCmd {
|
export class ResetStateCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_config?: Config;
|
_config?: Config;
|
||||||
_database?: DatabaseInterface
|
_database?: DatabaseInterface;
|
||||||
|
|
||||||
async initConfig (configFile: string): Promise<Config> {
|
async initConfig (configFile: string): Promise<Config> {
|
||||||
this._config = await getConfig(configFile);
|
this._config = await getConfig(configFile);
|
||||||
|
@ -28,7 +28,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ResetWatcherCmd {
|
export class ResetWatcherCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -45,7 +45,7 @@ interface Arguments {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ServerCmd {
|
export class ServerCmd {
|
||||||
_argv?: Arguments
|
_argv?: Arguments;
|
||||||
_baseCmd: BaseCmd;
|
_baseCmd: BaseCmd;
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"node-fetch": "^2",
|
"node-fetch": "^2",
|
||||||
"solc": "0.8.13",
|
"solc": "0.8.13",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2",
|
"typescript": "^5.0.2",
|
||||||
"yargs": "^17.1.1"
|
"yargs": "^17.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -43,10 +43,10 @@
|
|||||||
"@types/node": "^16.9.0",
|
"@types/node": "^16.9.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0"
|
"eslint-plugin-promise": "^5.1.0"
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
"eslint": "^7.27.0",
|
"eslint": "^7.27.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -59,14 +59,14 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ export class Account {
|
|||||||
totalSlashed!: bigint;
|
totalSlashed!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -63,5 +63,5 @@ export class Block {
|
|||||||
size!: bigint;
|
size!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -34,5 +34,5 @@ export class Claim {
|
|||||||
claimed!: bigint;
|
claimed!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -34,5 +34,5 @@ export class Distribution {
|
|||||||
metadataURI!: string;
|
metadataURI!: string;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,5 @@ export class Distributor {
|
|||||||
currentDistribution!: string;
|
currentDistribution!: string;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -41,5 +41,5 @@ export class Epoch {
|
|||||||
producerBlocksRatio!: Decimal;
|
producerBlocksRatio!: Decimal;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -41,5 +41,5 @@ export class Network {
|
|||||||
stakedPercentiles!: bigint[];
|
stakedPercentiles!: bigint[];
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -33,5 +33,5 @@ export class Producer {
|
|||||||
pendingEpochBlocks!: bigint;
|
pendingEpochBlocks!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -35,5 +35,5 @@ export class ProducerEpoch {
|
|||||||
blocksProducedRatio!: Decimal;
|
blocksProducedRatio!: Decimal;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -27,5 +27,5 @@ export class ProducerRewardCollectorChange {
|
|||||||
rewardCollector!: string;
|
rewardCollector!: string;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,5 @@ export class ProducerSet {
|
|||||||
producers!: string[];
|
producers!: string[];
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -35,5 +35,5 @@ export class ProducerSetChange {
|
|||||||
changeType!: ProducerSetChangeType;
|
changeType!: ProducerSetChangeType;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -29,5 +29,5 @@ export class RewardSchedule {
|
|||||||
activeRewardScheduleEntry!: string;
|
activeRewardScheduleEntry!: string;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -27,5 +27,5 @@ export class RewardScheduleEntry {
|
|||||||
rewardsPerEpoch!: bigint;
|
rewardsPerEpoch!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -28,5 +28,5 @@ export class Slash {
|
|||||||
slashed!: bigint;
|
slashed!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -41,5 +41,5 @@ export class Slot {
|
|||||||
taxRatePerDay!: Decimal;
|
taxRatePerDay!: Decimal;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -41,5 +41,5 @@ export class SlotClaim {
|
|||||||
taxRatePerDay!: Decimal;
|
taxRatePerDay!: Decimal;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -24,5 +24,5 @@ export class Staker {
|
|||||||
rank!: bigint;
|
rank!: bigint;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -66,21 +66,21 @@ const KIND_MERKLEDISTRIBUTOR = 'EdenNetworkDistribution';
|
|||||||
const KIND_DISTRIBUTORGOVERNANCE = 'EdenNetworkGovernance';
|
const KIND_DISTRIBUTORGOVERNANCE = 'EdenNetworkGovernance';
|
||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_ethProvider: BaseProvider
|
_ethProvider: BaseProvider;
|
||||||
_baseIndexer: BaseIndexer
|
_baseIndexer: BaseIndexer;
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
_graphWatcher: GraphWatcher;
|
_graphWatcher: GraphWatcher;
|
||||||
|
|
||||||
_abiMap: Map<string, JsonFragment[]>
|
_abiMap: Map<string, JsonFragment[]>;
|
||||||
_storageLayoutMap: Map<string, StorageLayout>
|
_storageLayoutMap: Map<string, StorageLayout>;
|
||||||
_contractMap: Map<string, ethers.utils.Interface>
|
_contractMap: Map<string, ethers.utils.Interface>;
|
||||||
|
|
||||||
_entityTypesMap: Map<string, { [key: string]: string }>
|
_entityTypesMap: Map<string, { [key: string]: string }>;
|
||||||
_relationsMap: Map<any, { [key: string]: any }>
|
_relationsMap: Map<any, { [key: string]: any }>;
|
||||||
|
|
||||||
_subgraphStateMap: Map<string, any>
|
_subgraphStateMap: Map<string, any>;
|
||||||
|
|
||||||
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue, graphWatcher?: GraphWatcherInterface) {
|
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue, graphWatcher?: GraphWatcherInterface) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -64,10 +64,10 @@
|
|||||||
"@types/json-bigint": "^1.0.0",
|
"@types/json-bigint": "^1.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
|
@ -20,8 +20,8 @@ import { StateSyncStatus } from './entity/StateSyncStatus';
|
|||||||
export const ENTITIES = [Allowance, Balance];
|
export const ENTITIES = [Allowance, Balance];
|
||||||
|
|
||||||
export class Database implements DatabaseInterface {
|
export class Database implements DatabaseInterface {
|
||||||
_config: ConnectionOptions
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection
|
_conn!: Connection;
|
||||||
_baseDatabase: BaseDatabase;
|
_baseDatabase: BaseDatabase;
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
|
@ -39,10 +39,10 @@ export class BlockProgress implements BlockProgressInterface {
|
|||||||
lastProcessedEventIndex!: number;
|
lastProcessedEventIndex!: number;
|
||||||
|
|
||||||
@Column('boolean')
|
@Column('boolean')
|
||||||
isComplete!: boolean
|
isComplete!: boolean;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
|
|
||||||
@CreateDateColumn()
|
@CreateDateColumn()
|
||||||
createdAt!: Date;
|
createdAt!: Date;
|
||||||
|
@ -61,16 +61,16 @@ interface EventResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_ethProvider: BaseProvider
|
_ethProvider: BaseProvider;
|
||||||
_baseIndexer: BaseIndexer
|
_baseIndexer: BaseIndexer;
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
|
|
||||||
_abi: JsonFragment[]
|
_abi: JsonFragment[];
|
||||||
_storageLayout: StorageLayout
|
_storageLayout: StorageLayout;
|
||||||
_contract: ethers.utils.Interface
|
_contract: ethers.utils.Interface;
|
||||||
_serverMode: string
|
_serverMode: string;
|
||||||
|
|
||||||
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue) {
|
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -6,10 +6,10 @@ import { utils } from 'ethers';
|
|||||||
|
|
||||||
// Initialize a Token Definition with the attributes.
|
// Initialize a Token Definition with the attributes.
|
||||||
export class StaticTokenDefinition {
|
export class StaticTokenDefinition {
|
||||||
address : string
|
address : string;
|
||||||
symbol: string
|
symbol: string;
|
||||||
name: string
|
name: string;
|
||||||
decimals: bigint
|
decimals: bigint;
|
||||||
|
|
||||||
// Initialize a Token Definition with its attributes.
|
// Initialize a Token Definition with its attributes.
|
||||||
constructor (address: string, symbol: string, name: string, decimals: bigint) {
|
constructor (address: string, symbol: string, name: string, decimals: bigint) {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -71,15 +71,15 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"hardhat": "^2.3.0",
|
"hardhat": "^2.3.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export class Database implements DatabaseInterface {
|
|||||||
_config: ConnectionOptions;
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection;
|
_conn!: Connection;
|
||||||
_baseDatabase: BaseDatabase;
|
_baseDatabase: BaseDatabase;
|
||||||
_propColMaps: { [key: string]: Map<string, string>; }
|
_propColMaps: { [key: string]: Map<string, string>; };
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
@ -19,5 +19,5 @@ export class TransferCount {
|
|||||||
count!: number;
|
count!: number;
|
||||||
|
|
||||||
@Column('boolean', { default: false })
|
@Column('boolean', { default: false })
|
||||||
isPruned!: boolean
|
isPruned!: boolean;
|
||||||
}
|
}
|
||||||
|
@ -48,15 +48,15 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
|
|||||||
const KIND_ERC721 = 'ERC721';
|
const KIND_ERC721 = 'ERC721';
|
||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_ethProvider: BaseProvider
|
_ethProvider: BaseProvider;
|
||||||
_baseIndexer: BaseIndexer
|
_baseIndexer: BaseIndexer;
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
|
|
||||||
_abiMap: Map<string, JsonFragment[]>
|
_abiMap: Map<string, JsonFragment[]>;
|
||||||
_storageLayoutMap: Map<string, StorageLayout>
|
_storageLayoutMap: Map<string, StorageLayout>;
|
||||||
_contractMap: Map<string, ethers.utils.Interface>
|
_contractMap: Map<string, ethers.utils.Interface>;
|
||||||
|
|
||||||
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue) {
|
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": "off"
|
"@typescript-eslint/explicit-module-boundary-types": "off"
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ export class Foo {
|
|||||||
export const FooID = idof<Foo>();
|
export const FooID = idof<Foo>();
|
||||||
|
|
||||||
export class Bar {
|
export class Bar {
|
||||||
prop: string
|
prop: string;
|
||||||
|
|
||||||
constructor (prop: string) {
|
constructor (prop: string) {
|
||||||
this.prop = prop;
|
this.prop = prop;
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"chai-spies": "^1.0.0",
|
"chai-spies": "^1.0.0",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"mocha": "^8.4.0",
|
"mocha": "^8.4.0",
|
||||||
"nodemon": "^2.0.7",
|
"nodemon": "^2.0.7",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"compare-entity": "bin/compare-entity"
|
"compare-entity": "bin/compare-entity"
|
||||||
|
@ -50,7 +50,7 @@ export class GraphWatcher {
|
|||||||
_wasmRestartBlocksInterval: number;
|
_wasmRestartBlocksInterval: number;
|
||||||
_dataSources: any[] = [];
|
_dataSources: any[] = [];
|
||||||
_dataSourceMap: { [key: string]: DataSource } = {};
|
_dataSourceMap: { [key: string]: DataSource } = {};
|
||||||
_transactionsMap: Map<string, Transaction> = new Map()
|
_transactionsMap: Map<string, Transaction> = new Map();
|
||||||
|
|
||||||
_context: Context = {};
|
_context: Context = {};
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import { GetStorageAt, getStorageValue, MappingKey, StorageLayout } from '@cerc-
|
|||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_getStorageAt: GetStorageAt;
|
_getStorageAt: GetStorageAt;
|
||||||
_storageLayoutMap: Map<string, StorageLayout> = new Map()
|
_storageLayoutMap: Map<string, StorageLayout> = new Map();
|
||||||
|
|
||||||
constructor (ethClient: EthClient, storageLayoutMap?: Map<string, StorageLayout>) {
|
constructor (ethClient: EthClient, storageLayoutMap?: Map<string, StorageLayout>) {
|
||||||
this._getStorageAt = ethClient.getStorageAt.bind(ethClient);
|
this._getStorageAt = ethClient.getStorageAt.bind(ethClient);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -60,14 +60,14 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ export class Database implements DatabaseInterface {
|
|||||||
_config: ConnectionOptions;
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection;
|
_conn!: Connection;
|
||||||
_baseDatabase: BaseDatabase;
|
_baseDatabase: BaseDatabase;
|
||||||
_propColMaps: { [key: string]: Map<string, string>; }
|
_propColMaps: { [key: string]: Map<string, string>; };
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
@ -28,10 +28,10 @@ export class Blog {
|
|||||||
enum: BlogType,
|
enum: BlogType,
|
||||||
default: BlogType.short
|
default: BlogType.short
|
||||||
})
|
})
|
||||||
kind!: BlogType
|
kind!: BlogType;
|
||||||
|
|
||||||
@Column('boolean')
|
@Column('boolean')
|
||||||
isActive!: boolean
|
isActive!: boolean;
|
||||||
|
|
||||||
@Column('numeric', { transformer: bigintArrayTransformer, array: true })
|
@Column('numeric', { transformer: bigintArrayTransformer, array: true })
|
||||||
reviews!: bigint[];
|
reviews!: bigint[];
|
||||||
|
@ -55,21 +55,21 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
|
|||||||
const KIND_EXAMPLE1 = 'Example1';
|
const KIND_EXAMPLE1 = 'Example1';
|
||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_ethProvider: BaseProvider
|
_ethProvider: BaseProvider;
|
||||||
_baseIndexer: BaseIndexer
|
_baseIndexer: BaseIndexer;
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
_graphWatcher: GraphWatcher;
|
_graphWatcher: GraphWatcher;
|
||||||
|
|
||||||
_abiMap: Map<string, JsonFragment[]>
|
_abiMap: Map<string, JsonFragment[]>;
|
||||||
_storageLayoutMap: Map<string, StorageLayout>
|
_storageLayoutMap: Map<string, StorageLayout>;
|
||||||
_contractMap: Map<string, ethers.utils.Interface>
|
_contractMap: Map<string, ethers.utils.Interface>;
|
||||||
|
|
||||||
_entityTypesMap: Map<string, { [key: string]: string }>
|
_entityTypesMap: Map<string, { [key: string]: string }>;
|
||||||
_relationsMap: Map<any, { [key: string]: any }>
|
_relationsMap: Map<any, { [key: string]: any }>;
|
||||||
|
|
||||||
_subgraphStateMap: Map<string, any>
|
_subgraphStateMap: Map<string, any>;
|
||||||
|
|
||||||
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue, graphWatcher?: GraphWatcherInterface) {
|
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue, graphWatcher?: GraphWatcherInterface) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -34,10 +34,10 @@
|
|||||||
"@types/ws": "^8.5.3",
|
"@types/ws": "^8.5.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0"
|
"eslint-plugin-standard": "^5.0.0"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -61,14 +61,14 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ export class Database implements DatabaseInterface {
|
|||||||
_config: ConnectionOptions;
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection;
|
_conn!: Connection;
|
||||||
_baseDatabase: BaseDatabase;
|
_baseDatabase: BaseDatabase;
|
||||||
_propColMaps: { [key: string]: Map<string, string>; }
|
_propColMaps: { [key: string]: Map<string, string>; };
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
@ -53,15 +53,15 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
|
|||||||
export const KIND_PHISHERREGISTRY = 'PhisherRegistry';
|
export const KIND_PHISHERREGISTRY = 'PhisherRegistry';
|
||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_ethProvider: JsonRpcProvider
|
_ethProvider: JsonRpcProvider;
|
||||||
_baseIndexer: BaseIndexer
|
_baseIndexer: BaseIndexer;
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
|
|
||||||
_abiMap: Map<string, JsonFragment[]>
|
_abiMap: Map<string, JsonFragment[]>;
|
||||||
_storageLayoutMap: Map<string, StorageLayout>
|
_storageLayoutMap: Map<string, StorageLayout>;
|
||||||
_contractMap: Map<string, ethers.utils.Interface>
|
_contractMap: Map<string, ethers.utils.Interface>;
|
||||||
|
|
||||||
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: JsonRpcProvider, jobQueue: JobQueue) {
|
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: JsonRpcProvider, jobQueue: JobQueue) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -7,7 +7,6 @@ import { Config, DEFAULT_CONFIG_PATH, getConfig, initClients } from '@cerc-io/ut
|
|||||||
import {
|
import {
|
||||||
PeerInitConfig,
|
PeerInitConfig,
|
||||||
PeerIdObj
|
PeerIdObj
|
||||||
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1319854183
|
|
||||||
} from '@cerc-io/peer';
|
} from '@cerc-io/peer';
|
||||||
|
|
||||||
import { getCurrentTime, sendMessageToL2 } from './libp2p-utils';
|
import { getCurrentTime, sendMessageToL2 } from './libp2p-utils';
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
|
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
|
||||||
|
|
||||||
/* Module Resolution Options */
|
/* Module Resolution Options */
|
||||||
"moduleResolution": "Node16", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -58,14 +58,14 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ export class Database implements DatabaseInterface {
|
|||||||
_config: ConnectionOptions;
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection;
|
_conn!: Connection;
|
||||||
_baseDatabase: BaseDatabase;
|
_baseDatabase: BaseDatabase;
|
||||||
_propColMaps: { [key: string]: Map<string, string>; }
|
_propColMaps: { [key: string]: Map<string, string>; };
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
@ -53,15 +53,15 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
|
|||||||
export const KIND_PHISHERREGISTRY = 'PhisherRegistry';
|
export const KIND_PHISHERREGISTRY = 'PhisherRegistry';
|
||||||
|
|
||||||
export class Indexer implements IndexerInterface {
|
export class Indexer implements IndexerInterface {
|
||||||
_db: Database
|
_db: Database;
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_ethProvider: JsonRpcProvider
|
_ethProvider: JsonRpcProvider;
|
||||||
_baseIndexer: BaseIndexer
|
_baseIndexer: BaseIndexer;
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
|
|
||||||
_abiMap: Map<string, JsonFragment[]>
|
_abiMap: Map<string, JsonFragment[]>;
|
||||||
_storageLayoutMap: Map<string, StorageLayout>
|
_storageLayoutMap: Map<string, StorageLayout>;
|
||||||
_contractMap: Map<string, ethers.utils.Interface>
|
_contractMap: Map<string, ethers.utils.Interface>;
|
||||||
|
|
||||||
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: JsonRpcProvider, jobQueue: JobQueue) {
|
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: JsonRpcProvider, jobQueue: JobQueue) {
|
||||||
assert(db);
|
assert(db);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off"
|
"@typescript-eslint/no-explicit-any": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"exports": "./dist/index.js",
|
"exports": "./dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "AGPL-version-3.0",
|
"license": "AGPL-3.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.16",
|
"node": ">=14.16",
|
||||||
@ -58,13 +58,13 @@
|
|||||||
"@types/node": "16.11.7",
|
"@types/node": "16.11.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
"typescript": "^4.9.4"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ export class PeerHearbeatChecker {
|
|||||||
_node: Libp2p;
|
_node: Libp2p;
|
||||||
_pingInterval: number;
|
_pingInterval: number;
|
||||||
_pingTimeout: number;
|
_pingTimeout: number;
|
||||||
_peerMap: Map<string, PeerData> = new Map()
|
_peerMap: Map<string, PeerData> = new Map();
|
||||||
|
|
||||||
constructor (node: Libp2p, options: Partial<PeerHearbeatCheckerOptions> = {}) {
|
constructor (node: Libp2p, options: Partial<PeerHearbeatCheckerOptions> = {}) {
|
||||||
this._node = node;
|
this._node = node;
|
||||||
|
@ -69,22 +69,22 @@ export interface PeerInitConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Peer {
|
export class Peer {
|
||||||
_node?: Libp2p
|
_node?: Libp2p;
|
||||||
_peerHeartbeatChecker?: PeerHearbeatChecker
|
_peerHeartbeatChecker?: PeerHearbeatChecker;
|
||||||
_webRTCSignallingEnabled: boolean
|
_webRTCSignallingEnabled: boolean;
|
||||||
|
|
||||||
_relayNodeMultiaddr: Multiaddr
|
_relayNodeMultiaddr: Multiaddr;
|
||||||
_numRelayConnections = 0
|
_numRelayConnections = 0;
|
||||||
|
|
||||||
_relayRedialInterval?: number
|
_relayRedialInterval?: number;
|
||||||
_maxRelayConnections?: number
|
_maxRelayConnections?: number;
|
||||||
|
|
||||||
_debugInfoEnabled?: boolean
|
_debugInfoEnabled?: boolean;
|
||||||
|
|
||||||
_peerStreamMap: Map<string, Pushable<any>> = new Map()
|
_peerStreamMap: Map<string, Pushable<any>> = new Map();
|
||||||
_messageHandlers: Array<(peerId: PeerId, message: any) => void> = []
|
_messageHandlers: Array<(peerId: PeerId, message: any) => void> = [];
|
||||||
_topicHandlers: Map<string, Array<(peerId: PeerId, data: any) => void>> = new Map()
|
_topicHandlers: Map<string, Array<(peerId: PeerId, data: any) => void>> = new Map();
|
||||||
_metrics = new PrometheusMetrics()
|
_metrics = new PrometheusMetrics();
|
||||||
|
|
||||||
constructor (relayNodeURL: string, nodejs?: boolean) {
|
constructor (relayNodeURL: string, nodejs?: boolean) {
|
||||||
this._webRTCSignallingEnabled = !(nodejs === true);
|
this._webRTCSignallingEnabled = !(nodejs === true);
|
||||||
|
@ -16,5 +16,6 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,10 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
"hardhat": "^2.3.0",
|
"hardhat": "^2.3.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off"
|
"@typescript-eslint/no-explicit-any": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
"@types/mocha": "^8.2.2",
|
"@types/mocha": "^8.2.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
"typescript": "^4.3.2"
|
"typescript": "^5.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0"
|
"eslint-plugin-standard": "^5.0.0"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"indent": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
"@typescript-eslint/explicit-module-boundary-types": [
|
||||||
"warn",
|
"warn",
|
||||||
|
@ -48,10 +48,10 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||||
"@typescript-eslint/parser": "^5.47.1",
|
"@typescript-eslint/parser": "^5.47.1",
|
||||||
"decimal.js": "^10.3.1",
|
"decimal.js": "^10.3.1",
|
||||||
"eslint": "^7.27.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-semistandard": "^15.0.1",
|
"eslint-config-semistandard": "^15.0.1",
|
||||||
"eslint-config-standard": "^16.0.3",
|
"eslint-config-standard": "^16.0.3",
|
||||||
"eslint-plugin-import": "^2.23.3",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-promise": "^5.1.0",
|
"eslint-plugin-promise": "^5.1.0",
|
||||||
"eslint-plugin-standard": "^5.0.0",
|
"eslint-plugin-standard": "^5.0.0",
|
||||||
|
@ -68,9 +68,9 @@ export interface Where {
|
|||||||
export type Relation = string | { property: string, alias: string }
|
export type Relation = string | { property: string, alias: string }
|
||||||
|
|
||||||
export class Database {
|
export class Database {
|
||||||
_config: ConnectionOptions
|
_config: ConnectionOptions;
|
||||||
_conn!: Connection
|
_conn!: Connection;
|
||||||
_pgPool: Pool
|
_pgPool: Pool;
|
||||||
|
|
||||||
constructor (config: ConnectionOptions) {
|
constructor (config: ConnectionOptions) {
|
||||||
assert(config);
|
assert(config);
|
||||||
|
@ -21,13 +21,13 @@ const log = debug('vulcanize:events');
|
|||||||
export const BlockProgressEvent = 'block-progress-event';
|
export const BlockProgressEvent = 'block-progress-event';
|
||||||
|
|
||||||
export class EventWatcher {
|
export class EventWatcher {
|
||||||
_ethClient: EthClient
|
_ethClient: EthClient;
|
||||||
_indexer: IndexerInterface
|
_indexer: IndexerInterface;
|
||||||
_pubsub: PubSub
|
_pubsub: PubSub;
|
||||||
_jobQueue: JobQueue
|
_jobQueue: JobQueue;
|
||||||
|
|
||||||
_shutDown = false
|
_shutDown = false;
|
||||||
_signalCount = 0
|
_signalCount = 0;
|
||||||
|
|
||||||
constructor (ethClient: EthClient, indexer: IndexerInterface, pubsub: PubSub, jobQueue: JobQueue) {
|
constructor (ethClient: EthClient, indexer: IndexerInterface, pubsub: PubSub, jobQueue: JobQueue) {
|
||||||
this._ethClient = ethClient;
|
this._ethClient = ethClient;
|
||||||
|
@ -54,16 +54,16 @@ interface CachedEntities {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class GraphDatabase {
|
export class GraphDatabase {
|
||||||
_serverConfig: ServerConfig
|
_serverConfig: ServerConfig;
|
||||||
_conn!: Connection
|
_conn!: Connection;
|
||||||
_baseDatabase: BaseDatabase
|
_baseDatabase: BaseDatabase;
|
||||||
_entityQueryTypeMap: Map<new() => any, ENTITY_QUERY_TYPE>
|
_entityQueryTypeMap: Map<new() => any, ENTITY_QUERY_TYPE>;
|
||||||
_entityToLatestEntityMap: Map<new () => any, new () => any> = new Map()
|
_entityToLatestEntityMap: Map<new () => any, new () => any> = new Map();
|
||||||
|
|
||||||
_cachedEntities: CachedEntities = {
|
_cachedEntities: CachedEntities = {
|
||||||
frothyBlocks: new Map(),
|
frothyBlocks: new Map(),
|
||||||
latestPrunedEntities: new Map()
|
latestPrunedEntities: new Map()
|
||||||
}
|
};
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
serverConfig: ServerConfig,
|
serverConfig: ServerConfig,
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import { create, IPFSHTTPClient } from 'ipfs-http-client';
|
import { create, IPFSHTTPClient } from 'ipfs-http-client';
|
||||||
|
|
||||||
export class IPFSClient {
|
export class IPFSClient {
|
||||||
_client: IPFSHTTPClient
|
_client: IPFSHTTPClient;
|
||||||
|
|
||||||
constructor (url: string) {
|
constructor (url: string) {
|
||||||
this._client = create({ url });
|
this._client = create({ url });
|
||||||
|
@ -34,15 +34,15 @@ import { lastBlockNumEvents, lastBlockProcessDuration, lastProcessedBlockNumber
|
|||||||
const log = debug('vulcanize:job-runner');
|
const log = debug('vulcanize:job-runner');
|
||||||
|
|
||||||
export class JobRunner {
|
export class JobRunner {
|
||||||
jobQueue: JobQueue
|
jobQueue: JobQueue;
|
||||||
_indexer: IndexerInterface
|
_indexer: IndexerInterface;
|
||||||
_jobQueueConfig: JobQueueConfig
|
_jobQueueConfig: JobQueueConfig;
|
||||||
_blockProcessStartTime?: Date
|
_blockProcessStartTime?: Date;
|
||||||
_endBlockProcessTimer?: () => void
|
_endBlockProcessTimer?: () => void;
|
||||||
_blockAndEventsMap: Map<string, PrefetchedBlock> = new Map()
|
_blockAndEventsMap: Map<string, PrefetchedBlock> = new Map();
|
||||||
|
|
||||||
_shutDown = false
|
_shutDown = false;
|
||||||
_signalCount = 0
|
_signalCount = 0;
|
||||||
|
|
||||||
constructor (jobQueueConfig: JobQueueConfig, indexer: IndexerInterface, jobQueue: JobQueue) {
|
constructor (jobQueueConfig: JobQueueConfig, indexer: IndexerInterface, jobQueue: JobQueue) {
|
||||||
this._indexer = indexer;
|
this._indexer = indexer;
|
||||||
|
Loading…
Reference in New Issue
Block a user