> For the complete documentation index, see [llms.txt](https://scvsoft.gitbook.io/chaingraph/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scvsoft.gitbook.io/chaingraph/how-to-use.md).

# How to use

Basically, you can deploy as same way with [TheGraph](https://thegraph.com/docs/en/developing/creating-a-subgraph/). Read this link if you want to get more information.

ChainGraph supports Klaytn network, but tool like `graph-cli` doesn't support yet. So, please follow this procedures.

1. First, deploy contract at cypress or baobab.
2. Because `graph-cli` doesn't support Klaytn, we can't [fetch information from deployed contract](https://thegraph.com/docs/en/developing/creating-a-subgraph/#from-an-existing-contract) with `graph init`.
   1. Create a directory, and move into it. Create a file and save the ABI.
   2. Initialize project with `graph init --product hosted-service --protocol ethereum --index-events --from-contract <CONTRACT_ADDRESS> --abi <FILE_PATH> <PROJECT_NAME/SUBGRAPH_NAME>`.
   3. Modify created `subgraph.yaml`.
      1. Change `dataSources.network` value into `cypress` or `baobab`.
      2. Change `dataSources.source.startBlock` into the deployed block number. If there is no field, add one.
   4. Modify `scripts` at created `package.json`.
      1. Add or modify `"create-graph": "graph create --node https://klaytn-node.graph.scv.sh/deploy <PROJECT_NAME/SUBGRAPH_NAME> --access-token <ACCESS_TOKEN>"`.
      2. Add or modify `"deploy": "graph deploy --ipfs https://ipfs.graph.scv.sh --node https://klaytn-node.graph.scv.sh/deploy <PROJECT_NAME/SUBGRAPH_NAME> --deploy-key <ACCESS_TOKEN>"`.
