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

Acre subgraph #280

Merged
merged 22 commits into from
Mar 18, 2024
Merged

Acre subgraph #280

merged 22 commits into from
Mar 18, 2024

Conversation

kkosiorowska
Copy link
Contributor

@kkosiorowska kkosiorowska commented Feb 29, 2024

Closes #263

This PR adds a basic subgraph configuration for the AcreBitcoinDepositor contract. The code was generated automatically by using graph init 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 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.

Screenshot 2024-03-04 at 10 38 28

@kkosiorowska kkosiorowska self-assigned this Feb 29, 2024
@kkosiorowska kkosiorowska changed the base branch from tbtc-depositor to main March 1, 2024 07:48
@kkosiorowska kkosiorowska changed the base branch from main to tbtc-depositor March 1, 2024 07:48
Added subgraph initialization for AcreBitcoinDepositor on Sepolia Testnet. This is the initial configuration generated from the command: `graph init --studio <SUBGRAPH_SLUG>` .
Add docker-compose file to run the graph node locally and update the readme file- describe how to deploy the subgraph locally.
@kkosiorowska kkosiorowska changed the base branch from tbtc-depositor to main March 1, 2024 08:13
@nkuba
Copy link
Member

nkuba commented Mar 1, 2024

Let's rename the main directory from acre-subgraph to subgraph 🙏🏻

In order to index a network, Graph Node needs access to a network client via an EVM-compatible JSON-RPC API. Let's use RPC from alchemy to do this so that everyone can use their API key.  Updated extra parameters to avoid the error of too many requests.
Copy link

netlify bot commented Mar 4, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 8df7eb8
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/65f80fdac4f86900088ee3cf
😎 Deploy Preview https://deploy-preview-280--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kkosiorowska kkosiorowska marked this pull request as ready for review March 4, 2024 10:29
Copy link

cloudflare-workers-and-pages bot commented Mar 5, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: eaf44d7
Status:🚫  Build failed.

View logs

Copy link

netlify bot commented Mar 5, 2024

Deploy Preview for acre-solidity-docs ready!

Name Link
🔨 Latest commit eaf44d7
🔍 Latest deploy log https://app.netlify.com/sites/acre-solidity-docs/deploys/65e74b7805ba0300088766cc
😎 Deploy Preview https://deploy-preview-280--acre-solidity-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Dependency to @keep-network/tbtc-v2 was wrongly resolved (merge commit).
It should be version: 1.6.0-dev.24(@keep-network/[email protected])
Copy link
Contributor

@r-czajkowski r-czajkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Left minor comments. Let's just update the pre-commit-config to run linting before git commit.

Comment on lines 12 to 13
"lint:eslint": "eslint .",
"lint:eslint:fix": "eslint . --fix",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep consistency with other modules in monorepo.

Suggested change
"lint:eslint": "eslint .",
"lint:eslint:fix": "eslint . --fix",
"lint:js": "eslint .",
"lint:js:fix": "eslint . --fix",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 16 to 17
"format": "pnpm lint:eslint && pnpm lint:config",
"format:fix": "pnpm lint:eslint:fix && pnpm lint:config:fix"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"format": "pnpm lint:eslint && pnpm lint:config",
"format:fix": "pnpm lint:eslint:fix && pnpm lint:config:fix"
"format": "npm lint:js && npm lint:config",
"format:fix": "npm lint:js:fix && npm lint:config:fix"

Not sure if we should call pnpm or npm but to keep consistency with other modules maybe let's use npm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,31 @@
{
"name": "acre-subgraph",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"name": "acre-subgraph",
"name": "@acre-btc/subgraph",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,31 @@
{
"name": "acre-subgraph",
"license": "UNLICENSED",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"license": "UNLICENSED",
"license": "GPL-3.0-only",

cc @nkuba

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,31 @@
{
"name": "acre-subgraph",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's add "version": "0.0.1" as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an initial implementation of the CI process to check the formatting and building in `subgraph` workspace.
There was an error during run tests about missing `assemblyscript` package. This problem occurs with pnpm. Matchstick does not play well with pnpm because of how pnpm handles dependencies. To avoid this problem, let's install this package separately.

More info: LimeChain/matchstick#324 (comment)
Copy link
Contributor

@r-czajkowski r-czajkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left few minor comments.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
.github/workflows/reusable-subgraph-codegen.yaml Outdated Show resolved Hide resolved
.github/workflows/subgraph.yaml Outdated Show resolved Hide resolved
subgraph/.eslintrc Show resolved Hide resolved
subgraph/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@r-czajkowski r-czajkowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀 @nkuba could you please take a final look at GH workflow?

@nkuba nkuba enabled auto-merge March 18, 2024 09:58
@nkuba nkuba merged commit 81717eb into main Mar 18, 2024
24 checks passed
@nkuba nkuba deleted the acre-subgraph branch March 18, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subgraph: Initial configuration
3 participants