本文提供了两个 subgraph 的示例,展示了如何配置 subgraph manifest 文件来索引以太坊 Goerli 网络上的智能合约事件。第一个示例针对简单的 ERC20 代币,第二个示例扩展到包括 Ownable、Pausable 和 TimelockController 合约,演示了如何处理多个数据源。
本文介绍了如何使用@amxx/graphprotocol-utils包中的graph-compile工具,为应用程序自动生成定制的 schema 和 manifest 文件。文章通过一个配置示例,演示了如何索引以太坊主网上的多个合约,并使用 OpenZeppelin Subgraphs 提供的模块来简化开发流程,最后介绍了如何使用graph-cli工具部署 subgraph。
@amxx/graphprotocol-utils
graph-compile
graph-cli