Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions spot-subgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Graph is a tool for for indexing events emitted on the Ethereum blockchain.

```
Public graphql endpoint:
https://api.thegraph.com/subgraphs/name/ampleforth/spot
https://api.goldsky.com/api/public/project_cmgzjl03n004g5np20v5j3qpx/subgraphs/ampleforth-spot/prod/gn
```

## Getting started
Expand All @@ -26,13 +26,24 @@ Setup project:
yarn
```

To build and deploy the subgraph to the graph hosted service:
To build and deploy the subgraph to the goldsky's hosted service:

```
# local deployment
./scripts/deploy-local.sh sepolia ampleforth-spot-sepolia

# prod deployment
./scripts/deploy.sh sepolia ampleforth-spot-sepolia
./scripts/deploy.sh mainnet ampleforth-spot
```

You should have your own Goldsky API key to use with the Goldsky CLI.
Note you must set the (new) version to deploy to, and then update the tag separately.

```
./scripts/deploy.sh sepolia ampleforth-spot-sepolia <VERSION>
./scripts/deploy.sh mainnet ampleforth-spot <VERSION>
```

Once deployed, update the tag that frg-web-api looks for.

```
goldsky subgraph tag create <SUBGRAPH-NAME>/<VERSION> --tag prod
```
12 changes: 1 addition & 11 deletions spot-subgraph/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,4 @@ set -e

yarn mustache ../spot-contracts/deployments/$1.json subgraph.template.yaml > ./subgraph.yaml

yarn codegen

yarn build

echo "NOTE: graph deploy to Alchemy fails when you redeploy with the same IPFS hash"

# yarn graph auth $THE_GRAPH_API_KEY
# yarn graph deploy $2
yarn graph deploy $2 \
--node https://subgraphs.alchemy.com/api/subgraphs/deploy \
--deploy-key $GRAPH_AUTH
goldsky subgraph deploy $2/$3 --path .
Loading