Skip to main content

Manifest

Manifest is a file that describes the subgraph. It contains information about the entities, events, and mappings that make up the subgraph. We currently support EVM only chains.

Manifest Structure

Below is a standard manifest file for a LayerG subgraph.

name: "ethereum-starter"
version: "1.0.0"
description: "This project serves as a starting point for an Ethereum indexer."
schema:
file: "./schema.graphql"
network:
name: "nebulas"
chainId: "2484"
endpoint:
- "https://rpc-nebulas-testnet.uniultra.xyz"
dataSources:
- kind: EthereumDatasourceKind.Runtime
startBlock: 16213720
options:
address: "0x1b122eff77d9a54d6c773c971f6acb6aaa9f90a8"
abis:
- name: "URC721"
file: "./abis/URC721.json"
- name: "URC4906"
file: "./abis/URC4906.json"
mapping:
handlers:
- kind: EthereumHandlerKind.Event
handler: "HandleTransfer"
filter:
topics:
- "Transfer(address indexed from, address indexed to, uint256 amount)"
- kind: EthereumHandlerKind.Event
handler: "MetadataUpdate"
filter:
topics:
- "MetadataUpdate(uint256 tokenId)"
- kind: EthereumDatasourceKind.Runtime
startBlock: 16213720
options:
address: "0xeddd02437aa5db6def90ff32c329decd2bcb86db"
abis:
- name: "URC1155"
file: "./abis/URC1155.json"
mapping:
handlers:
- kind: EthereumHandlerKind.Event
handler: "HandleTransferSingle"
filter:
topics:
- "TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value)"
- kind: EthereumHandlerKind.Event
handler: "HandleTransferBatch"
filter:
topics:
- "TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values)"
repository: "https://github.com/subquery/ethereum-subql-starter"

The manifest is a JSON file that describes the subgraph. It contains the following fields:

1. Metadata Information

  • name: Specifies the project name (ethereum-starter).

  • version: Defines the current version of the indexer (1.0.0).

  • description: Provides a short description of the project's purpose, in this case, serving as a starting point for an Ethereum indexer.

2. Schema Definition

  • schema.file: Points to the GraphQL schema file (./schema.graphql). This file defines the data structures and types that the indexer will store and query.

3. Network Configuration

  • network.name: Defines the network name.

  • network.chainId: Specifies the blockchain network's chain ID. This uniquely identifies the network.

  • network.endpoint: Lists one or more RPC endpoints for connecting to the blockchain.

4. Data Sources

The dataSources section defines the smart contracts being indexed, their starting blocks, ABI definitions, and event handlers.

  • kind: Specifies the data source type (EthereumDatasourceKind.Runtime).

  • startBlock: Indicates the block number from which the indexer starts processing events.

  • options.address: The Ethereum contract address (0x1b122eff77d9a54d6c773c971f6acb6aaa9f90a8).

  • options.abis: Defines the ABI (Application Binary Interface) files required to decode contract interactions.

  • mapping.handlers: Defines event handlers to process smart contract events:

  • handler: Specifies the event handler name.

  • filter: Specifies the event filter criteria.

  • topics: Defines the event topics to filter on.