Skip to content

Commit

Permalink
refactor: replace Goerli with Sepolia
Browse files Browse the repository at this point in the history
perf: improve writing and wording
refactor: reorder documents under "Concepts"
refactor: update URL guidance for V2.1
refactor: use JSON instead of TS for code snippets
  • Loading branch information
PaulRBerg committed Dec 30, 2023
1 parent 8d9de8c commit 9e19491
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 117 deletions.
14 changes: 9 additions & 5 deletions docs/api/subgraphs/03-endpoints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import LinkPreview from "@site/src/components/LinkPreview";
| BNB Smart Chain | [Page][v2-explorer-bsc] | [sablier-v2-bsc][v2-endpoint-bsc] | N/A |
| Gnosis | [Page][v2-explorer-gnosis] | [sablier-v2-gnosis][v2-endpoint-gnosis] | N/A |
| Goerli | [Page][v2-explorer-goerli] | [sablier-v2-goerli][v2-endpoint-goerli] | N/A |
| Sepolia | [Page][v2-explorer-sepolia] | [sablier-v2-sepolia][v2-endpoint-sepolia] | N/A |

[v2-endpoint-arbitrum]: https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-arbitrum
[v2-endpoint-avalanche]: https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-avalanche
Expand All @@ -29,6 +30,7 @@ import LinkPreview from "@site/src/components/LinkPreview";
[v2-endpoint-polygon]: https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-polygon
[v2-endpoint-gnosis]: https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-gnosis
[v2-endpoint-goerli]: https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-goerli
[v2-endpoint-sepolia]: https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-v2-sepolia
[v2-explorer-arbitrum]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-arbitrum
[v2-explorer-avalanche]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-avalanche
[v2-explorer-bsc]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-bsc
Expand All @@ -37,6 +39,7 @@ import LinkPreview from "@site/src/components/LinkPreview";
[v2-explorer-polygon]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-polygon
[v2-explorer-gnosis]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-gnosis
[v2-explorer-goerli]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-goerli
[v2-explorer-sepolia]: https://thegraph.com/hosted-service/subgraph/sablier-labs/sablier-v2-sepolia

### Code

Expand Down Expand Up @@ -84,8 +87,9 @@ import LinkPreview from "@site/src/components/LinkPreview";
/>

