Giter VIP home page Giter VIP logo

subgraph's Introduction

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

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

🛠 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:goerli semaphore-protocol/goerli-5259d3
// or
yarn deploy:arbitrum semaphore-protocol/arbitrum-86337c

subgraph's People

Contributors

cedoor avatar vgloic avatar aguzmant103 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.