Commit Graph

75 Commits

Author SHA1 Message Date
prathamesh0
1e284bd07e
Update fill prefetch CLI (#171)
* Update fill prefetch CLI to accept env variables

* Clean up assets before building util package

* Accomodate change in other watchers and codegen

* Add logs for debugging failing test in CI
2022-09-06 13:19:14 +05:30
8af7417df6
Implement query for multiple entities and nested relation fields in eden-watcher (#166)
* Implement query for multiple entities in eden-watcher

* Implement nested relation queries

* Implement GQL query params first, skip, orderBy, orderDirection

* Add blockNumber index to subgraph entities

* Add logs for timing eth-calls and storage calls

* Add prometheus metrics to monitor GQL queries

* Fix default limit and order of 1-N related field in GQL entitiy query

* Add timer logs for block processing

* Run transpiled js in all watchers

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2022-09-01 14:17:43 +05:30
97e88ab5f0
Fixes and improvements for eden-watcher job-runner and compare CLI (#165)
* Compare IPLD state entity without derived fields

* Apply default limit to array relation fields in IPLD state entity

* Mark block as complete after processing of block handler

* Avoid re processing of block handler

* Use LIMIT 1 in the query to get latest IPLD block

* Replace eth_calls in eden-watcher with getStorageValue

* Add checkpoint verification to export state CLI

* Fix get diff blocks query when creating checkpoint

* Fix subgraph staker sort and remove entities sequentially in reset CLI

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2022-08-26 12:02:39 +05:30
ec56de057f
Implement method for storage based access in subgraph mapping code (#162)
* Implement storage call in subgraph mapping code

* Add test for mapping type variable storage call

* Use vulcanize graph-ts

* Revert to graph-ts version 0.22.1
2022-08-17 16:25:49 +05:30
bc1c267813
Add GQL query for sync status (#159)
* Add sync status GQL query

* Add sync status GQL query in codegen
2022-08-09 13:25:46 +05:30
5077abc90f
Compute gas price for EIP-1559 transaction (#157) 2022-08-09 10:50:25 +05:30
1a903fccc6
CLI to compare eden-watcher entities and fix mapping code (#149)
* Make sumStaked variable local in eden network mapping

* Implement compare CLI to fetch and query by ids

* Set filterLogs to true for eden-watcher

* Use varchar for bigint array type in eden-watcher

* Store subgraph entities by id in IPLD state

* Store bigint vales as string in IPLD state

* Update eden watcher hook to store single Block entity in IPLD checkpoint

* Fix entity enum type property

* Fix parsing big numbers in event params

* Fix event bigint params parsing in all watchers

* Set default limit to query result and process block after events
2022-08-08 15:58:13 +05:30
6990eb892a
Handle array and struct type event params in codegen (#150)
* Handle array and struct type event params

* Refactor parse event in watcher indexer code
2022-08-04 17:09:30 +05:30
a15305450c
Add prometheus metrics support for watchers (#152)
* Add prometheus metrics endpoint in watcher

* Add event, sync status and DB size metrics

* Fix subgraph watchers DB entities directory path

* Make watcher metrics optional using config
2022-08-03 16:26:51 +05:30
1bcabd64f2
Update codegen with changes implemented in mobymask watcher (#148)
* Update codegen with index-block CLI and remove graph-node

* Add filter logs by contract flag

* Skip generating GQL API for immutable variables

* Add config for maxEventsBlockRange

* Add new flags in existing watchers
2022-07-22 13:17:56 +05:30
58bbf4d756
Handle getStorage calls for old blocks (#145)
* Handle getStorage calls for old blocks

* Refactor getStorage code in mobymask watcher

* Fix returning proof as null
2022-07-20 10:37:17 +05:30
e2668690b5
Add filterLogs flag to fetch logs by contract (#144) 2022-07-18 14:04:59 +05:30
3cee10607e
Parse batched transactions for mobymask-watcher events (#141)
* Remove using graph-node from mobymask-watcher

* Parse batched transactions for MobyMask events

* Update to use same ethers package version

* Add CLI for processing block out of order

* Fix job-runner for already processed blocks out of order
2022-07-11 11:29:33 +05:30
26d998d3a7 Update codegen to store hash for indexed reference type event args 2022-06-29 14:53:57 +05:30
14a32a7d47 Fix for indexed reference type event arg in moby mask watcher 2022-06-29 14:53:57 +05:30
ba73cd24c2 Generate MobyMask watcher using codegen 2022-06-29 14:53:57 +05:30
prathamesh0
71d34331e9
Deprecate postgraphile usage (#122)
* Deprecate postgraphile usage

* Change endpoint in watcher config

* Remove subscription queries from eth-client

* Remove postgraphile config and client from watchers

Co-authored-by: nabarun <nabarun@deepstacksoft.com>
2022-06-08 12:13:52 +05:30
e4b9596be7
Update ipfs daemon version in readme (#121) 2022-05-26 20:01:31 +05:30
168689a7c7
Fix codegen for non subgraph watchers (#120)
* Fix codegen for non subgraph watchers

* Remove graphWatcher.init from generated non subgraph watcher
2022-05-26 18:00:17 +05:30
9a8ae3f308
Implement compare CLI for multiple entities for given block range (#108)
* Implement compare CLI for multiple entities at blocks

* Implement caching for gql requests
2022-01-17 15:18:44 +05:30
aabf9f8e15
Implement data source templates (#106)
* Implement data source templates

* Remove optional param from wasm instantiate

* Add all types for solidity to typescript mapping

* Set contract address in context for data source templates

* Implement block handlers for data source templates
2022-01-06 18:32:08 +05:30
561c2c9066 Generate schema from ABI when using subgraph path (#101) 2021-12-28 16:08:05 +05:30
prathamesh0
a267058d51 Add IpldStatus table and IPLD jobs in job-runner in codegen (#100) 2021-12-28 16:08:05 +05:30
prathamesh0
5f4dd14d7a Handle event name conflicts in schema and update hooks in codegen (#97)
* Change return type for subgraph resolvers and update hooks generation

* Handle event name conflicts in schema generation
2021-12-28 16:08:05 +05:30
7a4d0b6bb4 Fixes in eden watcher after comparing with generated watcher (#96) 2021-12-28 16:08:05 +05:30
prathamesh0
e883463aa6 Parse events for multiple contracts in the generated code (#95)
* Parse events for multiple contracts in the generated code

* Use contract wise artifacts in the generated indexer methods

* Update codegen docs to use config file to generate a watcher

* Add watcher generation config to eden-watcher
2021-12-28 16:08:05 +05:30
e5faba8e68 Fixes after comparing with existing eden watcher (#94) 2021-12-28 16:08:05 +05:30
feac6bad16 Remove default ERC20 code from generated hooks (#93) 2021-12-28 16:08:05 +05:30
prathamesh0
44e18fee48 Add watcher generation mode none (#92) 2021-12-28 16:08:05 +05:30
8b5d408f77 Implement Block_height input and definition for custom scalar BigDecimal (#91) 2021-12-28 16:08:05 +05:30
2a204d8a32 Handle additional subgraph types BigDecimal and Bytes in codegen (#89)
* Handle additional subgraph types BigDecimal and Bytes

* Use bigint and Decimal array transformers
2021-12-28 16:08:05 +05:30
prathamesh0
18f73e57c0 Generate relations and entity types maps in indexer (#88) 2021-12-28 16:08:05 +05:30
d96cc095bb Handle relation fields in subgraph entities (#87) 2021-12-28 16:08:05 +05:30
4b1b0e0ed6 Handle subgraph entities field name conflicts and enum types in codegen (#86)
* Handle entity field conflicts

* Handle enum type fields in subgraph entities
2021-12-28 16:08:05 +05:30
prathamesh0
3ed4ab95af Implement IPLD refactoring in codegen (#85) 2021-12-28 16:08:05 +05:30
1e7d84879b Implement changes in codegen for performance improvements (#84) 2021-12-28 16:08:05 +05:30
prathamesh0
97b529f3f2 Update CLI generation (#83) 2021-12-28 16:08:05 +05:30
prathamesh0
5b12db541b Support artifacts generation for multiple contracts (#82) 2021-12-28 16:08:05 +05:30
prathamesh0
5f03ad5029 Use pg-type numeric for bigint in entities and use custom decimal in graph-node (#71)
* Use pg-type numeric for bigint columns in typeorm entities

* Use custom decimal implementation from util in graph-node
2021-12-28 16:08:05 +05:30
c75be57146 Get block size using JSON RPC API from ipld-eth-server (#68) 2021-12-28 16:08:05 +05:30
prathamesh0
94e9182dd3 Handle BigNumber event params and customize Decimal (#63)
* Handle BigNumber event params in watchers

* Customize decimal according to limits of IEEE-754 decimal128

* Add definition for custom scalar BigDecimal
2021-12-28 16:08:05 +05:30
prathamesh0
06ba24e38f Generate GQL API for subgraph entities and auto-diff based on store set (#38)
* Add subgraph schema types to the generated schema

* Add queries for subgraph entities

* Add entity generation for subgraph entities

* Call subgraph event handler in indexer

* Refactor subgraph schema and entity generation

* Add resolvers generation for subgraph entities

* Get event signature in the event

* Add NonNullType check for field type in entity generation

* Auto-diff based on store set

* Use contract address from data source in loader

* Change subgraph-schema arg to subgraph-path arg
2021-12-28 16:08:05 +05:30
62521d7ccc Use postgraphile client to fetch blocks 2021-12-28 16:08:04 +05:30
prathamesh0
bb1345c696 Refactor code to initialize clients (#290)
* Refactor CLI code

* Refactor code to initialize clients

* Don't return config from function to initialize clients
2021-12-28 16:08:04 +05:30
prathamesh0
a846917f1d Export-import watcher state and IPFS integration (#289)
* Add export-watcher CLI generation

* Export snapshot block and add import-watcher CLI gen

* Update codegen docs with export and import commands

* Use different function to get latest checkpoint in export CLI

* Update generated watcher docs with import state instructions

* Push IPLDBlocks to IPFS

* Change ts type for data column to Buffer

* Add checkpoint hook

* Push CLI checkpoint to IPFS

* Fix latest IPLDBlock query to filter out irrelevant blocks

* Add CLI to inspect a CID

* Decode data before exporting

* Encode data in JSON for getState GQL API

* Use go-ipfs and export cbor-encoded buffer

* Remove empty post-block methods from existing watchers

* Call hooks and checkpoint job complete handlers in fill

* Remove subscription to hooks queue from existing watchers
2021-12-28 16:08:04 +05:30
prathamesh0
f2b150995b Boolean state param to indexer methods and IPLDBlocks only in the pruned region (#286)
* Remove checkpoint option for state param. to indexer methods

* Change state param. to indexer methods to boolean

* Use hierarchical query to get the last checkpoint of a contract

* Filter out blocks before prev checkpoint for a new checkpoint

* Add checkpointing job on completion of chain pruning

* Update codegen docs with reset commands

* Create initial checkpoint in the checkpoint queue

* Handle initial checkpoint along with other checkpoints

* Create initial checkpoint job in indexer

* Create IPLDBlocks only in the pruned region

* Create staged diff IPLDBlock for default state
2021-12-28 16:08:04 +05:30
prathamesh0
27104f9d74 Optional server port arg. for watcher generation (#284) 2021-12-28 16:08:04 +05:30
c349b23f29 Add reset CLI generation 2021-12-28 16:08:04 +05:30
prathamesh0
4ddb8c4af6 Auto generating state from indexer methods (#277)
* Generate default derived state for Mapping type variables

* Update IPLDBlock in storage methods instead of using a private class variable

* Default state flag for indexer storage methods

* Helper functions to update state objects

* Add checkpoint flag in Contract table and corresponding changes in existing watchers

* Update codegen docs

* Add examples to generated docs

* Turn default state off by default

* Make state parameter to indexer storage methods default to none

* Add method to get prev. state in indexer
2021-12-28 16:08:04 +05:30
prathamesh0
2aa0234da5 Change initial checkpoint hook and hook status entity naming (#269) 2021-12-28 16:08:04 +05:30