watcher-ts/packages/graph-node
nikugogoi 6cca55a1ab Integrate generated watcher to invoke handlers in graph-node (#33)
* 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
2021-12-28 16:08:05 +05:30
..
assembly Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
src Integrate generated watcher to invoke handlers in graph-node (#33) 2021-12-28 16:08:05 +05:30
test Integrate generated watcher to invoke handlers in graph-node (#33) 2021-12-28 16:08:05 +05:30
.env.example Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
.eslintignore Example subgraph, ethCall test to drive implementation (#18) 2021-12-28 16:08:04 +05:30
.eslintrc.json Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
.gitignore Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
.mocharc.yml Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
.npmrc Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
asconfig.json WASM instance setup (#11) 2021-12-28 16:08:04 +05:30
package.json Integrate generated watcher to invoke handlers in graph-node (#33) 2021-12-28 16:08:05 +05:30
README.md Test case for EdenNetwork event handler (#31) 2021-12-28 16:08:05 +05:30
tsconfig.json Integrate generated watcher to invoke handlers in graph-node (#33) 2021-12-28 16:08:05 +05:30

graph-node

Test

  1. Run yarn to install all dependencies.

  2. Create .env file

    $ cp .env.example .env
    
  3. To deploy contract for example subgraph use https://github.com/deep-stack/eth-contract-tests

    # In eth-contract-test repo.
    $ yarn
    
    $ yarn example:deploy
    

    Use the address the contract got deployed to and set it to EXAMPLE_CONTRACT_ADDRESS in .env file.

  4. To deploy contracts for eden subgraph use https://github.com/vulcanize/governance

  5. Follow the steps in https://github.com/vulcanize/governance/tree/watcher-ts#instructions

  6. Set the contract addresses for eden contracts in .env file from deployments/localhost directory in the governance repository.

    Following are the contracts whose address needs to be set in .env file:

    • EdenNetwork - EDEN_NETWORK_CONTRACT_ADDRESS
    • MerkleDistributor - EDEN_NETWORK_DISTRIBUTION_CONTRACT_ADDRESS
    • DistributorGovernance - EDEN_NETWORK_GOVERNANCE_CONTRACT_ADDRESS
  7. Run yarn build:example to build the wasm files.

  8. Run yarn test.