> ## 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.

# Deploy an Indexer (Subgraph) on Alvey Chain with The Graph

> Step-by-step guide for deploying a subgraph on Alvey Chain using The Graph for efficient blockchain data indexing and querying.

Creating a subgraph on Alvey using Mobula’s infrastructure is a straightforward task. This guide will help you set up and deploy your subgraph on the Alvey network efficiently.

### What you’ll need

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

### Walkthrough

<Steps>
  <Step title="Prepare Your Subgraph">
    Set up your subgraph for Alvey Chain. Update your `subgraph.yaml` file to reference Alvey specific contracts and events. If you don't have a subgraph, you can clone the Uniswap V2 (AlveySwap) subgraph template and adapt it for Alvey Chain:

    ```bash theme={null}
    git clone https://github.com/MobulaFi/univ2-subgraph-alveychain
    ```
  </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="Install Mobula CLI">
    Install our CLI tool using npm:

    ```bash theme={null}
    npm i mobula-cli
    ```
  </Step>

  <Step title="Setup API Key">
    Configure your API key with the CLI. You can get your API key from the [Dashboard](https://admin.mobula.io).
    Please refer to the [authentication section](/indexing-stream/authentification) for detailed steps on obtaining your API key.

    ```bash theme={null}
    mob apikey set
    ```
  </Step>

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

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

  <Step title="Deploy your subgraph">
    Deploy your subgraph using the Mobula CLI:

    ```bash theme={null}
    mob deploy -n subgraphName
    ```
  </Step>

  <Step title="Monitor Deployment">
    After deployment, you'll receive a URL to monitor your subgraph's indexing progress and status.
  </Step>
</Steps>

### Best Practices

* Keep your subgraph up to date to ensure it aligns with the latest Alvey Chain changes.
* Conduct comprehensive testing on a testnet before mainnet deployment.
* Continuously monitor performance and fine-tune queries for maximum efficiency.

### Troubleshooting

If you encounter deployment problems:

* Double-check your `subgraph.yaml` configuration.
* Verify that the network name and Mobula node URLs are correct.
* Make sure your API key is valid and properly authorized.

Need assistance? Our support team is ready to help with any questions or deployment challenges.

<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>
