How to deploy OKTC subgraph#

Develop subgraph#

Code specification#

Refer to: https://github.com/okx-subgraph/oktc-subgraph-example/blob/main/docs/Developing.md

Version requirement#

  • "@graphprotocol/graph-cli": "^0.20.1"
  • "@graphprotocol/graph-ts": "^0.20.1"
  • "npm": "^7.20.5"

Block height requirement#

Upload subgraph code to Github#

Special notes

  • If the code repository is a private repository, you need to add your OKC Github account subgraph@okx.com. (This step isn’t required for public code repositories)
  • Before uploading the subgraph code, please make sure it’s been compiled

Deploy the subgraph on the hosted service#

OKC will help you with the deployment

With the subgraph deployed, you can query the Graph#

After the subgraph is deployed, it takes some time to synchronize the block height before it can be queried.