How to use

Basically, you can deploy as same way with TheGraph. 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 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>".

Last updated