Skip to content

Commit

Permalink
Subgraph: Exposing data to populate Activity Details for stake operat…
Browse files Browse the repository at this point in the history
…ion (#330)

> Closes: #269 

---

### Subgraph: Activity Details for deposit operation

---

### What was done
- Handled `handleDepositInitialized` event
- Handled `handleDepositFinalized` event
- Added entities: [`DepositOwner`, `Deposit`, `Withdraw`, `Event`] &
interface `ActivityData`
- Added unit tests
- Update README.md file
- Bumped specVersion to 1.0.0 to enable auto pruning

---

### Preview

<img width="1728" alt="Screenshot 2024-04-18 at 16 21 21"
src="https://github.com/thesis/acre/assets/28560653/1cc56b1b-b13e-4731-827d-5ee28bad684c">

---

### Additional info

DEVELOPMENT QUERY URL - LATEST VERSION:

[https://api.studio.thegraph.com/query/69074/a-test/version/latest⁠](https://api.studio.thegraph.com/query/69074/a-test/version/latest)
  • Loading branch information
r-czajkowski authored Apr 30, 2024
2 parents 7cd0798 + dba5ce1 commit efcb6ed
Show file tree
Hide file tree
Showing 14 changed files with 665 additions and 1,336 deletions.
2 changes: 1 addition & 1 deletion subgraph/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
...require("../.prettierrc.js"),
...require("../.prettierrc.js"),
}
59 changes: 55 additions & 4 deletions subgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,79 @@ EVM-compatible JSON-RPC API. You can use Thesis private RPC from Alchemy or
create a private one
[here](https://www.alchemy.com/overviews/private-rpc-endpoint).

1. Set the API key in the `docker-compose.yaml` file.
1. Install Docker on your local machine:

- Mac: https://docs.docker.com/desktop/install/mac-install/
- Windows: https://docs.docker.com/desktop/install/windows-install/
- Linux: https://docs.docker.com/desktop/install/linux-install/

2. Set the API key in the `docker-compose.yaml` file.

```
ethereum: "sepolia:https://eth-sepolia.g.alchemy.com/v2/<API key>"
```

2. Run a local Graph Node:
3. Run a local Graph Node:

```
docker-compose up
```

3. Allocate the subgraph name in the local Graph Node:
4. Allocate the subgraph name in the local Graph Node:

```
pnpm create-local
```

Note: use it only if your subgraph is not created in the local Graph node.

4. Deploy the subgraph to your local Graph Node:
5. Deploy the subgraph to your local Graph Node:

```
pnpm deploy-local
```

6. Create Subgraph queries and preview of the entities:

```
http://localhost:8000/subgraphs/name/acre-subgraph
```

### Deploy the subgraph to Subgraph Studio

1. You need to connect wallet to use Subgraph Studio [Metamask, WalletConnect, Coinbase Wallet or Safe].

```
https://thegraph.com/studio/
```

2. We're going to create a Subgraph. To do that you need to click Create a Subgraph button in My Dashboard of Subgraph Studio.

3. In the next step you'll need to add name of Subgraph and choose indexed blockchain from the list.

4. Once your subgraph has been created in Subgraph Studio you can initialize the subgraph code using this command:

```
graph init --studio <SUBGRAPH_SLUG>
```

The <SUBGRAPH_SLUG> value can be found on your subgraph details page in Subgraph Studio
(https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-studio/#create-your-subgraph-in-subgraph-studio)

5. Before being able to deploy your subgraph to Subgraph Studio, you need to login into your account within the CLI.

```
graph auth --studio <DEPLOY KEY>
```

The <SUBGRAPH_SLUG> can be found on your "My Subgraphs" page or your subgraph details page.

6. Deploying a Subgraph to Subgraph Studio

```
graph deploy --studio <SUBGRAPH_SLUG>
```

After running this command, the CLI will ask for a version label, you can name it however you want, you can use labels such as 0.1 and 0.2 or use letters as well such as uniswap-v2-0.1.

7. More information about deploying your subgraph to Subgraph Studio: https://thegraph.com/docs/en/deploying/subgraph-studio/
Loading

0 comments on commit efcb6ed

Please sign in to comment.