> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying an Indexer (Subgraph) on Scroll with The Graph

> Find out how to deploy a subgraph on Scroll using The Graph for efficient blockchain data indexing and querying.

Deploying a subgraph on Scroll with Mobula’s infrastructure is a simple process. This guide will take you through the steps to get your subgraph running on the Scroll network.

### What you’ll need

* Fundamental understanding of The Graph and subgraphs.
* Your subgraph project files ready.
* The Graph CLI installed.
* A Mobula API key (for authentication).

### Walkthrough

<Steps>
  <Step title="Prepare Your Subgraph">
    Make sure your subgraph is configured for Scroll. Update your `subgraph.yaml` file to point to Scroll-specific contracts and events. If you don’t have a subgraph, you can clone the Uniswap V2 (SushiSwap) subgraph template and customize it for Scroll:

    ```bash theme={null}
    git clone https://github.com/MobulaFi/univ2-subgraph-scroll
    ```
  </Step>

  <Step title="Install Dependencies">
    Make sure you have The Graph CLI installed:

    ```bash theme={null}
    npm install -g @graphprotocol/graph-cli
    ```
  </Step>

  <Step title="Build Your Subgraph">
    Compile your subgraph before deployment:

    ```bash theme={null}
    graph codegen && graph build
    ```
  </Step>

  <Step title="Create the Subgraph">
    Use the following command to deploy your subgraph:

    ```bash theme={null}
    graph create --node https://subgraph.mobula.io:8020
    ```
  </Step>

  <Step title="Deploy to Mobula's Scroll Node">
    Use the following command to deploy your subgraph:

    ```bash theme={null}
    graph deploy --node https://subgraph.mobula.io:8020 --ipfs https://subgraph.mobula.io:5001 --network scroll
    ```
  </Step>

  <Step title="Authenticate">
    When asked, enter your Mobula API key for authentication. For further details on acquiring and using your API key, refer to the [authentication section](https://docs.mobula.io/indexing-stream/authentification).
  </Step>

  <Step title="Monitor Deployment">
    Following deployment, you’ll be provided with a URL to track your subgraph’s indexing progress and status.
  </Step>
</Steps>

### Best Practices

* Keep your subgraph regularly updated to ensure it remains compatible with the latest Scroll network changes.
* Thoroughly test your subgraph on a testnet before deploying to the mainnet.
* Continuously monitor its performance and optimize queries for greater efficiency.

### Troubleshooting

If you encounter issues during deployment:

* Review your `subgraph.yaml` configuration.
* Confirm that you're using the correct network name and Mobula node URLs.
* Ensure your API key is valid and has the required permissions.

Need help? Our support team is available to assist with any questions or deployment challenges you may face.

<CardGroup>
  <Card title="Support" icon="Telegram" href="https://t.me/mobuladevelopers">Telegram</Card>
  <Card title="Support" icon="Slack" href="https://join.slack.com/t/mobulaapi/shared_invite/zt-29zrrpjnl-I0tyD73sy7zKy8q~KLL3Ug">Slack</Card>
  <Card title="Support" icon="Discord" href="https://discord.gg/JVT7xKm3AD">Discord</Card>
  <Card title="Email Support" icon="envelope" href="mailto:contact@mobulalabs.org">Email</Card>
</CardGroup>