[^1]:
Because the "Decentralized service" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, you will need
to substitute the `YOUR_API_KEY` placeholder in the
[Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use)
with your own API key. If you require assistance with managing your API keys and configuring indexer preferences,
[this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide.

Because the "Decentralized service" subgraph flavors (e.g. V1 Ethereum) operate on The Graph Network, you will need to
substitute the `YOUR_API_KEY` placeholder in the
[Query URL](https://thegraph.com/docs/en/deploying/subgraph-studio-faqs/#6-how-do-i-find-query-urls-for-subgraphs-if-im-not-the-developer-of-the-subgraph-i-want-to-use)
with your own API key. If you require assistance with managing your API keys and configuring indexer preferences,
[this article](https://thegraph.com/docs/en/studio/managing-api-keys/) serves as an excellent guide.
20 changes: 10 additions & 10 deletions docs/api/subgraphs/05-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ To contribute to the V2 subgraphs or deploy your own, head over to the GitHub
[`v2-subgraphs`](https://github.com/sablier-labs/v2-subgraphs) repository. Get started by reviewing the `packages/core`
directory.

To bootstrap a subgraph project, run the following commands. These will install all the necessary dependencies and
generate the code for a possible `goerli` deployment.
To bootstrap a subgraph project, run the following commands. They will install the requisite dependencies and generate
the code for a Sepolia deployment.

```bash
cd ./packages/core
yarn install
yarn setup:goerli
yarn setup:sepolia
```

To deploy a new subgraph (e.g. on Goerli):
To deploy a new subgraph on Sepolia:

1. make sure to create a new item (e.g. using The Graph's hosted network)
2. add its name/endpoint under the `deploy:goerli` script in `package.json`
3. add your own Sablier V2 contract addresses in `./constants/chains/goerli.ts`
4. make sure you're [authenticated](the-graph-auth) in the terminal
5. run `yarn deploy:goerli`
1. Create a new item using The Graph's hosted network
2. Add its name/endpoint under the `deploy:sepolia` script in `package.json`
3. Add your own Sablier V2 contract addresses in `./constants/chains/sepolia.ts`
4. Make sure you're [authenticated][the-graph-auth] on your local machine
5. Run `yarn deploy:sepolia`

Read more about the way The Graph works in their official [docs](the-graph-docs).
You can read more about how the The Graph works in their [official docs][the-graph-docs].

[the-graph-auth]: https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#store-the-access-token
[the-graph-docs]: https://thegraph.com/docs/en/
19 changes: 10 additions & 9 deletions docs/api/subgraphs/architecture/02-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ items at the contract level, we need to consider the following for both subgraph

To address these observations, the subgraph uses two related identifiers for a Stream.

| Type | Description | Example |
| -------------- | --------------------------------------------------------------------------------------------------- | ---------------------------- |
| `Stream.id` | A self-explanatory structure built using the following structure: `contractAddress-chainId-tokenId` | <nobr>`0xAB..12-5-21`</nobr> |
| `Stream.alias` | A short version of the `id` where the contract is aliased: `contractAlias-chainId-tokenId` | <nobr>`LL-5-21`</nobr> |
| Type | Description | Example |
| -------------- | --------------------------------------------------------------------------------------------------- | ------------------------------ |
| `Stream.id` | A self-explanatory structure built using the following structure: `contractAddress-chainId-tokenId` | <nobr>`0xAB..12-137-21`</nobr> |
| `Stream.alias` | A short version of the `id` where the contract is aliased: `contractAlias-chainId-tokenId` | <nobr>`LL-137-21`</nobr> |

Both examples from the table above translate to: **_a stream on Goerli (chain id `5`), within the Lockup Linear contract
at address `0xAB..12`, with the tokenId `21`_**.
Both examples from the table above translate to: **_a stream on Polygon (chain id `137`), within the Lockup Linear
contract at address `0xAB..12`, with the tokenId `21`_**.

:::note

Expand All @@ -82,9 +82,10 @@ in sync, avoid conflicts and regard them as immutable (once decided, never chang
To provide a simple visual structure, while also accounting for future stream types (backwards compatibility) we use the
following abbreviations as aliases:

- Lockup Linear contracts become `LL` (e.g. `LL-5-1`)
- Lockup Dynamic contracts become `LD` (e.g. `LD-5-1`)
- Contracts with [flash loans](/contracts/v2/guides/flash-loans) enabled become `LLF` or `LLD`
- Lockup Linear V2.0 contracts become `LL`, e.g. `LL-137-1`
- Lockup Linear V2.1 contracts become `LL2`, e.g. `LL2-137-1`
- Lockup Dynamic V2.0 contracts become `LD`, e.g. `LD-137-1`
- Lockup Dynamic V2.1 contracts become `LD2`, e.g. `LD2-137-1`

### Relevant parties

Expand Down
17 changes: 7 additions & 10 deletions docs/api/subgraphs/architecture/03-flow.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,22 @@ best things for a "genesis" point were:

To reduce the number of dependencies required to kickstart a subgraph, we chose to rely on the second approach.
Therefore, when setting up a deployment, you'll need to follow a few
[rules](https://github.com/sablier-labs/v2-subgraphs/blob/main/packages/core/src/constants/chains/goerli.ts).
[rules](https://github.com/sablier-labs/v2-subgraphs/blob/main/packages/core/src/constants/chains/sepolia.ts).

```ts title="core/src/constants/chains/goerli.ts"
export let chainId = 5;
export let chain = "goerli";
```ts title="core/src/constants/chains/sepolia.ts"
export let chainId = 11155111;
export let chain = "sepolia";
export let startBlock = 9283515;

/**
* Keep aliases unique and always in sync with the frontend
* Keep addresses unique and lowercased
* @example export let linear = [[address1, alias2], [address2, alias2]]
* @example export let lockupLinear = [[address1, alias2], [address2, alias2]]
*/

export let linear: string[][] = [["0x6e3678c005815ab34986d8d66a353cd3699103de", "LL"]];
export let lockupLinear: string[][] = [["0x7a43F8a888fa15e68C103E18b0439Eb1e98E4301", "LL2"]];

export let dynamic: string[][] = [["0x4be70ede968e9dba12db42b9869bec66bedc17d7", "LD"]];

/** PRBProxy registry */
export let registry = "0xd42a2bb59775694c9df4c7822bffab150e6c699d";
export let lockupDynamic: string[][] = [["0xc9940AD8F43aAD8e8f33A4D5dbBf0a8F7FF4429A", "LD2"]];

// highlight-start
/**
Expand Down
Loading

0 comments on commit 9e19491

Please sign in to comment.