Threshold Network subgraph

This repository contains tBTCv2 subgraph.

Subgraphs are open APIs to query data from networks like Ethereum and IPFS. The data is indexed by The Graph decentralized protocol.

Install, build and deploy subgraph

Testing subgraph locally

This tBTCv2 subgraph can be deployed in a local Graph node for developing and testing purposes.

After deploying tBTCv2 contracts in a local blockchain using Hardhat or Ganache, we can deploy the local Graph node, connect it to this local blockchain and deploy on it tBTCv2 subgraph.

Deploy local subgraph node on Docker containers

$ docker-compose up

Deploy the subgraph

$ graph codegen && graph build
$ yarn create-local
$ yarn deploy-local

Contributing

Lint

We use Prettier and ESLint for linting code. The scripts are:

$ yarn format <file_path>           # Prettier
$ yarn format:fix <file_path>
$ yarn lint # eslint <file_path>    # ESLint
$ yarn lint:fix <file_path>
$ yarn format:lint:fix <file_path>  # fix files using Prettier and ESLint