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. |
---|
Semaphore version | Goerli | Arbitrum One |
---|---|---|
v2.0 | N/A | semaphore-protocol/arbitrum |
v2.5 | semaphore-protocol/goerli | N/A |
v2.6 | semaphore-protocol/goerli-5259d3 | semaphore-protocol/arbitrum-86337c |
v3-beta | semaphore-protocol/goerli-89490c | N/A |
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:goerli semaphore-protocol/goerli-5259d3
// or
yarn deploy:arbitrum semaphore-protocol/arbitrum-86337c