Commit Graph

281 Commits

Author SHA1 Message Date
ce6568aad2 Add demo for graph-watcher IPLD statediff and checkpointing 2022-05-06 15:43:45 +05:30
ba6b996e65
Deploy example contract in graph-node (#113)
* Deploy example contract in graph-node

* Add auth token in docker build for github packages

* Add steps for running tests in CI
2022-04-29 15:11:40 +05:30
eca09ad66b
Change postgraphile queries to work with v3 schema (#112) 2022-04-28 17:13:32 +05:30
654edf4008
Update README and graph-node tests (#110)
* Update README with proper steps for installing github packages

* Update graph-node readme to run tests
2022-04-27 15:37:13 +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
4867530da7
Implement subgraph JSON host APIs fromBytes and try_fromBytes (#105)
* Implement JSON fromBytes host API

* Implement json.try_fromBytes host API

* Fill host API code for json number methods
2022-01-03 18:15:20 +05:30
6a2c99a0bb
Implement data source and crypto host APIs (#104)
* Implement data source host APIs

* Implement crypto host API
2021-12-30 17:57:34 +05:30
8b913af93f
Implement ethereum ABI encode and decode in subgraph (#103)
* Implement ethereum ABI encode in subgraph

* Implement ethereum ABI decoding host API

* Implement ABI encode decode for array type

* Implement ABI encode decode for bytes type
2021-12-30 13:12:32 +05:30
9b1aa29afd
Get missing fields in transaction data for subgraph event handlers (#102)
* Get missing fields in event transaction

* Cache transaction data for event handlers in subgraph
2021-12-29 13:21:39 +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
3638d56787 Add checks for and create hooks, checkpoint and IPFS jobs in job-runner (#99)
* Add fields for checkpoint and IPFS in IpldStatus table

* Mark block processing job complete in watchers
2021-12-28 16:08:05 +05:30
dee517e444 Implement IpldStatus table for IPLD related jobs (#98) 2021-12-28 16:08:05 +05:30
prathamesh0
d385db2775 Add missing relation fields in eden-watcher relations map (#90) 2021-12-28 16:08:05 +05:30
198e49e5a0 Implement WASM instance restart to handle out of memory error (#81)
* Test case for wasm out of memory error

* Restart wasm instance after N blocks

* Handle out of memory error and re instantiate WASM

* Remove old instance from map before reinstantiating WASM
2021-12-28 16:08:05 +05:30
68bc1c00db Refactor watchers for util package changes 2021-12-28 16:08:05 +05:30
prathamesh0
560df57ac7 Performance improvements for IPLDBlocks in eden watcher (#80)
* Avoid fetching contracts while creating a checkpoint

* Use enum for state kind and cache ipld status

* Avoid fetching block twice while finalizing a staged diff IPLDBlock

* Create checkpoints at fixed block numbers and refactor checkpointing code

* Avoid calling block handler until start block is reached

* Use delete while finalizing staged diff IPLDBlocks

* Add a check to ensure hooks job is created only once

* Avoid check for initial state while creating a checkpoint
2021-12-28 16:08:05 +05:30
prathamesh0
952f68ee58 Add time logs for eden-watcher (#78) 2021-12-28 16:08:05 +05:30
f4d16afa6c Refactor watchers according to changes in util package 2021-12-28 16:08:05 +05:30
768a4d0818 Use Promise all while fetching events and watch contracts only once 2021-12-28 16:08:05 +05:30
ba890e7d9a Add method in watchers to cache contract and fixes for running tests 2021-12-28 16:08:05 +05:30
prathamesh0
cb2fe2aa45 Store initial state and refactor IPLDBlocks related code (#76)
* Process hooks for the first block in the watchers

* Store initial state from a hook in an IPLDBlock for eden-watcher

* Extract watcher method to prepare IPLDBlocks in util

* Extract common IPLDBlocks related code in util

* Move IPFSClient to util

* Use constants for state kind
2021-12-28 16:08:05 +05:30
prathamesh0
4c422e3ea2 Avoid setting null entity properties while fetching in store get API (#75) 2021-12-28 16:08:05 +05:30
prathamesh0
3b835e81f8 Pass provider while instantiating the loader and use block hash while making the eth-calls (#74)
* Pass provider while instantiating the loader

* Use custom provider for graph-node tests

* Use block hash while making an eth-call
2021-12-28 16:08:05 +05:30
prathamesh0
3d3ebb0e43 Get event handler using cleaned subgraph event signature (#73) 2021-12-28 16:08:05 +05:30
d4e79ceee4 Add a method in test indexer to get blocks 2021-12-28 16:08:05 +05:30
prathamesh0
3e0c84b333 Use entity column type map to create entity in store get API (#72)
* Use typeof to distinguish between BigInt and BigDecimal in store get API

* Use entity column type map to create entity in store get API

* Add entity column type map in eden-watcher
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
prathamesh0
475c34b3fa Add an executable for compare-entity CLI (#69) 2021-12-28 16:08:05 +05:30
prathamesh0
c79647548e Add more test cases for numeric host APIs (#66)
* Add test cases for bigInt host APIs

* Add test cases for bigDecimal fromString, plus and minus host APIs

* Add test cases for bigDecimal times and divideBy host APIs

* Throw an error on underflow or overflow in bigDecimal toString host API

* Avoid rounding of out of range bigDecimal values

* Use big number's byte size to set storage size of bigInt

* Add test cases for errors in bigDecimal host API
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
86dcee12f7 Get author field for block data 2021-12-28 16:08:05 +05:30
30f3c9e694 Fix block processing job created twice when processing missing parent block (#67)
* Fix block processing job created twice in watcher

* Fix block processing job for missing parent blocks
2021-12-28 16:08:05 +05:30
faf046d181 Implement graph-ts numbers, typeConversion and log host APIs (#64)
* Implement host api for bigint operations

* Implement type conversion APIs

* Avoid use of exports as variable name for conflict

* Implement log API with debug and levels

* Fix job-runnner hook error after stopping and starting chain
2021-12-28 16:08:05 +05:30