Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc3 stuff missed from last PR #5

Merged
merged 12 commits into from
Mar 24, 2023
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ sudo yarn global add @graphprotocol/graph-cli
yarn install
```

Configure `ETH_RPC_URL` for your target network in `.env`.

If you will change ABIs, please install `jq`.

## Querying

Below are some examples of queries that can be made to the Ajna Subgraph.

```
{
pools {
id
createdAtBlockNumber
createdAtTimestamp
txCount
}
}
```

## Development

Commands for adding new data sources to the subgraph are listed in the [add-commands.txt](./add-commands.txt) file.
Expand All @@ -25,7 +44,6 @@ npm run build

This subgraph can be run locally using provided docker containers. To start, set the environment variable *ETH_RPC_URL* in your .env file. Then, run `docker-compose up`. Once the node is running, deploy the subgraph with:
```
npm run build
npm run create-local
npm run deploy-local
```
Expand All @@ -41,28 +59,15 @@ Run the Matchstick tests by executing:
npm run test
```

## Querying

Below are some examples of queries that can be made to the Ajna Subgraph.

```
{
pools {
id
createdAtBlockNumber
createdAtTimestamp
txCount
}
}
```

## Maintenance

To update for new release candidates:
1. Copy ABIs from an `sdk` checkout from the appropriate branch.
```
rsync -avz --existing ../sdk/packages/sdk-api/src/abis abis
```
1. Update ABIs using the provided `copy-abis.sh` script. This script requires `jq` be installed. Note `codegen` and `build` commands are not sensitive to ABI formatting, but deployment is. ABIs formatted by Ethers.js will not work. ABIs generated by `graph add` will not work. In the ABI, note that all _output_ parameters must have a `name` field. It may be blank, but the field must exist.
2. Update addresses in `constants.ts` and `subgraph.yaml`.
3. Run `npm run codegen` to find and resolve errors in code generation.
4. Review contract changes, adjusting subgraph and schema accordingly. Update handlers and unit tests. Run `npm run test` to find and resolve issues.
4. Review contract changes, adjusting subgraph and schema accordingly.
5. Run `npm run build` to and resolve compliation errors.
6. Update handlers, test mocks, and unit tests. Run `npm run test` to find and resolve issues.
7. Start the dockerized environment and perform a local deployment to confirm functionality.

To clean out container data and autogenerated code, run the `clean.sh` script.
Loading