* Add implementation for one to one relation
* Implement one to many relation in gql queries
* Make changes for gql relation queries in eden-watcher
* Implement subgraph gql relation queries with joins
* Handle relation entities in subgraph
* Modify eden-watcher entities to handle subgraph schema data types
* Modify schema gql to match eden subgraph gql shape
* Handle array type fields in subgraph schema
* Fix store get api for array type fields in subgraph entities
* Handle array type in eden-watcher and format await used in params
* Rename Block, Transaction types and add block query in eden-watcher schema
* Handle field name conflicts in eden subgraph entities
* Resolve entity field name conflicts while sending data for auto-diff
* Add a watcher for EdenNetwork contract
* Add events from MerkleDistributor contract to eden-watcher
* Add ERC721 Transfer and Approval events to eden-watcher schema
* Add artifacts for DistributorGovernance and MerkleDistributor contracts
* Fix packages build
* Add support for boolean type in subgraph schema
* Add BigDecimal fromString and toString implementation
* Add implementation for subgraph Bytes type
* Implement enum type for subgraph schema
* Add implementation for subgraph schema BigDecimal type
* JSON stringify and parse entity data for auto-diff
* Add a test case to eden test to call the block handler
* Add a block handler in example subgraph and call it in a watcher
* Use an array map to call all the block handlers for a contract
* Await on all the promises returned by block handlers map
* 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
* Implement store get api without blockHash and blockNumber
* Pass database instance to GraphWatcher
* Implement store set without block data
* Store blockHash and blockNumber in database entity table
* Implement getting entity in subgraph from store.get
* Add block data present in postgraphile
* Pass db and context to instantiate method in tests
* GQL API in graph-test-watcher to test store.set
* Remove contract address from subgraph file
* Fix block in dummy event data
* Pass just blockHash to get an entity from the database
* Review changes and add TODOs
Co-authored-by: prathamesh <prathamesh.musale0@gmail.com>
* Invoke subgraph handler in watcher event processing
* Fix error when invoking subgraph handler
* Parse events using event signature specified in subgraph yaml
* Use contract abi to parse event params
* Invoke event handler based on event signature
* Fill event with block and transaction data
* Comment missing fields in block and transaction data
* Invoke handlers based on watcher-ts events
* Read subgraph yaml and listen to events from watcher-ts
* Create GraphWatcher class to use in generated example contract watcher
* Call graph-node event handler from generated watcher
* Test case for calling EdenNetwork event handler
* Test cases for calling EdenNetwork event handlers
* Test cases for calling event handlers in EdenNetworkDistribution
* Test cases for calling event handlers in EdenNetworkGovernance
* Perform eth-calls according to contract name in param
* Pass function params in eth-call host API
* Return value from eth-call to wasm
* Add instructions for running tests
* Install assemblyscript from github packages
* Add instrcutions for installing private github packages
* Use vulcanize assemblyscript package
* Perform eth_call and get result in js import
* Use dummy value for eth_call
* Called handler in wasm with event param
* Implement passing event to subgraph handler function
* Use generated event class Test for passing to handler
* Pass event params to handler
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* Implement host api typeConversion.bytesToHex
* Complete host api bigIntToString.
* Create TypeId for assemblyscript loader.
* Implement host apis bigInt fromString, plus and minus
* Code for running wasm file.
* Add test for wasm exported function.
* Use target names for build files.
Co-authored-by: nabarun <nabarun@deepstacksoft.com>
* 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
* 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
* 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
* Subscribe to hooks queue in existing watchers
* Change naming strategy for generated get and save functions
* Push checkpointing job after post-block hook job completed
* Using hooks status to ensure their chronological execution
* Add default indices to IPLDBlock table
* Add kind parameter to getState GQL API
* Add checkpoint CLI
* Add blockHash arg to checkpoint CLI and update codegen docs
* Print out block hash for checkpoint CLI
* Use log from debug for logging
* Filter using contract at start in hierarchical query
* Make kind argument to prepare IPLDBlock required
* Add ipld-blocks entity generation
* Populate ipld-blocks table
* Rename ipld-block entity and update after each event
* Move ipld-hook to hooks.ts
* Change IPLD block structure
* Add cid field in blocks
* Fetch prev. IPLDBlock for a contract
* GQL API to query IPLDBlock by CID
* Save cid in blocks in existing watchers
* Update codegen docs
* GQL API for getting last derived state (#3)
* GQL API for getting last derived state
* Rename query to getState
* Change query names to getState and getStateByCid
* Save BigInt as string
* Move function to prepare IPLDBlock to indexer
* Refactor IPLDBlock hook
* Add genesis hook
* Call post-block hook after a block is marked as complete
* Add IPLDBlock checkpointing
* Use queryRunner instead of a new repo for queries
* Add a query to get block in ipld-eth-client
* Get latest checkpoints for all contracts for checkpointing.
* Call post-block hook in a queue
* Pass server config to Indexer in watch-contract cli
Co-authored-by: nikugogoi <nabarun@deepstacksoft.com>
* Fix fill cli to work with watcher server
* Add createdAt column and insert events in batches
* Implement prefetch to fill block and events in parallel
* Fix getPrevEntity and increase fill prefetch default batch size
* Fix watcher creating mulitple jobs for a block
* Improvement TODOs
* Get parent and current block in single query
* Remove block progress queries and events query
* Reduce queries in fetching batch events by using query builder
* Implement changes in codegen package
* Avoid database query by passing event directly to job-queue
* Avoid block progress query by returning from update query
* Process batch of events for a block in a single job
* Fix smoke test for subscribed events and use teamSize for job queue