How to run index custom data?
To to deploy your subgraph on movement mevm devnet.
Step 1. Create Subgraph
Create your subgraph: https://thegraph.com/docs/en/developing/creating-a-subgraph/
Once done, Make sure to set network to devnet
NOTE: Set your
networktodevnetin yoursubgraph.yamlfile manually. It will not be listed in thegraph initcommand because mevm is not yet supported by thegraph.
Your subgraph.yaml should look something like this:
specVersion: 0.0.4
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum
name: ERC1155
network: devnet
source:
abi: ERC1155
address: "0x4114e6516413c5ba631002a0cf95e828714f8f18"
startBlock: 1785835
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- NFT
- NftData
- NftApprovalForAll
abis:
- name: ERC1155
file: ./abis/ERC1155.json
eventHandlers:
- event: TransferBatch(indexed address,indexed address,indexed address,uint256[],uint256[])
handler: handleTransferBatch1155
- event: TransferSingle(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleTransferSingle1155
- event: URI(string,indexed uint256)
handler: handleURI1155
- event: ApprovalForAll(indexed address,indexed address,bool)
handler: handleApprovalForAll1155
file: ./src/mapping.tsStep 2. Get AUTH TOKEN from LYNC team
AUTH TOKEN from LYNC teamGet your AUTH TOKEN from LYNC Team
Step 3. Set your AUTH TOKEN to prepare for deployment
AUTH TOKEN to prepare for deploymentIn your subgraph directory run:
This will prompt you to enter your deploy key. Pass the AUTH TOKEN in there.
Step 4: Create a new subgraph
Note: Replace the <PROJECT>/<NAME> accordingly. Example lync/nfts
If you have properly setup the correct AUTH TOKEN and subgraph name you should see output like this:

If you get any error(s) refer to the Troubleshooting section
Step 5: Deploy you created subgraph:
In the subgraph directory after completing the above steps run:
Note: Replace the <PROJECT>/<NAME> accordingly. Example lync/nfts
If everything goes right you will see output like:

Note: Currently we do not have any validations on version label so it can be anything.
Also, you can ignore the HTTP queries endpoint that is shown in the output.
The subgraph will be deployed on:
Note: Replace the <PROJECT>/<NAME> accordingly. Example lync/nfts
You can use this endpoint to query your subgraph data using graphql.
Troubleshooting
If while deploying the subgraph you face any errors like:
Here, take a look at the error code. 480 in the output above.
470
Naming format not followed properly
The name of the subgraph should be in the format <PROJECT>/<NAME>
480
Name already taken
Reuse of the subgraph name is not allowed. Use a different name.
Last updated