npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@graphprotocol/subgraph-service

v1.1.0

Published

Data service contracts for Graph Horizon subgraph indexing

Readme

🌅 Subgraph Service 🌅

The Subgraph Service is a data service designed to work with Graph Horizon that supports indexing subgraphs and serving queries to consumers.

Configuration

The following environment variables might be required:

| Variable | Description | | ---------------------- | ------------------------------------------------------------------------------- | | ARBISCAN_API_KEY | Arbiscan API key - for contract verification | | ARBITRUM_ONE_RPC | Arbitrum One RPC URL - defaults to https://arb1.arbitrum.io/rpc | | ARBITRUM_SEPOLIA_RPC | Arbitrum Sepolia RPC URL - defaults to https://sepolia-rollup.arbitrum.io/rpc | | LOCALHOST_RPC | Localhost RPC URL - defaults to http://localhost:8545 |

You can set them using Hardhat:

npx hardhat vars set <variable>

Build

pnpm install
pnpm build

Deployment

Note that this instructions will help you deploy Graph Horizon contracts alongside the Subgraph Service. If you want to deploy just the core Horizon contracts please refer to the Horizon README for deploy instructions.

New deployment

To deploy Graph Horizon from scratch including the Subgraph Service run the following command:

npx hardhat deploy:protocol --network hardhat

Upgrade deployment

Usually you would run this against a network (or a fork) where the original Graph Protocol was previously deployed. To upgrade an existing deployment of the original Graph Protocol to Graph Horizon including the Subgraph Service, run the following commands. Note that some steps might need to be run by different accounts (deployer vs governor):

cd ../
cd horizon && npx hardhat deploy:migrate --network hardhat --step 1 && cd ..
cd subgraph-service && npx hardhat deploy:migrate --network hardhat --step 1 && cd ..
cd horizon && npx hardhat deploy:migrate --network hardhat --step 2 && cd .. # Run with governor. Optionally add --patch-config
cd horizon && npx hardhat deploy:migrate --network hardhat --step 3 && cd .. # Optionally add --patch-config
cd subgraph-service && npx hardhat deploy:migrate --network hardhat --step 2 && cd .. # Optionally add --patch-config
cd horizon && npx hardhat deploy:migrate --network hardhat --step 4 && cd .. # Run with governor. Optionally add --patch-config

Horizon Steps 2, 3 and 4, and Subgraph Service Step 2 require patching the configuration file with addresses from previous steps. The files are located in the ignition/configs directory and need to be manually edited. You can also pass --patch-config flag to the deploy command to automatically patch the configuration reading values from the address book. Note that this will NOT update the configuration file.

Testing

  • unit: Unit tests can be run with pnpm test
  • integration: Integration tests can be run with pnpm test:integration - Need to set BLOCKCHAIN_RPC for a chain where The Graph is already deployed - If no BLOCKCHAIN_RPC is detected it will try using ARBITRUM_SEPOLIA_RPC
  • deployment: Deployment tests can be run with pnpm test:deployment --network <network>, the following environment variables allow customizing the test suite for different scenarios:
    • TEST_DEPLOYMENT_STEP (default: 1) - Specify the latest deployment step that has been executed. Tests for later steps will be skipped.
    • TEST_DEPLOYMENT_TYPE (default: migrate) - The deployment type protocol/migrate that is being tested. Test suite has been developed for migrate use case but can be run against a protocol deployment, likely with some failed tests.
    • TEST_DEPLOYMENT_CONFIG (default: hre.network.name) - The Ignition config file name to use for the test suite.

Verification

To verify contracts on a network, run the following commands:

./scripts/pre-verify <ignition-deployment-id>
npx hardhat ignition verify --network <network> --include-unrelated-contracts <ignition-deployment-id>
./scripts/post-verify