diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-1_Course Introduction.md b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-1_Course Introduction.md new file mode 100644 index 000000000..bdc39e8e3 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-1_Course Introduction.md @@ -0,0 +1,78 @@ +## GETTING STARTED + +### πŸŽ‰ Course Introduction + +This workshop is built around Scaffold-ETH 2 and The Graph. You will learn how to: + +1. Setup a development environment for your dapp using Scaffold-ETH 2 and The Graph +2. Update and deploy your smart contract +3. Create and deploy a Subgraph to The Graph +4. Edit your frontend to interact with both your smart contract and Subgraph + +### πŸ— What is Scaffold-ETH 2 πŸ— + +πŸ§ͺ An open-source, up-to-date toolkit for building decentralized applications (dapps) on the Ethereum blockchain. It's designed to make it easier for developers to create and deploy smart contracts and build user interfaces that interact with those contracts. + +βš™οΈ Built using NextJS, RainbowKit, Hardhat, Wagmi, and Typescript. + +- βœ… **Contract Hot Reload**: Your frontend auto-adapts to your smart contract as you edit it. +- πŸ”₯ **Burner Wallet & Local Faucet**: Quickly test your application with a burner wallet and local faucet. +- πŸ” **Integration with Wallet Providers**: Connect to different wallet providers and interact with the Ethereum network. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-1.png) + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-2.png) + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-3.png) + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-4.png) + +To learn more about Scaffold-ETH checkout the [Github repository](https://github.com/scaffold-eth/scaffold-eth-2) or [Scaffoldeth.io](https://scaffoldeth.io). + +### πŸ§‘πŸΌβ€πŸš€ What is The Graph? + +[The Graph](https://thegraph.com/) is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL. + +- πŸ—ƒοΈ **Decentralized Indexing**: The Graph enables open APIs ("subgraphs") to efficiently index and organize blockchain data. +- πŸ”Ž **Efficient Querying**: The protocol uses GraphQL for streamlined querying blockchain data. +- πŸ™Œ **Community Ecosystem**: The Graph fosters collaboration by empowering developers to build, deploy, and share subgraphs! + +For detailed instructions and more context, check out the [Getting Started Guide](https://thegraph.com/docs/en/cookbook/quick-start). + +### 🧱 What we are building + +We are building an example smart contract and front end that utilizes The Graph protocol for data storage of event data. + +(Add links here to example dapp deployed online) + +(add screen shots here to show the example dapp) + +### 🌍 Upgrading this project + +This learning content is operated under[UNCHAIN License](https://github.com/unchain-dev/UNCHAIN-projects/blob/main/LICENSE). + +If you're participating in the project and think, 'This could be clearer if done this way!' or 'This is incorrect!', please feel free to send a `pull request`. + +To edit code directly from GitHub and send a `pull request` directly, see [here](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files#editing-files-in-another-users-repository). + +Any requests are welcome πŸŽ‰. + +You can also `Fork` the project to your own GitHub account, edit the contents, and send a `pull request`. + +- See [here](https://docs.github.com/en/get-started/quickstart/fork-a-repo) for instructions on how to `Fork` a project. +- How to create a `pull request` from a `Fork` is [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork). + +**πŸ‘‹ Send a `pull request` to `UNCHAIN-projects`! ⏩ Visit [UNCHAIN's GitHub](https://github.com/unchain-tech/UNCHAIN-projects)!** + +### ⚑️ Create an `Issue` + +If you feel that you want to leave a suggestion but not enough to send a `pull request`, you can create an `Issue` at [here](https://github.com/unchain-tech/UNCHAIN-projects/issues). + +See [here](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) for information on how to create an `Issue`. + +Creating `pull request` and `issues` is an important task when actually developing as a team, so please try it. + +Let's make the UNCHAIN project better together ✨. + +### πŸ™‹β€β™‚οΈ Asking Questions +If you have any questions or uncertainties up to this point, please ask in the `#thegraph` channel on Discord. \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-2_Requirements.md b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-2_Requirements.md new file mode 100644 index 000000000..a7aa33cb6 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-2_Requirements.md @@ -0,0 +1,11 @@ +## Requirements + +### βœ… What you will need + +Before you begin, you need to install the following tools: + +- [Node.js](https://nodejs.org/en/download/) +- Yarn ([v1](https://classic.yarnpkg.com/en/docs/install/) or [v2+](https://yarnpkg.com/getting-started/install)) +- [Git](https://git-scm.com/downloads) +- [Docker](https://docs.docker.com/get-docker/) + diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-3_Setup Scaffold-ETH 2.md b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-3_Setup Scaffold-ETH 2.md new file mode 100644 index 000000000..ff7bd82a5 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-3_Setup Scaffold-ETH 2.md @@ -0,0 +1,64 @@ +## Setup Scaffold-ETH 2 + +### πŸ–₯️ Setup Subgraph Package + +First, we will start out with a special build of Scaffold-ETH 2 written by Simon from Edge and Node… Thanks Simon! 🫑 + +We will need a total of four different windows to setup Scaffold-ETH 2 and The Graph. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-1.png) + +``` +git clone -b subgraph-package \ + https://github.com/scaffold-eth/scaffold-eth-2.git \ + scaffold-eth-2-subgraph-package +``` + +Once you have this checked out on your machine, navigate into the directory and install all of the dependencies using yarn. + +``` +cd scaffold-eth-2-subgraph-package && \ + yarn install +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-2.png) + +Next, we will want to start up our local blockchain so that we can eventually deploy and test our smart contracts. Scaffold-ETH 2 comes with Hardhat by default. To spin up the chain just type the following yarn command… + +``` +yarn chain +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-3.png) + +> You will keep this window up and available so that you can see any output from hardhat console. πŸ–₯️ + +Next we are going to spin up our frontend application. Scaffold-ETH 2 comes with NextJS by default and also can be started with a simple yarn command. You will need to open up a new command line and type the following… + +``` +yarn start +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-4.png) + +> You will also want to keep this window up at all times so that you can debug any code changes you make to NextJS, debug performance or just check that the server is running properly. + +Next, you will want to open up a third window where you can deploy your smart contract, along with some other useful commands found in Scaffold-ETH. To do a deploy you can simply run the following… + +``` +yarn deploy +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-5.png) + +> You should get a tx along with an address and amount of gas spent on the deploy. β›½ + +If you navigate to http://localhost:3000 you should see the NextJS application. Explore the menus and features of Scaffold-ETH 2! Someone call in an emergency, cause hot damn that is fire! πŸ”₯ + +You can test by sending an update to the setGreeting function. In order to do this you will need to get some gas by clicking cash icon in the top right hand corner next to the burner wallet address. This will send you 1 ETH from the faucet. + +Then you can simply navigate to "Debug Contracts", click the string field under setGreeting and type something fun and then click "SEND" + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-6.png) + +After this is complete you should also get a transaction receipt that you can expand below to verify it was successful. \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-4_Setup The Graph.md b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-4_Setup The Graph.md new file mode 100644 index 000000000..4d72de186 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-4_Setup The Graph.md @@ -0,0 +1,23 @@ +## Setup The Graph (Docker) + +### πŸš€ Setup The Graph Integration + +Now that we have spun up our blockchain, started our frontend application and deployed our smart contract, we can start setting up our subgraph and utilize The Graph! + +First run the following to clean up any old data. Do this if you need to reset everything. + +``` +yarn clean-node +``` + +> We can now spin up a graph node by running the following command… πŸ§‘β€πŸš€ + +``` +yarn run-node +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson4-1.png) + +This will spin up all the containers for The Graph using docker-compose. You will know this is complete when it reads "Downloading latest blocks from Ethereum..." + +> As stated before, be sure to keep this window open so that you can see any log output from Docker. πŸ”Ž \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-5_Deploy to localhost.md b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-5_Deploy to localhost.md new file mode 100644 index 000000000..0a26a52c8 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-5_Deploy to localhost.md @@ -0,0 +1,52 @@ +## Deploy + +### βœ… Create and ship our Subgraph + +Now we can open up a fourth window to finish setting up The Graph. πŸ˜… In this forth window we will create our local subgraph! + +> Note: You will only need to do this once. + +``` +yarn local-create +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-1.png) + +> You should see some output stating your Subgraph has been created along with a log output on your graph-node inside docker. + +Next we will ship our subgraph! You will need to give your subgraph a version after executing this command. (e.g. 0.0.1). + +``` +yarn local-ship +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-2.png) + +> This command does the following all in one… πŸš€πŸš€πŸš€ + +- Copies the contracts ABI from the hardhat/deployments folder +- Generates the networks.json file +- Generates AssemblyScript types from the subgraph schema and the contract ABIs. +- Compiles and checks the mapping functions. +- … and deploy a local subgraph! + +> If you get an error ts-node you can install it with the following command + +``` +npm install -g ts-node +``` + +If your subgraph deployment was successful it will look something like this: + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-3.png) + +You should get a build completed output along with the address of your Subgraph endpoint. + +``` +Build completed: QmYdGWsVSUYTd1dJnqn84kJkDggc2GD9RZWK5xLVEMB9iP + +Deployed to http://localhost:8000/subgraphs/name/scaffold-eth/your-contract/graphql + +Subgraph endpoints: +Queries (HTTP): http://localhost:8000/subgraphs/name/scaffold-eth/your-contract +``` \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-6_Test.md b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-6_Test.md new file mode 100644 index 000000000..750c70ba0 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-0/lesson-6_Test.md @@ -0,0 +1,29 @@ +## Test + +### βœ… Test your Subgraph + +Go ahead and head over to your subgraph endpoint and take a look! + +> Here is an example query… + +``` + { + greetings(first: 25, orderBy: createdAt, orderDirection: desc) { + id + greeting + premium + value + createdAt + sender { + address + greetingCount + } + } + } +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson6-1.png) + +> If all is well and you’ve sent a transaction to your smart contract then you will see a similar data output! + +Next up we will dive into a bit more detail on how The Graph works so that as you start adding events to your smart contract you can start indexing and parsing the data you need for your front end application. \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-1_Adding an event.md b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-1_Adding an event.md new file mode 100644 index 000000000..3b25e738e --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-1_Adding an event.md @@ -0,0 +1,41 @@ +## Adding an event + +### πŸ§‘πŸΌβ€πŸ’» Adding more events / Subgraph updates πŸ‘©πŸ½β€πŸ’» + +Now we want to start making some changes to our contract. We will create a new function and a new event for that function. + +#### βœ… Add an event to our contract + +> Open up YourContract.sol under packages/hardhat/contracts + +Add the following new line of code. + +``` + event SendMessage(address _from, address _to, string message); + + function sendMessage(address _to, string calldata message) external { + emit SendMessage(msg.sender, _to, message); + } +``` + +You can drop this event and function anywhere inside the contract, but best practice is to drop it below any modifiers or the constructor. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-1.png) + +We can save our contract and then deploy those new changes. + +> Pro tip, if you use the --reset flag you will ALWAYS get a fresh contract deployed, regardless of any updates to the source. + +``` +yarn deploy --reset +``` + +You should see the following output: + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-2.png) + +#### βœ… Test your new function + +Navigate over to http://localhost:3000/debug and send vitalik.eth a message. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-3.png) diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-2_Updating your subgraph.md b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-2_Updating your subgraph.md new file mode 100644 index 000000000..c2da5dadb --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-2_Updating your subgraph.md @@ -0,0 +1,129 @@ +## Updating your subgraph + +### βœ… Update the GraphQL schema + +After you add an event to your smart contract, you will need to first update the GraphQL schema to include the entities you want to store on your Graph node. If you want to catch up on entities here is a good link to the docs for that. + +In the code below we will update the existing schema to a new naming convention that matches the event name. + +> The schema file is located in packages/subgraph/src/schema.graphql + +``` +type GreetingChange @entity(immutable: true) { + id: Bytes! + greetingSetter: Bytes! # address + newGreeting: String! # string + premium: Boolean! # bool + value: BigInt! # uint256 + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} + +type SendMessage @entity(immutable: true) { + id: Bytes! + _from: Bytes! # address + _to: Bytes! # address + message: String! # string + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} + +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-1.png) + +#### βœ… Update the Subgraph manifest + +You will also need to add these entities to the Subgraph YAML configuration and also add the event handlers as well. + +> This file is located in packages/subgraph/subgraph.yaml + +``` +entities: + - GreetingChange + - SendMessage +``` + +``` + eventHandlers: + - event: GreetingChange(indexed address,string,bool,uint256) + handler: handleGreetingChange + - event: SendMessage(address,address,string) + handler: handleSendMessage +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-2.png) + +If you are following along, next you will need to copy over your new abi and regenerate the code. + +``` +yarn abi-copy && yarn codegen +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-3.png) + +#### βœ… Update the mapping script + +Next you will need to update the mappings for the files we have edited above. + +> The file is located under packages/subgraph/src/mapping.ts + +``` +import { + YourContract, + GreetingChange as GreetingChangeEvent, + SendMessage as SendMessageEvent +} from "../generated/YourContract/YourContract"; +``` + +As well as the schema. + +``` +import { GreetingChange, SendMessage } from "../generated/schema" +``` + +Lastly, we will need to add the mapping functions for each event. + +``` +export function handleGreetingChange(event: GreetingChangeEvent): void { + let entity = new GreetingChange( + event.transaction.hash.concatI32(event.logIndex.toI32()) + ) + entity.greetingSetter = event.params.greetingSetter + entity.newGreeting = event.params.newGreeting + entity.premium = event.params.premium + entity.value = event.params.value + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() +} + +export function handleSendMessage(event: SendMessageEvent): void { + let entity = new SendMessage( + event.transaction.hash.concatI32(event.logIndex.toI32()) + ) + entity._from = event.params._from + entity._to = event.params._to + entity.message = event.params.message + + entity.blockNumber = event.block.number + entity.blockTimestamp = event.block.timestamp + entity.transactionHash = event.transaction.hash + + entity.save() +} + +``` + +Your changes should be accepted inside of your editor without any linting errors. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-4.png) + +After that is done, you are almost done… time to ship it! + + diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-3_Deploy.md b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-3_Deploy.md new file mode 100644 index 000000000..e7ffd55b3 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-3_Deploy.md @@ -0,0 +1,13 @@ +## Deploy your subgraph + +### βœ… Ship your updated Subgraph + +``` +yarn local-ship +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson3-1.png) + +Be sure to add a new version number to your subgraph when it prompts you. This should be higher then the previous version. + +Next we will test out the subgraph and make sure it is indexing correctly. \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-4_Test.md b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-4_Test.md new file mode 100644 index 000000000..60894ee02 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-1/lesson-4_Test.md @@ -0,0 +1,21 @@ +## Test + +### βœ… Test your newly deployed Subgraph + +Next, lets see if our data is in The Graph. Here is an example query that shows us the first message. + +``` +{ + sendMessages(first: 1, orderBy: blockTimestamp, orderDirection: desc) { + message + _from + _to + } +} +``` + +You should get a nice response like this: + +![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson4-1.png) + +Data is such a beautiful thing huh? diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-1_Install Metamask.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-1_Install Metamask.md new file mode 100644 index 000000000..e236e6c95 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-1_Install Metamask.md @@ -0,0 +1,7 @@ +## Install Metamask + +### Install MetaMask + +When we deploy a smart contract to the blockchain or interact with a deployed smart contract, we need to pay for gas. Therefore, we need a Web3 wallet, such as MetaMask. Click here to install MetaMask.[here](https://metamask.io/) + +You will also want to get some testnet ETH, so that you can deploy your contract to a testnet later in this tutorial. \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-2_Deployer account creation.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-2_Deployer account creation.md new file mode 100644 index 000000000..3fe29d336 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-2_Deployer account creation.md @@ -0,0 +1,63 @@ +## Deployer account + +### β›΅ Ship to a testnet + +Next we want to take our smart contract and deploy it to a testnet! At the time this workshop was written, The Graph supports many testnets but for this example we will use sepolia. + +If you need some testnet funds you can try the following faucets: +- + +#### βœ… Create a deployer account + +``` +yarn run generate +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-1.png) + +You should see the following saved to your hardhats environment variable file +``` +πŸ‘› Generating new Wallet +πŸ“„ Private Key saved to packages/hardhat/.env file +``` + +#### βœ… Fund the account + +``` +yarn account +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-2.png) + +This should display your public address along with a fancy QR code. And balances?!? Woooowwwww that is slick! <3 + +``` + + β–„β–„β–„β–„β–„β–„β–„ β–„ β–„ β–„β–„β–„β–„β–„β–„β–„ β–„β–„β–„β–„β–„β–„β–„ + β–ˆ β–„β–„β–„ β–ˆ β–ˆβ–€β–€β–„ β–ˆβ–€β–ˆβ–„ β–„β–„β–ˆ β–ˆ β–„β–„β–„ β–ˆ + β–ˆ β–ˆβ–ˆβ–ˆ β–ˆ β–„β–„β–ˆβ–ˆβ–€β–„β–ˆ β–€ β–ˆβ–ˆβ–ˆ β–ˆ β–ˆβ–ˆβ–ˆ β–ˆ + β–ˆβ–„β–„β–„β–„β–„β–ˆ β–„β–€β–„β–€β–„β–€β–„β–€β–„ β–ˆ β–„ β–ˆβ–„β–„β–„β–„β–„β–ˆ + β–„ β–„β–„β–„β–„β–„β–„β–€β–ˆβ–„β–€β–„β–ˆβ–„β–„ β–„β–ˆβ–€β–„ β–„ β–„β–„β–„ + β–„β–€β–€β–ˆ β–ˆβ–„β–ˆβ–ˆβ–€β–€β–€β–€β–„β–ˆβ–€β–€β–„β–ˆβ–„β–ˆβ–ˆβ–€β–„β–„β–ˆβ–€β–ˆ + β–€β–„β–„ β–„β–ˆβ–„β–„β–„β–€ β–ˆβ–€β–„β–€β–€β–„β–„β–ˆ β–ˆβ–ˆβ–€β–ˆ β–„β–€ + β–„β–ˆβ–€β–€β–ˆβ–ˆβ–„ β–€β–„ β–ˆ β–€ β–€β–ˆ β–€β–„β–€β–ˆβ–„β–ˆβ–ˆβ–ˆ + β–„β–ˆβ–€β–ˆβ–ˆ β–„β–„β–„ β–€ β–„ β–ˆβ–„β–€β–„β–„ β–ˆβ–ˆβ–„β–€β–„β–€β–„β–ˆ + β–ˆβ–„ β–ˆβ–„ β–„β–ˆβ–„β–ˆβ–„β–€β–€β–€ β–„β–ˆβ–„β–ˆβ–€β–„ β–ˆβ–€β–€β–„β–„β–€β–„ + β–ˆβ–ˆβ–ˆβ–„β–ˆβ–€β–„ β–ˆ β–€β–„β–ˆβ–€ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„β–ˆβ–€β–ˆβ–„β–„ + β–„β–„β–„β–„β–„β–„β–„ β–ˆβ–„ β–ˆβ–„ β–ˆβ–ˆβ–€ β–ˆ β–ˆ β–„ β–ˆ β–ˆβ–ˆ + β–ˆ β–„β–„β–„ β–ˆ β–ˆ β–€β–ˆβ–ˆβ–„β–ˆβ–ˆβ–€β–€β–„ β–ˆβ–„β–„β–„β–ˆβ–ˆβ–„β–„ + β–ˆ β–ˆβ–ˆβ–ˆ β–ˆ β–€β–„β–€β–„ β–€β–„β–„ β–„β–ˆβ–€β–€ β–„β–„β–„β–ˆβ–ˆβ–„β–„ + β–ˆβ–„β–„β–„β–„β–„β–ˆ β–„β–ˆ β–„β–ˆ β–„β–€β–„β–ˆ β–„β–€ β–„β–„β–„β–€ β–€ +β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€ + +Public address: 0x87f00B2c39F97CD00BC6d09777BC4327aCA39180 + +-- localhost -- πŸ“‘ + balance: 0 + nonce: 0 + +``` + +Send over some testnet ETH from the chain of your choice. I would suggest sepolia as its fairly easy to get some testnet ETH from various sources. In the output below you can see I now have a sepolia balance. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-3.png) \ No newline at end of file diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-3_Deploy and verify.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-3_Deploy and verify.md new file mode 100644 index 000000000..543299c0d --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-3_Deploy and verify.md @@ -0,0 +1,37 @@ +## Deploy and verify + +### βœ… Deploy! + +Now we can deploy to our testnet of choice... in this example we will deploy to sepolia. + +``` +yarn deploy --network sepolia +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-1.png) + +If all is well you should see the following success output. + +``` +deploying "YourContract" (tx: 0xf404021d736271a7a0a84d124ed35250c533efe37c1775367b6510a8836bf0bd)...: deployed at 0x541D469C06990B7F0bd5103b57997cE8a39C050c with 605281 gas +πŸ“ Updated TypeScript contract definition file on ../nextjs/generated/deployedContracts.ts +``` + +#### βœ… Verification + +``` +yarn verify --network sepolia +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-2.png) + +You should see the following successful output... + +``` +verifying YourContract (0x541D469C06990B7F0bd5103b57997cE8a39C050c) ... +waiting for result... + => contract YourContract is now verified +``` + + You can also check your contract was successfully on etherscan. [Here](https://sepolia.etherscan.io/address/0x541D469C06990B7F0bd5103b57997cE8a39C050c#code) is the one I deployed and verified. + diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-4_Subgraph Studio.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-4_Subgraph Studio.md new file mode 100644 index 000000000..4eee20382 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-4_Subgraph Studio.md @@ -0,0 +1,26 @@ +## Subgraph studio + +### Migrating you Subgraph to the Studio + +Now that our smart contract is on a public testnet it is time to push our Subgraph to the Studio. + +#### βœ… Navigate to https://thegraph.com/studio + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio1.png) + +#### βœ… Connect your wallet + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio2.png) + +You might need to sign a request to verify that you own the connected wallet. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio3.png) + +#### βœ… Click Create a Subgraph + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio4.png) + +#### βœ… Name your Subgraph + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio5.png) + diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-5_Graph CLI.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-5_Graph CLI.md new file mode 100644 index 000000000..a900da72c --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-5_Graph CLI.md @@ -0,0 +1,105 @@ +## Graph CLI + +### βœ… Deploy your subgraph using the CLI + +#### βœ… Use the Graph CLI to complete the deployment + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio6.png) + +You can install the Graph CLI globally using the following command. + +``` +yarn global add @graphprotocol/graph-cli +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5.png) + +#### βœ… Init your Subgraph + +This can be done in a separate folder of your choosing, since it will initiate a yarn package. You will need to fill in the required configuration during the initialization process.The Start Block - Can be found on Etherescan if needed so you don't have to index the entire previous blocks. + +``` +graph init --studio name_of_your_subgraph +``` + +It should looks something like this... + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-1.png) + +#### βœ… Authenticate to Studio + +Grab your authentication string from Auth & Deploy on Subgraph Studio. + +``` +graph auth --studio auth_key_here +``` + +Success looks like this: + +``` +Deploy key set for https://api.studio.thegraph.com/deploy/ +``` + +#### βœ… Run codegen and build your subgraph + +You will need to change into the directory where the subgraph was created in the previous step. + +``` +cd sendmessage +graph codegen && graph build +``` + +Success will look something like the following! + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-3.png) + +#### βœ… Deploy + +Now we are ready to deploy to the Studio + +``` +graph deploy --studio name_of_your_subgraph +``` + +Choose a version and fire away! + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-4.png) + +It might take up to 5 minutes for you subgraph to deploy to the studio. Once it has been deployed, you can check that is fully syncing and has no errors. A successful deploy will look like the following. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio7.png) + +#### βœ… Send a transaction and verify in Subgraph Playground + +On Etherscan you can send a transaction directly to your contract on the Contract -> Write Contract tab. + +Our Query: + +``` +{ + sendMessages(first: 5) { + id + _from + _to + message + } +} +``` + +Our data object response: + +``` +{ + "data": { + "sendMessages": [ + { + "id": "0x053e32f85f9f485334119585abfc73e507a4ce86e968130b90410df70eb3a66e71000000", + "_from": "0x142cd5d7ac1ea8919f1644af1870792b9f77d44a", + "_to": "0x007e483cf6df009db5ec571270b454764d954d95", + "message": "I love you" + } + ] + } +} +``` + diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-6_Frontend.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-6_Frontend.md new file mode 100644 index 000000000..43b594232 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-6_Frontend.md @@ -0,0 +1,166 @@ +## Frontend + +### Updating and deploying our Frontend + +Now that we have our contract deployed to a testnet and the data is getting indexed in Subgraph Studio. It is time to update our frontend. + +#### βœ… Step 1: Update the Scaffold-ETH config + +Update the configuration to point to the testnet that you deployed to in previous steps. + +> The scaffold.config.ts is located in packages/nextjs + +``` + targetNetwork: chains.sepolia, +``` + +It should look like this when changed: + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-1.png) + +Once you change this you can go back to scaffold-ETH and refresh the UI. You will get kicked from your burner wallet, you will want to connect to the testnet work using your metamask wallet. + +Click "CONNECT WALLET"... + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-2.png) + +Choose Metamask... + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-3.png) + +Switch the network... + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-4.png) + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-5.png) + +Once complete you should now be connected to your dapp on sepolia network. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-6.png) + +#### βœ… Fire off a test message to someone you know! (or Vitalik heh) + +We now want to send an event on the testnet that we have deployed our smart contract. We can do that fairly easily now that our frontend is properly configured. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-7.png) + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-8.png) + +Then check to see if the message was indexed successfully in the studio. You can find the GraphiQL explorer on the "Playground" page. + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-9.png) + +#### βœ… Update our GraphQL URL to point to our development endpoint + +The development endpoint for your subgraph can be found on the details tab in Subgraph Studio. + +> Edit _app.tsx located in packages/nextjs/pages + +``` + const subgraphUri = "https://api.studio.thegraph.com/query/51078/sendmessage-test/version/latest"; + const apolloClient = new ApolloClient({ + uri: subgraphUri, + cache: new InMemoryCache(), + }); +``` + +The change will look something like this: + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-10.png) + +#### βœ… Start with a clean slate in your index.ts file + +Let's import everything we will need into our index.ts file. You can also clean out all the info in the return. + +> this file is located in packages/nextjs/pages + +It should look something like this... + +``` +import type { NextPage } from "next"; +import { MetaHeader } from "~~/components/MetaHeader"; + +import { gql } from "@apollo/client"; +import { useQuery } from "@apollo/client"; + +const Home: NextPage = () => { + return ( + <> + + + ); +}; + +export default Home; +``` + +After your change the home directory will look something like this: + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-11.png) + +#### βœ… Display our messages in a table format + +Lastly a table to display our messages. + +``` +

Messages

+ + + + + + + + + + {messages.map((message) => ( + + + + + + ))} + +
FromToMessage
{message._from}{message._to}{message.message}
+``` + +We should create a const with our GraphQL query outside of the main function. + +``` +export const GET_MESSAGES = gql` +{ + sendMessages(first: 5) { + id + _from + _to + message + } +} +`; +``` + +And then load the data like so... + +``` + const { loading, error, data: messagesData } = useQuery(GET_MESSAGES); + + const messages = messagesData?.sendMessages || []; +``` + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-13.png) + +We can then make this a bit prettier and use the
component instead of just plain text. + +``` + +
+
+ {message.message} + +``` + +This will look a lot nicer than those long strings! :D + +![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-14.png) + +> Note: If you want to see the full complete file you can do so [here](https://gist.github.com/kmjones1979/26ef9633b61b17f237e88eb41bb688de)! diff --git a/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-7_Ship your frontend.md b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-7_Ship your frontend.md new file mode 100644 index 000000000..62ec06011 --- /dev/null +++ b/docs/The_Graph-SE2-Subgraph-package/en/section-2/lesson-7_Ship your frontend.md @@ -0,0 +1,37 @@ +## Ship + +### βœ… YOLO Vercel! + +Last step is to push our frontend to vercel! This is easy with the following command, which essential skips build errors with the following command line switches 'vercel --build-env NEXT_PUBLIC_IGNORE_BUILD_ERROR=true' + +This might take some time, so grab a coffee. β˜• + +``` +yarn vercel:yolo +``` + +You should see the following prompts. + +``` +Vercel CLI 28.20.0 +? Set up and deploy β€œ~/projects/ethereum/scaffold-eth-2-subgraph-package-workshop/packages/nextjs”? [Y/n] +y +? Which scope do you want to deploy to? myscope +? Link to existing project? [y/N] n +? What’s your project’s name? sendMessage +? In which directory is your code located? ./ +Local settings detected in vercel.json: +Auto-detected Project Settings (Next.js): +- Build Command: next build +- Development Command: next dev --port $PORT +- Install Command: `yarn install`, `pnpm install`, or `npm install` +- Output Directory: Next.js default +? Want to modify these settings? [y/N] n +πŸ”— Linked to kevin-kevinjonescr/testing (created .vercel) +πŸ” Inspect: https://vercel.com/kevin-kevinjonescr/testing/E2rfnyzC4ud5DskrwhybQ4Hiicjx [2s] +βœ… Production: https://testing-red.vercel.app [3m] +πŸ“ Deployed to production. Run `vercel --prod` to overwrite later (https://vercel.link/2F). +πŸ’‘ To change the domain or build command, go to https://vercel.com/kevin-kevinjonescr/testing/settings +``` + +Thank you so much for learning all about Scaffold-ETH and The Graph. We want to hear about how you enjoyed this tutorial and any feedback you have. You can join The Graph Discord and reach out if you have questions or problems along your web3 journey! Keep BUIDLing my friends! \ No newline at end of file diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-1.png new file mode 100644 index 000000000..9277e29ab Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-2.png new file mode 100644 index 000000000..13c8db932 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-3.png new file mode 100644 index 000000000..9834013b8 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-4.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-4.png new file mode 100644 index 000000000..870977119 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-4.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-1.png new file mode 100644 index 000000000..47318867d Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-2.png new file mode 100644 index 000000000..d6352b2ca Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-3.png new file mode 100644 index 000000000..4cf099c8e Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-4.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-4.png new file mode 100644 index 000000000..3b0dc0750 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-4.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-5.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-5.png new file mode 100644 index 000000000..d88cfaaa8 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-5.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-6.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-6.png new file mode 100644 index 000000000..51201ef15 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-6.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson4-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson4-1.png new file mode 100644 index 000000000..69222597a Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson4-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-1.png new file mode 100644 index 000000000..efb6a9983 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-2.png new file mode 100644 index 000000000..eba0bd44e Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-3.png new file mode 100644 index 000000000..e9239e5c8 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson6-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson6-1.png new file mode 100644 index 000000000..bbe108cb7 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson6-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-1.png new file mode 100644 index 000000000..08ebe8850 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-2.png new file mode 100644 index 000000000..4f2d683cc Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-3.png new file mode 100644 index 000000000..c1acb35c3 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-1.png new file mode 100644 index 000000000..0645a291d Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-2.png new file mode 100644 index 000000000..71367f85c Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-3.png new file mode 100644 index 000000000..d29e094e3 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-4.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-4.png new file mode 100644 index 000000000..edf4fbae0 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-4.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson3-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson3-1.png new file mode 100644 index 000000000..a7c98bf18 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson3-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson4-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson4-1.png new file mode 100644 index 000000000..441ba7438 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson4-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-1.png new file mode 100644 index 000000000..4d370f64d Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-2.png new file mode 100644 index 000000000..d7bdf7e28 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-3.png new file mode 100644 index 000000000..ea22a825d Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-1.png new file mode 100644 index 000000000..aeb8689d5 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-2.png new file mode 100644 index 000000000..339559257 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-1.png new file mode 100644 index 000000000..ba01d77a6 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-2.png new file mode 100644 index 000000000..f2a721cd9 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-3.png new file mode 100644 index 000000000..789950eca Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-4.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-4.png new file mode 100644 index 000000000..9d7023bb0 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-4.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5.png new file mode 100644 index 000000000..6cee08f37 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-1.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-1.png new file mode 100644 index 000000000..1e477350c Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-10.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-10.png new file mode 100644 index 000000000..5b2636797 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-10.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-11.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-11.png new file mode 100644 index 000000000..f35757805 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-11.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-12.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-12.png new file mode 100644 index 000000000..89a086602 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-12.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-13.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-13.png new file mode 100644 index 000000000..8cad59806 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-13.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-14.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-14.png new file mode 100644 index 000000000..e8dfb2c0f Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-14.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-2.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-2.png new file mode 100644 index 000000000..d455df38e Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-3.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-3.png new file mode 100644 index 000000000..8acfe0807 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-4.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-4.png new file mode 100644 index 000000000..f06ac1916 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-4.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-5.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-5.png new file mode 100644 index 000000000..6bd8f55a6 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-5.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-6.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-6.png new file mode 100644 index 000000000..3ee89f150 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-6.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-7.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-7.png new file mode 100644 index 000000000..e65067c97 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-7.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-8.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-8.png new file mode 100644 index 000000000..bdd0bc822 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-8.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-9.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-9.png new file mode 100644 index 000000000..67e4a87cf Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-9.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio1.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio1.png new file mode 100644 index 000000000..13d7ba6dd Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio1.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio2.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio2.png new file mode 100644 index 000000000..bf89c2fdf Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio2.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio3.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio3.png new file mode 100644 index 000000000..a93199dd7 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio3.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio4.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio4.png new file mode 100644 index 000000000..2981e7eed Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio4.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio5.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio5.png new file mode 100644 index 000000000..a9a8af72c Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio5.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio6.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio6.png new file mode 100644 index 000000000..6be64e0dd Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio6.png differ diff --git a/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio7.png b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio7.png new file mode 100644 index 000000000..becacb582 Binary files /dev/null and b/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio7.png differ