Regenerate watcher with latest codegen

This commit is contained in:
Prathamesh Musale 2024-06-06 19:15:52 +05:30
parent a3df323639
commit 6e8208a92a
6 changed files with 1580 additions and 933 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ out/
.vscode .vscode
.idea .idea
gql-logs/

View File

@ -67,7 +67,7 @@
To enable GQL requests caching: To enable GQL requests caching:
* Update the `server.gqlCache` config with required settings. * Update the `server.gql.cache` config with required settings.
* In the GQL [schema file](./src/schema.gql), use the `cacheControl` directive to apply cache hints at schema level. * In the GQL [schema file](./src/schema.gql), use the `cacheControl` directive to apply cache hints at schema level.

View File

@ -2,7 +2,6 @@
host = "127.0.0.1" host = "127.0.0.1"
port = 3008 port = 3008
kind = "active" kind = "active"
gqlPath = "/graphql"
# Checkpointing state. # Checkpointing state.
checkpointing = true checkpointing = true
@ -22,23 +21,30 @@
# Interval in number of blocks at which to clear entities cache. # Interval in number of blocks at which to clear entities cache.
clearEntitiesCacheInterval = 1000 clearEntitiesCacheInterval = 1000
# Max block range for which to return events in eventsInRange GQL query.
# Use -1 for skipping check on block range.
maxEventsBlockRange = 1000
# Flag to specify whether RPC endpoint supports block hash as block tag parameter # Flag to specify whether RPC endpoint supports block hash as block tag parameter
rpcSupportsBlockHashParam = false rpcSupportsBlockHashParam = false
# GQL cache settings # Server GQL config
[server.gqlCache] [server.gql]
enabled = true path = "/graphql"
# Max in-memory cache size (in bytes) (default 8 MB) # Max block range for which to return events in eventsInRange GQL query.
# maxCacheSize # Use -1 for skipping check on block range.
maxEventsBlockRange = 1000
# GQL cache-control max-age settings (in seconds) # Log directory for GQL requests
maxAge = 15 logDir = "./gql-logs"
timeTravelMaxAge = 86400 # 1 day
# GQL cache settings
[server.gql.cache]
enabled = true
# Max in-memory cache size (in bytes) (default 8 MB)
# maxCacheSize
# GQL cache-control max-age settings (in seconds)
maxAge = 15
timeTravelMaxAge = 86400 # 1 day
[metrics] [metrics]
host = "127.0.0.1" host = "127.0.0.1"

View File

@ -39,11 +39,11 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme", "homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": { "dependencies": {
"@apollo/client": "^3.3.19", "@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.93", "@cerc-io/cli": "^0.2.94",
"@cerc-io/ipld-eth-client": "^0.2.93", "@cerc-io/ipld-eth-client": "^0.2.94",
"@cerc-io/solidity-mapper": "^0.2.93", "@cerc-io/solidity-mapper": "^0.2.94",
"@cerc-io/util": "^0.2.93", "@cerc-io/util": "^0.2.94",
"@cerc-io/graph-node": "^0.2.93", "@cerc-io/graph-node": "^0.2.94",
"@ethersproject/providers": "^5.4.4", "@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1", "debug": "^4.3.1",
"decimal.js": "^10.3.1", "decimal.js": "^10.3.1",
@ -71,6 +71,7 @@
"eslint-plugin-standard": "^5.0.0", "eslint-plugin-standard": "^5.0.0",
"husky": "^7.0.2", "husky": "^7.0.2",
"ts-node": "^10.2.1", "ts-node": "^10.2.1",
"typescript": "^5.0.2" "typescript": "^5.0.2",
"winston": "^3.13.0"
} }
} }

View File

@ -657,7 +657,7 @@ export class Indexer implements IndexerInterface {
} }
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> { async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.maxEventsBlockRange); return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
} }
async getSyncStatus (): Promise<SyncStatus | undefined> { async getSyncStatus (): Promise<SyncStatus | undefined> {

File diff suppressed because it is too large Load Diff