Skip to content

Commit

Permalink
Merge pull request #5 from ajna-finance/1708
Browse files Browse the repository at this point in the history
rc3 stuff missed from last PR
  • Loading branch information
EdNoepel authored Mar 24, 2023
2 parents 5b57602 + 8f96cf5 commit d7dc4b3
Show file tree
Hide file tree
Showing 28 changed files with 4,189 additions and 1,402 deletions.
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

0 comments on commit d7dc4b3

Please sign in to comment.