connect-thegraph-voting
. Then follow the steps below to modify the contents for your needs.package.json
, you’ll find a number of scripts that reference the user "aragon" and the application "voting". Change these to your user (or Github organization’s name) and your application’s name.package.json
will generate your subgraph.yaml
manifest file and deploy your Subgraph with a very specific nomenclature.yarn deploy-mainnet
, you’ll deploy a Subgraph named "Aragon Voting Mainnet". If you run yarn deploy-mainnet-staging
, you’ll deploy a Subgraph named "Aragon Voting Mainnet Staging". Make sure these Subgraphs are already created in The Graph’s explorer dashboard.Aragon <AppName> <Network> [Staging]
.subgraph.yaml
file at the root is actually a generated file and should not be edited. This is why you may not find this file at the root of the project until it is generated first.subgraph.template.yaml
. You will notice that there are a number of Mustache tags in this file. You don't have to worry about this yet! Initially, the only sections you should modify is whatever is not a Mustache tag. You can define static data sources in the dataSources
section and dynamic data sources in the templates
section.OrganizationTemplates
data source, you can use an exclamation symbol:abis
folder.Vote
and Cast
entities. These entities were defined with just an ID, and their properties were added as the Subgraph was developed.subgraph.template.yaml
reference files in src
that need to be implemented. In the example Voting Subgraph, you’ll find such definitions in src/Voting.ts
. These mappings specify what the Subgraph should do whenever a relevant event to a Voting app was detected.src/aragon-hooks
, you’ll find a series of hooks that can be used to react to specific events that occur in the background of any specific app. For example, you can react to when an organization was first detected by creating an entity that is then used by your Subgraph.getTemplateForApp\(...\)
hook allows you to specify the name of a data source template that you’d like to create when a specific app instance is newly detected. See the example Voting Subgraph's aragon-hooks
as an example of this applied to instances of the Voting app.-staging
. This will use data provided from manifest/data
's JSON files to determine which data sources to use for indexing the staging version of your Subgraph.yarn deploy-mainnet-staging
, manifest/data/mainnet-staging.json
will be used to generate your Subgraph manifest. This JSON file defines a single data source with the PieDAO organization. The resulting deployment will effectively sync very quickly, which should allow you to iterate on your Subgraph without having to wait for long periods of time before you can start testing.GRAPHKEY
environment variable before running a deploy-
script.GRAPHKEY=<key> yarn deploy-mainnet
(without -staging
!). This will use manifest/data/mainnet.json
, which contains many Aragon data sources, such as the templates used by most users to create an organization. This will allow your Subgraph to find all the organizations out there, and as in the example, index all instances of the specified apps.src/base/Kernel.ts
when the NewAppProxy
event is detected in an Organization. You need to include the missing ABI in manifest/templates/contracts/Kernel.template.yaml
for it to be available in this reducer.manifest/templates/contracts
files.callHandlers
aren’t working