-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #263 This PR adds a basic subgraph configuration for the [AcreBitcoinDepositor](https://sepolia.etherscan.io/address/0x37E34EbC743FFAf96b56b3f62854bb7E733a4B50) contract. The code was generated automatically by using [graph init ](https://thegraph.com/docs/en/developing/creating-a-subgraph/#from-an-example-subgraph)command. The project also includes eslint and prettier configurations. Docker was used to run the subgraph locally. Currently, `AcreBitcoinDepositor` is deployed on the Sepolia Testnet network but it will eventually be on the Ethereum Mainnet. During the work there were a lot of problems over setting up the RPC correctly. Using the RPC from Alchemy there was a problem with the error 429 too many requests. Therefore, for this reason, it was decided to set some extra [parameters](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md) to reduce requests. However, if you have any suggestions on which RPC we should use or see another solution let me know. Currently, this solution seems the simplest to unblock the next work on data fetching with subgraph. <img width="1722" alt="Screenshot 2024-03-04 at 10 38 28" src="https://github.com/thesis/acre/assets/23117945/7b110819-560e-4d17-8f78-78bd9f4ba851">
- Loading branch information
Showing
23 changed files
with
3,066 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
name: Subgraph | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "subgraph/**" | ||
pull_request: | ||
|
||
defaults: | ||
run: | ||
working-directory: ./subgraph | ||
|
||
jobs: | ||
subgraph-codegen: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up pnpm | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: "subgraph/.nvmrc" | ||
cache: "pnpm" | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --prefer-offline --frozen-lockfile | ||
|
||
- name: Codegen | ||
run: pnpm run codegen | ||
|
||
- name: Upload Codegen Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: subgraph-codegen | ||
path: | | ||
subgraph/generated | ||
if-no-files-found: error | ||
|
||
subgraph-format: | ||
needs: [subgraph-codegen] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up pnpm | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: "subgraph/.nvmrc" | ||
cache: "pnpm" | ||
|
||
- name: Download Codegen Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: subgraph-codegen | ||
path: subgraph/generated | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --prefer-offline --frozen-lockfile | ||
|
||
- name: Format | ||
run: pnpm run format | ||
|
||
subgraph-build: | ||
needs: [subgraph-codegen] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up pnpm | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: "subgraph/.nvmrc" | ||
cache: "pnpm" | ||
|
||
- name: Download Codegen Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: subgraph-codegen | ||
path: subgraph/generated | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --prefer-offline --frozen-lockfile | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
subgraph-test: | ||
needs: [subgraph-codegen] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up pnpm | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: "subgraph/.nvmrc" | ||
cache: "pnpm" | ||
|
||
- name: Download Codegen Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: subgraph-codegen | ||
path: subgraph/generated | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --prefer-offline --frozen-lockfile | ||
|
||
- name: Tests | ||
run: pnpm run test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ core/ | |
dapp/ | ||
website/ | ||
sdk/ | ||
subgraph/ | ||
|
||
# Auto-generated files. | ||
pnpm-lock.yaml |
Oops, something went wrong.