Compare commits

..
6 Commits
Author SHA1 Message Date
prathamesh 701dce23db Upgrade watcher-ts packages to export metrics on ETH RPC requests (#8)
Part of [Regenerate ajna watcher with updated subgraph config
](https://www.notion.so/Regenerate-ajna-watcher-with-updated-subgraph-config-c9bbecb033024c13a7515c7f1efc3363)

Reviewed-on: #8
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-05-15 13:48:07 +00:00
prathamesh 10156ae4a3 Regenerate watcher with updated subgraph and latest codegen (#7)
Part of [Regenerate ajna watcher with updated subgraph config
](https://www.notion.so/Regenerate-ajna-watcher-with-updated-subgraph-config-c9bbecb033024c13a7515c7f1efc3363)

Reviewed-on: #7
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-05-14 08:02:34 +00:00
nabarun b5a3556319 Upgrade watcher-ts packages to configure failover RPC endpoints (#6)
Part of [Ability to configure watchers with multiple RPC endpoints](https://www.notion.so/Ability-to-configure-watchers-with-multiple-RPC-endpoints-dc8d3ff4d647404ab718dfd5a4c9035c)

Reviewed-on: #6
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-05-09 11:02:05 +00:00
nabarun 66b8d96308 Upgrade watcher-ts package versions to fix eth_getLogs address filter (#5)
Part of [Investigate subgraph watchers lagging behind head](https://www.notion.so/Investigate-subgraph-watchers-lagging-behind-head-01b72294ca8e4f658e4c0e86b36d19e2)

Reviewed-on: #5
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-05-03 13:55:24 +00:00
prathamesh 0ee18d3c50 Upgrade watcher-ts packages for improving eth_getLogs calls in FEVM (#4)
Part of [Investigate subgraph watchers lagging behind head](https://www.notion.so/Investigate-subgraph-watchers-lagging-behind-head-01b72294ca8e4f658e4c0e86b36d19e2)

Reviewed-on: #4
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-05-02 11:13:16 +00:00
prathamesh 5a1728c371 Add codegen config used to generate the watcher (#3)
Part of [Generate ajna-finance subgraph watcher with codegen](https://www.notion.so/Generate-ajna-finance-subgraph-watcher-with-codegen-5b80ac149b3f449fb138f5d92cc5485e)

Reviewed-on: #3
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-04-18 11:07:08 +00:00
14 changed files with 107 additions and 56 deletions
+4
View File
@@ -1,5 +1,9 @@
# ajna-watcher-ts
## Source
* Subgraph: [ajna-subgraph v0.1.1](https://github.com/cerc-io/ajna-subgraph/releases/tag/v0.1.1)
## Setup
* Run the following command to install required packages:
+35
View File
@@ -0,0 +1,35 @@
# Contracts to watch (required).
# Can pass empty array ([]) when using subgraphPath.
contracts: []
# Output folder path (logs output using `stdout` if not provided).
outputFolder: /home/user/cerc-io/ajna-watcher-ts
# Code generation mode [eth_call | storage | all | none] (default: none).
mode: none
# Kind of watcher [lazy | active] (default: active).
kind: active
# Watcher server port (default: 3008).
port: 3008
# Flatten the input contract file(s) [true | false] (default: true).
flatten: true
# Config for subgraph
subgraph:
# Path to subgraph repo directory containing package.json
directory: /home/user/cerc-io/ajna-subgraph
# Package manager that is used in subgraph repo for dependencies
packageManager: yarn
# Path to subgraph manifest/config file
configFile: /home/user/cerc-io/ajna-subgraph/subgraph.yaml
# Networks config file path used when building subgraph (optional)
networkFilePath: /home/user/cerc-io/ajna-subgraph/networks.json
# Network configuration to use from the networks config file (optional)
network: filecoin
+8 -3
View File
@@ -58,7 +58,9 @@
[upstream]
[upstream.ethServer]
rpcProviderEndpoint = "http://127.0.0.1:8081"
rpcProviderEndpoints = [
"http://127.0.0.1:8081"
]
# Boolean flag to specify if rpc-eth-client should be used for RPC endpoint instead of ipld-eth-client (ipld-eth-server GQL client)
rpcClient = true
@@ -67,9 +69,9 @@
isFEVM = true
# Boolean flag to filter event logs by contracts
filterLogsByAddresses = true
filterLogsByAddresses = false
# Boolean flag to filter event logs by topics
filterLogsByTopics = true
filterLogsByTopics = false
[upstream.cache]
name = "requests"
@@ -95,3 +97,6 @@
# Max block range of historical processing after which it waits for completion of events processing
# If set to -1 historical processing does not wait for events processing and completes till latest canonical block
historicalMaxFetchAhead = 10000
# Max number of retries to fetch new block after which watcher will failover to other RPC endpoints
maxNewBlockRetries = 3
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/ajna-watcher-ts",
"version": "0.1.1",
"version": "0.1.6",
"description": "ajna-watcher-ts",
"private": true,
"main": "dist/index.js",
@@ -39,11 +39,11 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.83",
"@cerc-io/ipld-eth-client": "^0.2.83",
"@cerc-io/solidity-mapper": "^0.2.83",
"@cerc-io/util": "^0.2.83",
"@cerc-io/graph-node": "^0.2.83",
"@cerc-io/cli": "^0.2.87",
"@cerc-io/ipld-eth-client": "^0.2.87",
"@cerc-io/solidity-mapper": "^0.2.87",
"@cerc-io/util": "^0.2.87",
"@cerc-io/graph-node": "^0.2.87",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
+7
View File
@@ -326,6 +326,13 @@ export class Indexer implements IndexerInterface {
await this._baseIndexer.fetchStateStatus();
}
switchClients ({ ethClient, ethProvider }: { ethClient: EthClient, ethProvider: BaseProvider }): void {
this._ethClient = ethClient;
this._ethProvider = ethProvider;
this._baseIndexer.switchClients({ ethClient, ethProvider });
this._graphWatcher.switchClients({ ethClient, ethProvider });
}
async getMetaData (block: BlockHeight): Promise<ResultMeta | null> {
return this._baseIndexer.getMetaData(block);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+47 -47
View File
@@ -176,10 +176,10 @@
binaryen "101.0.0-nightly.20210723"
long "^4.0.0"
"@cerc-io/cache@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.83/cache-0.2.83.tgz#2802fe7a360990c8f5d14f5a76112d1085e52f81"
integrity sha512-JGUmhs6dbYIYZPDJ6LPTU+TcV3+/AqMQnczZB8n/E6ccHheb9LcIlVJZYylEfN8+hpgukd1p2ihXSGqkFj7HRw==
"@cerc-io/cache@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.87/cache-0.2.87.tgz#168818a315b3906fd0dd0927963eb7071eb6877f"
integrity sha512-fmRTmvO0cMfqCe+B0ZzUU2577J3yeSrUtKJuMMYTtyOp8Tx9lYyNfYU0rMhYY1LkkENwdg2iYsxVfF3g1VjwSA==
dependencies:
canonical-json "^0.0.4"
debug "^4.3.1"
@@ -187,19 +187,19 @@
fs-extra "^10.0.0"
level "^7.0.0"
"@cerc-io/cli@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.83/cli-0.2.83.tgz#827694470b87c0b7c3604e020803ac88102aefa8"
integrity sha512-1lU4bzE9Oej+dtoOvClNq52jGhIJorfGLaBAQAd52Jar7wAspZVBI9zFteVKjJiCaVLsLpeZLqyBp4KA6ZeQ1g==
"@cerc-io/cli@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.87/cli-0.2.87.tgz#b06e9fff06fd4885aad909a715b61c0534251211"
integrity sha512-d4qucagLfVaGRUVYOoLoYwJ7shmH1hDYS9e7rFwiSZ1S75jWs/FABRFePwUgiWxemUJkBP5hwkrbhtAyAf9pzQ==
dependencies:
"@apollo/client" "^3.7.1"
"@cerc-io/cache" "^0.2.83"
"@cerc-io/ipld-eth-client" "^0.2.83"
"@cerc-io/cache" "^0.2.87"
"@cerc-io/ipld-eth-client" "^0.2.87"
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
"@cerc-io/nitro-node" "^0.1.15"
"@cerc-io/peer" "^0.2.83"
"@cerc-io/rpc-eth-client" "^0.2.83"
"@cerc-io/util" "^0.2.83"
"@cerc-io/peer" "^0.2.87"
"@cerc-io/rpc-eth-client" "^0.2.87"
"@cerc-io/util" "^0.2.87"
"@ethersproject/providers" "^5.4.4"
"@graphql-tools/utils" "^9.1.1"
"@ipld/dag-cbor" "^8.0.0"
@@ -220,16 +220,16 @@
typeorm "0.2.37"
yargs "^17.0.1"
"@cerc-io/graph-node@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fgraph-node/-/0.2.83/graph-node-0.2.83.tgz#79d0d684724825d675db84df78e4a3c3b2d0a581"
integrity sha512-UxFoK7DpIBOYdKY6TFAGi9SgK1gET/xAgdIKhQ7+d+QYDdMZYoEfCK0TDkAhzoarX5B/gYQ8gwbM8RQ1h4QMlA==
"@cerc-io/graph-node@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fgraph-node/-/0.2.87/graph-node-0.2.87.tgz#6dfe4938cbaeb6fb5316dbc4ae1f5257eb3b9a19"
integrity sha512-Tp3Wko5IQxjVn9nRn4ucFT1UEp/DQGtSwryh+zdpamx6TtvFnj8QPOhFlowKXKLVWA39Oa2T+a45jlboL6GL/g==
dependencies:
"@apollo/client" "^3.3.19"
"@cerc-io/assemblyscript" "0.19.10-watcher-ts-0.1.2"
"@cerc-io/cache" "^0.2.83"
"@cerc-io/ipld-eth-client" "^0.2.83"
"@cerc-io/util" "^0.2.83"
"@cerc-io/cache" "^0.2.87"
"@cerc-io/ipld-eth-client" "^0.2.87"
"@cerc-io/util" "^0.2.87"
"@types/json-diff" "^0.5.2"
"@types/yargs" "^17.0.0"
bn.js "^4.11.9"
@@ -246,14 +246,14 @@
typeorm-naming-strategies "^2.0.0"
yargs "^17.0.1"
"@cerc-io/ipld-eth-client@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.83/ipld-eth-client-0.2.83.tgz#8aeb35c17b4695a14316640c0b755e3f63ca5df7"
integrity sha512-H/H0kfwOc3CiMDRk6Axx7rhorqUlLTVEIO3NIOYlrg6mqm7dPSg5LulTBK8pLamwmtjpKpAXp7WB/mOCLUX2Kg==
"@cerc-io/ipld-eth-client@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.87/ipld-eth-client-0.2.87.tgz#8badead87a2a52a7e5a7d86eec08e313038580d4"
integrity sha512-3mD0+79sHZNhLemkPKzZxWnGTSWlQoFmxl1YoUeh05tYdyonD6M20DBLiCTlTiF0WnO47q910R074kGRa4NZGQ==
dependencies:
"@apollo/client" "^3.7.1"
"@cerc-io/cache" "^0.2.83"
"@cerc-io/util" "^0.2.83"
"@cerc-io/cache" "^0.2.87"
"@cerc-io/util" "^0.2.87"
cross-fetch "^3.1.4"
debug "^4.3.1"
ethers "^5.4.4"
@@ -406,10 +406,10 @@
unique-names-generator "^4.7.1"
yargs "^17.0.1"
"@cerc-io/peer@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.83/peer-0.2.83.tgz#128d3243ec6a7d1f7272b1d45978bf76de66591b"
integrity sha512-q6XRfJkxwT7k45Kayz1JKP7mtUH5I63vNhejwxTAfmM/puLOpbgVKSay6UfQHuSSniIQSMRrWOy3OQmJXNvMEQ==
"@cerc-io/peer@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.87/peer-0.2.87.tgz#9f9616b1b4c9b266020bb994d60ed1c27eaabffd"
integrity sha512-/iqqfksHo6z24DmU8WUNCYypPBhKlx0q+AhMJ/U9xXMjVgwuD9lnq55vctLQICN0s8FQ5mKe2XmRm8KrzFk7oQ==
dependencies:
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
"@cerc-io/prometheus-metrics" "1.1.4"
@@ -448,23 +448,23 @@
it-stream-types "^1.0.4"
promjs "^0.4.2"
"@cerc-io/rpc-eth-client@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Frpc-eth-client/-/0.2.83/rpc-eth-client-0.2.83.tgz#ee49baef3a3f0c142de7320e4e2ee12998c6d142"
integrity sha512-lVInLT3dERd4y+Mmb4ocjRsDSjvkjypC7+lo0ytn5k+d+wogIv2BsZd+ZI1PKTN1TUwqnPy0m815Egn5/PMvsQ==
"@cerc-io/rpc-eth-client@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Frpc-eth-client/-/0.2.87/rpc-eth-client-0.2.87.tgz#01d3a93dc3ad4a77195b62be987149b8bdac903b"
integrity sha512-XvMRlFZL+RAoINXT6/UjcJYwBwFk7srgOYRf45onoeZMWEIbBXFzdqNXJbdCO3LyVpRKliXzipIfQpl5Y/5/fA==
dependencies:
"@cerc-io/cache" "^0.2.83"
"@cerc-io/ipld-eth-client" "^0.2.83"
"@cerc-io/util" "^0.2.83"
"@cerc-io/cache" "^0.2.87"
"@cerc-io/ipld-eth-client" "^0.2.87"
"@cerc-io/util" "^0.2.87"
chai "^4.3.4"
ethers "^5.4.4"
left-pad "^1.3.0"
mocha "^8.4.0"
"@cerc-io/solidity-mapper@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.83/solidity-mapper-0.2.83.tgz#f3a732696e72604e58444723229bf0da78f925e3"
integrity sha512-3U6MJejvvUWzpbnsOTdKciKapSxzF0BuwlSrwaXJQKskbS5dIV2Jk1bsfogCokc86PrBxjusV4UNh8HohHbbmA==
"@cerc-io/solidity-mapper@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.87/solidity-mapper-0.2.87.tgz#94836c0075bb978eb3a59522e40b04a3adf35642"
integrity sha512-4lp0wBPOUskFnt/wM17NBfcQdzy/00/637VGx9aiaeBG0MjeGHuBmop/47PXxW30e/Ld95H0DkyLtRvFUhKPxQ==
dependencies:
dotenv "^10.0.0"
@@ -473,15 +473,15 @@
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fts-channel/-/1.0.3-ts-nitro-0.1.1/ts-channel-1.0.3-ts-nitro-0.1.1.tgz#0768781313a167295c0bf21307f47e02dc17e936"
integrity sha512-2jFICUSyffuZ+8+qRhXuLSJq4GJ6Y02wxiXoubH0Kzv2lIKkJtWICY1ZQQhtXAvP0ncAQB85WJHqtqwH8l7J3Q==
"@cerc-io/util@^0.2.83":
version "0.2.83"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.83/util-0.2.83.tgz#747813a51569dee7465ed1bfb4ac3d4ecdf99eb4"
integrity sha512-6ZqIH1pUq1MWDXf2psXJvKhAWojtXWGFwXCHxF7pi68IjMqMQxXVpk/eZzympBsWQhzvl6IPH8JShJTTxK5ybQ==
"@cerc-io/util@^0.2.87":
version "0.2.87"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.87/util-0.2.87.tgz#a4bec8f1d13eb0215c255a2d0f0f27606eeb4334"
integrity sha512-2vW70xD/tDzaLcEr8565wjAwGEDJ8zZq1P5kxvDuOavT6SN5xJVTlFS+tcaA4G23s9s5B9xkKlnzRyxL4CsRtg==
dependencies:
"@apollo/utils.keyvaluecache" "^1.0.1"
"@cerc-io/nitro-node" "^0.1.15"
"@cerc-io/peer" "^0.2.83"
"@cerc-io/solidity-mapper" "^0.2.83"
"@cerc-io/peer" "^0.2.87"
"@cerc-io/solidity-mapper" "^0.2.87"
"@cerc-io/ts-channel" "1.0.3-ts-nitro-0.1.1"
"@ethersproject/properties" "^5.7.0"
"@ethersproject/providers" "^5.4.4"