GithubHelp home page GithubHelp logo

isabella232 / subgraphs-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maticnetwork/subgraphs

0.0 0.0 0.0 700 KB

Subgraph for Matic contracts

License: MIT License

JavaScript 5.55% TypeScript 94.45%

subgraphs-1's Introduction

Subgraphs

Subgraph for Matic contracts

Please take a look at Graph protocol for more information.

Polygon hosted node endpoints

Root

  • Mainnet: https://thegraph.com/hosted-service/subgraph/maticnetwork/mainnet-root-subgraphs
  • Goerli: https://thegraph.com/hosted-service/subgraph/maticnetwork/mumbai-root-subgraphs

For Mumbai hosted node endpoints

  • Graph node: https://mumbai-graph.matic.today
  • GraphQL endpoint: https://api.mumbai-graph.matic.today/subgraphs/name/<YOUR_GITHUB_USERNAME>/<SUBGRAPH_NAME>/graphql
  • HTTP endpoint: https://api.mumbai-graph.matic.today/subgraphs/name/<YOUR_GITHUB_USERNAME>/<SUBGRAPH_NAME>
  • IPFS endpoint: https://ipfs.infura.io:5001/

Subgraphs

This repository contains subgraphs for two chains: root (Ethereum) and child (Matic) with respective testnets.

To prepare root (Ethereum) subgraphs

cd root

# install dependencies
npm install

# For goerli
npm run prepare:goerli

# For mainnet
# npm run prepare:mainnet

To prepare child (Matic) subgraphs

cd child

# install dependencies
npm install

# For mumbai
npm run prepare:mumbai

# For mainnet
# npm run prepare:mainnet

Build

# generate code
npm run codegen

# build
npm run build

Deploy locally

For goerli

# create sub graph in local node
npm run graph -- create --node http://localhost:8020/ nglglhtr/goerli-matic-subgraph

# deploy sub graph locally
npm run graph -- deploy --node http://localhost:8020/ --ipfs https://ipfs.infura.io:5001/ nglglhtr/goerli-matic-subgraph 

Deploy on Graph's hosted node

For goerli

# create sub graph in local node
npm run graph -- create --node https://api.thegraph.com/deploy/  nglglhtr/goerli-matic-subgraph

# deploy sub graph locally
npm run graph -- deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ nglglhtr/goerli-matic-subgraph 

For mumbai

# create sub graph in local node
npm run graph -- create --node https://mumbai-graph.matic.today  nglglhtr/mumbai-matic-subgraph

# deploy sub graph locally
npm run graph -- deploy --node https://mumbai-graph.matic.today --ipfs https://ipfs.infura.io:5001/ nglglhtr/mumbai-matic-subgraph

Run local graph node

$ cargo run -p graph-node --release -- \
    --postgres-url postgresql://localhost:5432/token-transfer \
    --ethereum-rpc http://localhost:8545/ \
    --ipfs 127.0.0.1:5001 \
    --subgraph <IPFS_HASH from .ipfs.hash>

You can open graphiQL UI at http://localhost:8000

License

MIT

subgraphs-1's People

Contributors

itzmeanjan avatar jdkanani avatar reddyismav avatar nitinmittal23 avatar qedk avatar 0xkrishna avatar anggxyz avatar vibhurajeev avatar rahuldamodar94 avatar ptsayli 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.