Skip to content

Commit

Permalink
Regenerate watchers for updated GQL query metrics (#47)
Browse files Browse the repository at this point in the history
* Regenerate azimuth watcher

* Regenerate censures watcher

* Regenerate claims watcher

* Regenerate conditional-star-release watcher

* Regenerate delegated-sending watcher

* Regenerate ecliptic watcher

* Regenerate linear-star-release watcher

* Regenerate polls watcher

* Update README

* Update package versions

* Update watcher repo URLs
  • Loading branch information
prathamesh0 authored Jun 7, 2024
1 parent 4a3c0a2 commit 14fd03d
Show file tree
Hide file tree
Showing 52 changed files with 2,210 additions and 885 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Steps to generate Azimuth watchers using the code generator ([`@cerc-io/codegen`
flatten: true
```
Note: Create `.sol` files with the contract code from Etherscan for [`DelegatedSending`](https://etherscan.io/address/0xf6b461fe1ad4bd2ce25b23fe0aff2ac19b3dfa76#code) and [`Ecliptic`](https://etherscan.io/address/ecliptic.eth#code) contracts and use the file path for `contracts.path`
Note: Create `.sol` files with the contract code from Etherscan for [`ConditionalStarRelease`](https://etherscan.io/address/0x8C241098C3D3498Fe1261421633FD57986D74AeA#code), [`DelegatedSending`](https://etherscan.io/address/0xf6b461fe1ad4bd2ce25b23fe0aff2ac19b3dfa76#code), [`Ecliptic`](https://etherscan.io/address/ecliptic.eth#code) and [`LinearStarRelease`](https://etherscan.io/address/0x86cd9cd0992F04231751E3761De45cEceA5d1801#code) contracts and use the file path for `contracts.path`

* Run codegen command to generate the watcher:

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"packages/*"
],
"useWorkspaces": true,
"version": "0.1.5",
"version": "0.1.6",
"npmClient": "yarn"
}
2 changes: 2 additions & 0 deletions packages/azimuth-watcher/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ out/

.vscode
.idea

gql-logs/
2 changes: 1 addition & 1 deletion packages/azimuth-watcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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.

Expand Down
30 changes: 18 additions & 12 deletions packages/azimuth-watcher/environments/local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
host = "127.0.0.1"
port = 3001
kind = "active"
gqlPath = "/graphql"

# Checkpointing state.
checkpointing = true
Expand All @@ -14,22 +13,29 @@
# CAUTION: Disable only if state creation is not desired or can be filled subsequently
enableState = false

# 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

# GQL cache settings
[server.gqlCache]
enabled = true
# 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

# Log directory for GQL requests
logDir = "./gql-logs"

# GQL cache settings
[server.gql.cache]
enabled = true

# Max in-memory cache size (in bytes) (default 8 MB)
# maxCacheSize
# Max in-memory cache size (in bytes) (default 8 MB)
# maxCacheSize

# GQL cache-control max-age settings (in seconds)
maxAge = 15
# GQL cache-control max-age settings (in seconds)
maxAge = 15

[metrics]
host = "127.0.0.1"
Expand Down
16 changes: 9 additions & 7 deletions packages/azimuth-watcher/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/azimuth-watcher",
"version": "0.1.5",
"version": "0.1.6",
"description": "azimuth-watcher",
"private": true,
"main": "dist/index.js",
Expand Down Expand Up @@ -28,7 +28,8 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/cerc-io/watcher-ts.git"
"url": "https://github.com/cerc-io/azimuth-watcher-ts",
"directory": "packages/azimuth-watcher"
},
"author": "",
"license": "AGPL-3.0",
Expand All @@ -38,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.92",
"@cerc-io/ipld-eth-client": "^0.2.92",
"@cerc-io/solidity-mapper": "^0.2.92",
"@cerc-io/util": "^0.2.92",
"@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",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
Expand Down Expand Up @@ -69,6 +70,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"
}
}
2 changes: 1 addition & 1 deletion packages/azimuth-watcher/src/indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,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> {
Expand Down
Loading

0 comments on commit 14fd03d

Please sign in to comment.