cedoor / subgraph

Semaphore subgraph definition (The Graph).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Semaphore icon. Semaphore subgraph

Github license Linter eslint Code style prettier Repository top language

The Graph is an indexing protocol for querying networks like Ethereum and IPFS. Our subgraphs allow you to get data from the Semaphore.sol smart contract.

Networks

Kovan Goerli Arbitrum One
semaphore-protocol/kovan semaphore-protocol/goerli semaphore-protocol/arbitrum

πŸ›  Install

Clone this repository:

git clone https://github.com/semaphore-protocol/subgraph.git

and install the dependencies:

cd subgraph && yarn

Usage

The subgraph definition consists of a few files:

  • subgraph.template.yaml: a YAML file containing the subgraph manifest,
  • schema.graphql: a GraphQL schema that defines what data is stored for the subgraph, and how to query it via GraphQL,
  • src/mappings.ts: AssemblyScript code that translates from the event data to the entities defined in the schema.

Code quality and formatting

Run ESLint to analyze the code and catch bugs:

yarn lint

Run Prettier to check formatting rules:

yarn prettier

or to automatically format the code:

yarn prettier:write

Code generation

Generate AssemblyScript types for the subgraph (required every time the schema changes):

yarn codegen

Authorization

Set the authorisation code that links your account on thegraph.com:

yarn auth <access-token>

Deploy

Deploy the subgraph to the hosted service:

yarn deploy:kovan
// or
yarn deploy:goerli
// or
yarn deploy:arbitrum

About

Semaphore subgraph definition (The Graph).

License:MIT License


Languages

Language:TypeScript 100.0%