diff --git a/packages/blocks-watcher/.gitignore b/packages/blocks-watcher/.gitignore index 1c88d0a..549d70b 100644 --- a/packages/blocks-watcher/.gitignore +++ b/packages/blocks-watcher/.gitignore @@ -1,7 +1,8 @@ node_modules/ dist/ out/ -gql-logs/ .vscode .idea + +gql-logs/ diff --git a/packages/blocks-watcher/.husky/pre-commit b/packages/blocks-watcher/.husky/pre-commit old mode 100644 new mode 100755 diff --git a/packages/blocks-watcher/README.md b/packages/blocks-watcher/README.md index fe2d550..095ecb1 100644 --- a/packages/blocks-watcher/README.md +++ b/packages/blocks-watcher/README.md @@ -2,7 +2,8 @@ ## Source -* Subgraph: [sushiswap-subgraphs release-v0.1.0-watcher](https://github.com/cerc-io/sushiswap-subgraphs/releases/tag/v0.1.0-watcher) +* Subgraph: [sushiswap-subgraphs v0.1.0-watcher-0.1.0](https://github.com/cerc-io/sushiswap-subgraphs/releases/tag/v0.1.0-watcher-0.1.0) + * Package: [subgraphs/blocks](https://github.com/cerc-io/sushiswap-subgraphs/tree/v0.1.0-watcher-0.1.0/subgraphs/blocks) ## Setup diff --git a/packages/blocks-watcher/environments/local.toml b/packages/blocks-watcher/environments/local.toml index 2f2b3c2..0dfb296 100644 --- a/packages/blocks-watcher/environments/local.toml +++ b/packages/blocks-watcher/environments/local.toml @@ -64,7 +64,6 @@ [upstream] [upstream.ethServer] - gqlApiEndpoint = "http://127.0.0.1:8082/graphql" rpcProviderEndpoints = [ "http://127.0.0.1:8081" ] @@ -93,6 +92,9 @@ subgraphEventsOrder = true blockDelayInMilliSecs = 2000 + # Number of blocks by which block processing lags behind head + blockProcessingOffset = 16 + # Boolean to switch between modes of processing events when starting the server. # Setting to true will fetch filtered events and required blocks in a range of blocks and then process them. # Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head). diff --git a/packages/blocks-watcher/package.json b/packages/blocks-watcher/package.json index a4d23e3..677d6e0 100644 --- a/packages/blocks-watcher/package.json +++ b/packages/blocks-watcher/package.json @@ -29,7 +29,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/cerc-io/watcher-ts.git" + "url": "https://github.com/cerc-io/watcher-ts.git" }, "author": "", "license": "AGPL-3.0", @@ -39,11 +39,11 @@ "homepage": "https://github.com/cerc-io/watcher-ts#readme", "dependencies": { "@apollo/client": "^3.3.19", - "@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", + "@cerc-io/cli": "^0.2.97", + "@cerc-io/ipld-eth-client": "^0.2.97", + "@cerc-io/solidity-mapper": "^0.2.97", + "@cerc-io/util": "^0.2.97", + "@cerc-io/graph-node": "^0.2.97", "@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" } } diff --git a/packages/blocks-watcher/src/resolvers.ts b/packages/blocks-watcher/src/resolvers.ts index e209f6f..c611715 100644 --- a/packages/blocks-watcher/src/resolvers.ts +++ b/packages/blocks-watcher/src/resolvers.ts @@ -67,6 +67,8 @@ const executeAndRecordMetrics = async ( apiKey: expressContext.req.header('x-api-key'), origin: expressContext.req.headers.origin }); + + throw error; } finally { endTimer(); } diff --git a/yarn.lock b/yarn.lock index e7b6e72..164181e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -281,6 +281,23 @@ ws "^8.11.0" zen-observable-ts "^1.1.0" +"@cerc-io/ipld-eth-client@^0.2.97": + version "0.2.97" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.97/ipld-eth-client-0.2.97.tgz#1ba6a774b6ee944bb6dea9977ad11b35e17a1a3e" + integrity sha512-AuH//S/IPJ1NQ2zfizBLLDHv6HEbpSliTkR+SgexzECtAZwRmbmZ9x+4fdN5EnRMS1W7LJ1FmcyXjarRBCBAiA== + dependencies: + "@apollo/client" "^3.7.1" + "@cerc-io/cache" "^0.2.97" + "@cerc-io/util" "^0.2.97" + cross-fetch "^3.1.4" + debug "^4.3.1" + ethers "^5.4.4" + graphql "^15.5.0" + graphql-ws "^5.11.2" + left-pad "^1.3.0" + ws "^8.11.0" + zen-observable-ts "^1.1.0" + "@cerc-io/libp2p@0.42.2-laconic-0.1.4", "@cerc-io/libp2p@^0.42.2-laconic-0.1.4": version "0.42.2-laconic-0.1.4" resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flibp2p/-/0.42.2-laconic-0.1.4/libp2p-0.42.2-laconic-0.1.4.tgz#ac9347e70d6d3cee040ad02074cae3070b91a8fb" @@ -456,6 +473,13 @@ dependencies: dotenv "^10.0.0" +"@cerc-io/solidity-mapper@^0.2.97": + version "0.2.97" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.97/solidity-mapper-0.2.97.tgz#a7f666b00ce7a8867746a855d92575b09f1ca5eb" + integrity sha512-hUdqZ20NYa1NpbFs7z2AiInVGxjtAznE31uydRg1A20EN9csKUJ8+FP2C7ilFnB/UdB1qFVecB3QSw9Zc7TlUg== + dependencies: + dotenv "^10.0.0" + "@cerc-io/ts-channel@1.0.3-ts-nitro-0.1.1": version "1.0.3-ts-nitro-0.1.1" 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" @@ -515,6 +539,60 @@ ws "^8.11.0" yargs "^17.0.1" +"@cerc-io/util@^0.2.97": + version "0.2.97" + resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.97/util-0.2.97.tgz#5bc0865cfda68660215d59604cf42fb6c5b74352" + integrity sha512-wtpffWlXyc3+iEgX6bSD4+fWDTVqu9ryiD8mYtb+eTcK7/gA+VsGqzeDBD7tvEa6+cLpW6PqIc8ZpsMS62dASQ== + dependencies: + "@apollo/utils.keyvaluecache" "^1.0.1" + "@cerc-io/nitro-node" "^0.1.15" + "@cerc-io/peer" "^0.2.97" + "@cerc-io/solidity-mapper" "^0.2.97" + "@cerc-io/ts-channel" "1.0.3-ts-nitro-0.1.1" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/providers" "^5.4.4" + "@ethersproject/web" "^5.7.1" + "@graphql-tools/schema" "^9.0.10" + "@graphql-tools/utils" "^9.1.1" + "@ipld/dag-cbor" "^6.0.12" + "@libp2p/interface-connection" "^3.0.2" + "@libp2p/interface-peer-id" "^2.0.0" + "@libp2p/peer-id" "^2.0.0" + apollo-server-core "^3.11.1" + apollo-server-express "^3.11.1" + apollo-server-plugin-response-cache "^3.8.1" + apollo-type-bigint "^0.1.3" + bunyan "^1.8.15" + debug "^4.3.1" + decimal.js "^10.3.1" + ethers "^5.4.4" + express "^4.18.2" + express-queue "^0.0.13" + fs-extra "^10.0.0" + graphql "^15.5.0" + graphql-subscriptions "^2.0.0" + graphql-ws "^5.11.2" + ipfs-http-client "^56.0.3" + it-length-prefixed "^8.0.4" + it-pipe "^2.0.5" + it-pushable "^3.1.2" + js-yaml "^4.1.0" + json-bigint "^1.0.0" + lodash "^4.17.21" + lru-cache "^10.0.0" + mokka "^1.4.2" + multiformats "^9.4.8" + pg "^8.5.1" + pg-boss "^6.1.0" + prom-client "^14.0.1" + read-pkg "^9.0.1" + toml "^3.0.0" + typeorm "0.2.37" + typeorm-naming-strategies "^2.0.0" + winston "^3.13.0" + ws "^8.11.0" + yargs "^17.0.1" + "@chainsafe/is-ip@^2.0.1": version "2.0.2" resolved "https://registry.yarnpkg.com/@chainsafe/is-ip/-/is-ip-2.0.2.tgz#7311e7403f11d8c5cfa48111f56fcecaac37c9f6"