Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Unlock Protocol Subgraph [merged into the mono repo]

Notifications You must be signed in to change notification settings

unlock-protocol/unlock-subgraph

 
 

Repository files navigation

This package contains the source code for the Unlock Protocol Subgraph, a project for indexing and querying Unlock Protocol data from the Ethereum blockchain using The Graph.

** THIS WAS MERGED INTO THE MONO REPO**

Quick Start

Running a local Graph Node with Docker Compose

The quickest way to run a Graph Node locally is to use the graph-node docker image.

  1. Install Docker and Docker Compose
  2. In the root of this project run docker-compose up

This command will look for the docker-compose.yml file and automatically provision a server with rust, postgres, and ipfs, and spin up a graph node with a GraphiQL interface at http://127.0.0.1:8000/. You are now ready to build and deploy the Unlock Protocol subgraph.

Building and Deploying the Unlock Protocol Subgraph

Updating The Subgraph

After sometime with our subgraphs in production we have updated the tooling to better support our usage.

The endgoal is to be able to easily deploy the same code to its respective subgraph any of the existing networks.

Building the subgraph.yml file

In addition to the entities and handlers to be utilized, the file also includes the lock contract address and the relevant network name. In making this process easier, this file is now generated based upon a template.

Generate via the build script:

yarn build --network {network name}

Generating code

With subgraph.yaml created, we should generate the associated code with the following: yarn codegen

The following commands have been introduced:

These command require the passing of the following command line arguments --network & --environment.

  • yarn create - Allows for the creation of the subgraph
  • yarn remove - Removes the subgraph from the graph node
  • yarn deploy - Deploy the latest subgraph code to the graph node

About

Unlock Protocol Subgraph [merged into the mono repo]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 78.5%
  • JavaScript 21.5%