This repository contains the code for deploying the L2 Storage subgraph on The Graph. Below, you'll find the necessary commands to install dependencies, build the code, and deploy the subgraph.
Ensure you have the following installed on your system:
- Node.js (version 12.x or higher)
- Yarn (version 1.x or higher)
- Docker (optional, only if used for the local Ethereum node)
- Graph node running locally
The Graph Node, IPFS, and Postgres can be set up locally using Docker. Clone this repo graph-node and edit the ethereum
field in the docker-compose.yml
with the preferred chain
Start the services:
docker-compose up
First, clone this repository and navigate to the project directory:
yarn install
Before building and deploying the subgraph, make sure to update the subgraph.yaml file with the correct details for your subgraph, such as contract address and start block.
To generate code from the ABI files, use:
yarn codegen
Run the following command to create the subgraph on your local Graph Node:
yarn create-local
To build the subgraph, run the following command:
yarn build
This will generate the subgraph code from the subgraph.yaml configuration file.
Finally, deploy the subgraph with the following command:
yarn deploy-local