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

feat: Adding Light-Bridge GoldSky subgraphs #90

Merged
merged 9 commits into from
Feb 16, 2024
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ crytic-export

# ignore yarn.lock
boba-community/*/yarn.lock

# local data
packages/boba/subgraphs/local/data
58 changes: 58 additions & 0 deletions packages/boba/subgraphs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Goldsky subgraphs
Subgraphs have been migrated to Goldsky, more contracts may follow (we may need to evaluate which subgraphs are still needed).
For old subgraphs please refer to the [legacy repository](https://github.com/bobanetwork/boba/tree/develop/packages/boba/subgraph).

## Install GoldSky
`curl https://goldsky.com | sh`

or refer to the official documentation: https://docs.goldsky.com/introduction

Hint: You can also directly migrate your already deployed subgraphs from The Graph to GoldSky.

## Configuration
With GoldSky you only need to add your ABI into the `./abi` folder and create a configuration file (refer to `lightbridge.json`).

Here is also some official [GoldSky documentation](https://docs.goldsky.com/subgraphs/introduction).

To deploy your subgraphs execute:
`goldsky subgraph deploy {NAME_OF_SUBGRAPH}/v{VERSION} --from-abi ./{YOUR_CONFIG_JSON}.json`

Here is an example:
`goldsky subgraph deploy light-bridge/v1 --from-abi ./lightbridge.json`

## API / Account
We already have a GoldSky account. As of 18. Dec 23 following people have already access that you can reach out to for access:
- Boyuan
- Souradeep
- Kevin

wsdt marked this conversation as resolved.
Show resolved Hide resolved
## Online dashboard
You can view your subgraphs [here](https://app.goldsky.com/dashboard/subgraphs).
This dashboard also gives you access to your subgraphs directly, so that you can test out queries.

## Queries
GoldSky already generates GraphQL types for, that you can use in your queries (which make your querying much more powerful and easier).

An example:

```graphql
query Teleportation($wallet: String!, $sourceChainId: BigInt!) {
assetReceiveds(
where: {and: [{emitter_contains_nocase: $wallet}, { sourceChainId: $sourceChainId }]}
) {
token
sourceChainId
toChainId
depositId
emitter
amount
block_number
timestamp_
transactionHash_
}
}
```

- `emitter_contains_nocase` is a non-standard operation, most GraphQL providers don't support case insensitive querying.
- `block_number`, `timestamp_`, `transactionHash_` and many others are indexed/queryable as well, despite not being part of the on-chain event.

Loading