Regenerate watcher for updated GQL query metrics #15

Merged
ashwin merged 3 commits from pm-regenerate-watcher into main 2024-06-07 04:20:12 +00:00
6 changed files with 1580 additions and 933 deletions
Showing only changes of commit 6e8208a92a - Show all commits

2
.gitignore vendored
View File

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

View File

@ -67,7 +67,7 @@
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.

View File

@ -2,7 +2,6 @@
host = "127.0.0.1"
port = 3008
kind = "active"
gqlPath = "/graphql"
# Checkpointing state.
checkpointing = true
@ -22,15 +21,22 @@
# Interval in number of blocks at which to clear entities cache.
clearEntitiesCacheInterval = 1000
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
rpcSupportsBlockHashParam = false
# Server GQL config
[server.gql]
path = "/graphql"
# 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
rpcSupportsBlockHashParam = false
# Log directory for GQL requests
logDir = "./gql-logs"
# GQL cache settings
[server.gqlCache]
[server.gql.cache]
enabled = true
# Max in-memory cache size (in bytes) (default 8 MB)

View File

@ -39,11 +39,11 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.93",
"@cerc-io/ipld-eth-client": "^0.2.93",
"@cerc-io/solidity-mapper": "^0.2.93",
"@cerc-io/util": "^0.2.93",
"@cerc-io/graph-node": "^0.2.93",
"@cerc-io/cli": "^0.2.94",
"@cerc-io/ipld-eth-client": "^0.2.94",
"@cerc-io/solidity-mapper": "^0.2.94",
"@cerc-io/util": "^0.2.94",
"@cerc-io/graph-node": "^0.2.94",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
@ -71,6 +71,7 @@
"eslint-plugin-standard": "^5.0.0",
"husky": "^7.0.2",
"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>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.maxEventsBlockRange);
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {

File diff suppressed because it is too large Load Diff