This is a demo test version of a subgraph for tracking Transfer
events in the Kakarot contract on the Sepolia network. The subgraph indexes account data and tracks the number of transactions for each account.
- Installation Prerequisites
- Running the Subgraph Locally with Docker Compose
- How to Deploy a Subgraph Using Kakarot Hosted Service
- Additional Resources
- Description: Node.js is a server platform for running JavaScript, which includes npm (Node Package Manager).
- Usage: Required for installing dependencies and running development tools like Graph CLI.
- Installation: Download and install Node.js and npm from the official website:
- Description: Yarn is an alternative to npm for managing project dependencies. It is used for fast and reliable package installation.
- Installation: Install Yarn via npm:
npm install -g yarn
- Description: Docker is a containerization platform that allows running applications in isolated containers. Docker Compose is a tool for managing multi-container applications.
- Usage: Used for deploying services like IPFS, Postgres, and Graph Node, which are necessary for running subgraphs locally.
- Installation: Download and install Docker from the official website:
- Description: Graph CLI is a command-line tool for creating, building, and deploying subgraphs.
- Installation: Install Graph CLI via npm:
npm install -g @graphprotocol/graph-cli
Before running the subgraph locally, ensure that you have installed the following:
git clone https://github.com/protofire/kakarot-subgraph
cd kakarot-subgraph
yarn install
graph codegen
graph build
Start the necessary services (IPFS, Postgres, and Graph Node) using Docker Compose:
docker-compose up -d
This command will start the following services:
- IPFS: InterPlanetary File System for decentralized file storage.
- Postgres: Database service for storing indexed data.
- Graph Node: The service responsible for indexing and serving queries.
Once the services are running, you can deploy your subgraph locally:
graph create --node http://localhost:8020/ <your-subgraph-name>
graph deploy <your-subgraph-name> --ipfs http://localhost:5001 --node http://localhost:8020/
Replace <your-subgraph-name>
with the name of your subgraph.
Alternatively, you can use the following yarn scripts:
yarn create-local
yarn deploy-local
After deployment, you can query your subgraph using the following GraphQL endpoint:
http://localhost:8000/subgraphs/name/<your-subgraph-name>
Kakarot Hosted Services (KHS) for The Graph is a platform that let you deploy subgraphs in our infrastructure.
https://ui.kakarot.protofire.io/
Before deploying the subgraph using the Kakarot Hosted Service, ensure that you have installed the following:
git clone https://github.com/protofire/kakarot-subgraph
cd kakarot-subgraph
yarn install
graph codegen
graph build
You'll need credentials to use the Kakarot hosted service. Complete this form to request permission to deploy a subgraph:
Once you have your credentials (user and password), you can deploy the subgraph:
graph create --node https://user:[email protected] kakarot/UniswapV2
graph deploy kakarot/UniswapV2 --version-label kakarot/UniswapV2 --headers "{\"Authorization\": \"Basic user:password encoded\"}" --ipfs https://ipfs.kakarot.protofire.io --node https://user:[email protected]
For more information about subgraphs, visit The Graph documentation: