Skip to content

Commit

Permalink
refactor: rename images
Browse files Browse the repository at this point in the history
  • Loading branch information
yk-saito committed Dec 7, 2023
1 parent 6567ad4 commit 69b1fd6
Show file tree
Hide file tree
Showing 68 changed files with 53 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ This workshop is built around Scaffold-ETH 2 and The Graph. You will learn how t
- 🔥 **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/0_1_1.png)

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_1_2.png)

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-3.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/L0_1_3.png)

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson1-4.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_1_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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ First, we will start out with a special build of Scaffold-ETH 2 written by 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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_3_1.png)

```
git clone -b subgraph-package \
Expand All @@ -21,15 +21,15 @@ cd scaffold-eth-2-subgraph-package && \
yarn install
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_3_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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_3_3.png)

> You will keep this window up and available so that you can see any output from hardhat console. 🖥️
Expand All @@ -39,7 +39,7 @@ Next we are going to spin up our frontend application. Scaffold-ETH 2 comes with
yarn start
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-4.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_3_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.
Expand All @@ -49,7 +49,7 @@ Next, you will want to open up a third window where you can deploy your smart co
yarn deploy
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson3-5.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_3_5.png)

> You should get a tx along with an address and amount of gas spent on the deploy. ⛽
Expand All @@ -59,6 +59,6 @@ You can test by sending an update to the setGreeting function. In order to do th

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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_3_6.png)

After this is complete you should also get a transaction receipt that you can expand below to verify it was successful.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ yarn clean-node
yarn run-node
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson4-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_4_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..."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Now we can open up a fourth window to finish setting up The Graph. 😅 In this
yarn local-create
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_5_1.png)

> You should see some output stating your Subgraph has been created along with a log output on your graph-node inside docker.
Expand All @@ -20,7 +20,7 @@ Next we will ship our subgraph! You will need to give your subgraph a version af
yarn local-ship
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson5-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_5_2.png)

> This command does the following all in one… 🚀🚀🚀
Expand All @@ -38,7 +38,7 @@ 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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_5_3.png)

You should get a build completed output along with the address of your Subgraph endpoint.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Go ahead and head over to your subgraph endpoint and take a look!
}
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-0/Lesson6-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-0/0_6_1.png)

> If all is well and you’ve sent a transaction to your smart contract then you will see a similar data output!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Add the following new line of code.

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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_1_1.png)

We can save our contract and then deploy those new changes.

Expand All @@ -32,10 +32,10 @@ yarn deploy --reset

You should see the following output:

![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson1-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_1_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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_1_3.png)
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type SendMessage @entity(immutable: true) {
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_2_1.png)

#### ✅ Update the Subgraph manifest

Expand All @@ -54,15 +54,15 @@ entities:
handler: handleSendMessage
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson2-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_2_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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_2_3.png)

#### ✅ Update the mapping script

Expand Down Expand Up @@ -122,7 +122,7 @@ export function handleSendMessage(event: SendMessageEvent): void {

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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_2_4.png)

After that is done, you are almost done… time to ship it!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
yarn local-ship
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson3-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_3_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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Next, lets see if our data is in The Graph. Here is an example query that shows

You should get a nice response like this:

![](/public/images/The_Graph-SE2-Subgraph-package/section-1/Lesson4-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-1/1_4_1.png)

Data is such a beautiful thing huh?
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you need some testnet funds you can try the following faucets:
yarn run generate
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_2_1.png)

You should see the following saved to your hardhats environment variable file
```
Expand All @@ -27,7 +27,7 @@ You should see the following saved to your hardhats environment variable file
yarn account
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson2-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_2_2.png)

This should display your public address along with a fancy QR code. And balances?!? Woooowwwww that is slick! <3

Expand Down Expand Up @@ -60,4 +60,4 @@ Public address: 0x87f00B2c39F97CD00BC6d09777BC4327aCA39180

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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_2_3.png)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Now we can deploy to our testnet of choice... in this example we will deploy to
yarn deploy --network sepolia
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_3_1.png)

If all is well you should see the following success output.

Expand All @@ -23,7 +23,7 @@ deploying "YourContract" (tx: 0xf404021d736271a7a0a84d124ed35250c533efe37c177536
yarn verify --network sepolia
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson3-2.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_3_2.png)

You should see the following successful output...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ Now that our smart contract is on a public testnet it is time to push our Subgra

#### ✅ Navigate to https://thegraph.com/studio

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio1.png)
![Studio1](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_4_1.png)

#### ✅ Connect your wallet

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio2.png)
![Studio2](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_4_2.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)
![Studio3](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_4_3.png)

#### ✅ Click Create a Subgraph

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio4.png)
![Studio4](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_4_4.png)

#### ✅ Name your Subgraph

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio5.png)
![Studio5](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_4_5.png)

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

#### ✅ Use the Graph CLI to complete the deployment

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Studio6.png)
![Studio6](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_5_1.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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_5_2.png)

#### ✅ Init your Subgraph

Expand All @@ -24,7 +24,7 @@ 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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_5_3.png)

#### ✅ Authenticate to Studio

Expand All @@ -51,7 +51,7 @@ graph codegen && graph build

Success will look something like the following!

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson5-3.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_5_4.png)

#### ✅ Deploy

Expand All @@ -63,11 +63,11 @@ 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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_5_5.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)
![Studio7](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_5_6.png)

#### ✅ Send a transaction and verify in Subgraph Playground

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,39 @@ Update the configuration to point to the testnet that you deployed to in previou

It should look like this when changed:

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-1.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_2.png)

Choose Metamask...

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-3.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_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/2_6_4.png)

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-5.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_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/2_6_7.png)

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-8.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_9.png)

#### ✅ Update our GraphQL URL to point to our development endpoint

Expand All @@ -66,7 +66,7 @@ The development endpoint for your subgraph can be found on the details tab in Su

The change will look something like this:

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-10.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_10.png)

#### ✅ Start with a clean slate in your index.ts file

Expand Down Expand Up @@ -96,7 +96,7 @@ 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)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_11.png)

#### ✅ Display our messages in a table format

Expand Down Expand Up @@ -147,7 +147,7 @@ And then load the data like so...
const messages = messagesData?.sendMessages || [];
```

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-13.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_13.png)

We can then make this a bit prettier and use the <Address> component instead of just plain text.

Expand All @@ -161,6 +161,6 @@ We can then make this a bit prettier and use the <Address> component instead of

This will look a lot nicer than those long strings! :D

![](/public/images/The_Graph-SE2-Subgraph-package/section-2/Lesson6-14.png)
![](/public/images/The_Graph-SE2-Subgraph-package/section-2/2_6_14.png)

> Note: If you want to see the full complete file you can do so [here](https://gist.github.com/kmjones1979/26ef9633b61b17f237e88eb41bb688de)!

0 comments on commit 69b1fd6

Please sign in to comment.