Skip to content
Merged
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
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

# Checklist

- [ ] Ran `yarn prepare:arbitrum-one` and verified `graph codegen` and `graph build` succeed.
- [ ] (Optional) Validated locally with `yarn deploy:local`.
- [ ] Confirmed the Subgraph Studio preview link in the PR comment works and the subgraph syncs without errors.
24 changes: 15 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- main
tags:
- "*"

jobs:
deploy:
Expand Down Expand Up @@ -67,14 +69,18 @@ jobs:
${{ steps.deploy_preview.outputs.studio_query_url }}
```

# NOTE: disabled until Goerli testnet is deployed
# - name: Deploy to Arbitrum Goerli
# if: github.ref != 'refs/heads/main'
# run: yarn deploy:arbitrum-goerli --deploy-key $SUBGRAPH_ACCESS_TOKEN
# # NOTE: disabled until testnet is deployed
# - name: Deploy to Arbitrum Goerli (main)
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# env:
# SUBGRAPH_ACCESS_TOKEN: ${{ secrets.SUBGRAPH_ACCESS_TOKEN }}
- name: Deploy to Arbitrum One
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
# DEPLOY_KEY: ${{ secrets.ARBITRUM_GOERLI_DEPLOY_KEY }}
# VERSION_LABEL: ${{ steps.short_sha.outputs.short_sha }}
# run: |
# yarn deploy:arbitrum-goerli -- --version-label "$VERSION_LABEL" --deploy-key "$DEPLOY_KEY"
- name: Deploy to Arbitrum One (tag)
if: startsWith(github.ref, 'refs/tags/')
env:
ARBITRUM_ONE_DEPLOY_KEY: ${{ secrets.ARBITRUM_ONE_DEPLOY_KEY }}
run: yarn deploy:arbitrum-one --deploy-key $ARBITRUM_ONE_DEPLOY_KEY
DEPLOY_KEY: ${{ secrets.ARBITRUM_ONE_DEPLOY_KEY }}
VERSION_LABEL: ${{ github.ref_name }}
run: |
yarn deploy:arbitrum-one -- --version-label "$VERSION_LABEL" --deploy-key "$DEPLOY_KEY"
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing

Thanks for your interest in contributing to our subgraph. We want this to be friendly, clear,
and low-friction for everyone.

## Ways to contribute

- Report a bug or regression.
- Propose a feature or improvement.
- Improve docs or tests.
- Help with reviews.

## Issues first, then assignments

For most work, please open an issue before starting:

1. Create or find the issue.
2. Ask to be assigned in a comment.
3. Wait for a maintainer to assign you before starting work.

This helps us avoid duplicated effort and align on scope.

## Pull request workflow

1. Fork the repo and create your branch from the default branch.
2. Keep changes focused and scoped to the issue.
3. Add tests or update docs where appropriate.
4. Open a PR and link the issue it resolves.

## Deployment workflow

1. CI deploys a Subgraph Studio preview and posts the link as a PR comment.
2. Reviewers should confirm the Studio deployment fully syncs without errors.
3. After approval, merge to `main` to trigger a testnet deployment (if enabled).
4. Tag releases publish to the on-chain Graph Network (any tag triggers the workflow).

## License

By contributing, you agree that your contributions will be licensed under the
license specified in this repository.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,23 @@ each network (arbitrum-one and arbitrum-goerli). The network can be changed via
`NETWORK_NAME` environment variable or directly by choosing a different
"prepare" script. See [package.json](./package.json) for all options.

### Deploy the Livepeer Subgraph to the Graph's hosted service (recommended)
### Deploy the Livepeer Subgraph with Subgraph Studio

Follow the instructions documented
[here](https://thegraph.com/docs/deploy-a-subgraph).
Deploy to Subgraph Studio first, then publish to the decentralized Graph Network
from the Studio UI. For more information, see the [Subgraph Studio
documentation](https://thegraph.com/docs/en/subgraphs/developing/deploying/using-subgraph-studio/).

Example deploy:

```bash
yarn deploy:arbitrum-one -- --version-label <version-label> --deploy-key <deploy-key>
```

You can also override the subgraph name for the generic deploy script:

```bash
SUBGRAPH=livepeer/arbitrum-one yarn deploy -- --version-label <version-label> --deploy-key <deploy-key>
```

### Deploy the Livepeer Subgraph locally

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"codegen": "graph codegen --output-dir src/types/",
"create:docker": "graph create livepeer/livepeer --node http://graph-node:8020",
"create:local": "graph create livepeer/livepeer --node http://127.0.0.1:8020",
"deploy:arbitrum-one": "yarn prepare:arbitrum-one && SUBGRAPH=livepeer/arbitrum-one yarn deploy",
"deploy:arbitrum-goerli": "yarn prepare:arbitrum-goerli && SUBGRAPH=livepeer/arbitrum-goerli yarn deploy",
"deploy:arbitrum-one": "yarn prepare:arbitrum-one && graph deploy livepeer",
"deploy:arbitrum-goerli": "yarn prepare:arbitrum-goerli && graph deploy livepeer/arbitrum-goerli",
"deploy:docker": "yarn prepare:development && graph deploy livepeer/livepeer -l \"v0.0.1\" --ipfs http://ipfs:5001 --node http://graph-node:8020",
"deploy:local": "yarn prepare:development && graph deploy livepeer/livepeer -l \"v0.0.1\" --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
"deploy": "graph deploy $SUBGRAPH --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy": "graph deploy ${SUBGRAPH:-livepeer}",
"docker:build": "docker build --cache-from livepeer/subgraph:latest -t livepeer/subgraph:latest .",
"prepare:arbitrum-one": "TS_NODE_PROJECT='./tsconfig.hardhat.json' NETWORK_NAME=arbitrum-one ts-node ./templatify.ts",
"prepare:arbitrum-goerli": "TS_NODE_PROJECT='./tsconfig.hardhat.json' NETWORK_NAME=arbitrum-goerli ts-node ./templatify.ts",
Expand Down