elysia-dev / elyfi-subgraph

The code of Elyfi subgraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

elyfi-subgraph

The code of Elyfi subgraph. You can test mainnet subgraph here

yarn global add @graphprotocol/graph-cli

Local Setup

We use docker compose for developoing the subgraph. Our docker-compose file includes basic containers like graph node, ifps and postgresql and we add one more container(ganache-cli) for convenience

  • docker-compose up -d
  • yarn deploy-contracts:local : Deploy elyfi contrats to ganache
  • yarn prepare:local : Generate subgraph.yaml
  • yarn codegen
  • yarn create:local
  • yarn deploy:local

For test transaction data,

  • yarn task createDeposit --network ganache
  • yarn task createWithdraw --newtork ganache

Create reserve on local

HTTP error creating the subgraph: ECONNREFUSED raised then remove data dictory

  • docker-compose up -d
  • yarn deploy:core --network ganache on lib/elyfi project
  • yarn deploy:reserve --network ganache --tags dai_reserve on lib/elyfi project
  • yarn prepare:local : Generate subgraph.yaml
  • yarn codegen
  • yarn create:local
  • yarn deploy:local

How to deploy (production)

  1. graph auth --studio ACCESS_KEY. You can find the ACCESS_KEY in https://thegraph.com/studio/subgraph/elyfi/
  2. graph codegen <MANIFEST_FILE> && graph build. For example, <MANIFEST_FILE> is subgraph-mainnet.yaml in mainnet, the default is subgraph.yaml.
  3. graph deploy --studio elyfi with new version

See https://thegraph.academy/developers/subgraph-development-guide/ for details.

About

The code of Elyfi subgraph

License:MIT License


Languages

Language:TypeScript 100.0%