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. |
---|
Kovan | Goerli | Arbitrum One |
---|---|---|
semaphore-protocol/kovan | semaphore-protocol/goerli | semaphore-protocol/arbitrum |
Clone this repository:
git clone https://github.com/semaphore-protocol/subgraph.git
and install the dependencies:
cd subgraph && yarn
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.
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
Generate AssemblyScript types for the subgraph (required every time the schema changes):
yarn codegen
Set the authorisation code that links your account on thegraph.com:
yarn auth <access-token>
Deploy the subgraph to the hosted service:
yarn deploy:kovan
// or
yarn deploy:goerli
// or
yarn deploy:arbitrum