Skip to content

Commit

Permalink
fix: simplification > high-level explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
anegg0 committed Jan 16, 2025
1 parent 459e914 commit d72c53f
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ contract VendingMachine {
return _cupcakeBalances[userAddress];
}
}
````
```

</CustomDetails>

Expand Down Expand Up @@ -363,37 +363,40 @@ Then copy and paste your **contract address** below and click `Get cupcake!`. Yo
### What's going on, here?

Our first `VendingMachine` is labeled `WEB2` because it demonstrates traditional n-tier web application architecture:
Our first `VendingMachine` is labeled `Web2` because it demonstrates traditional client-server web application architecture: the back-end lives in a centralized network of servers.

![Architecture diagram](./images/quickstart-vending-machine-architecture.png)

The `WEB3-LOCALHOST` architecture is similar to the `WEB2` architecture, with one key difference: with the `WEB3` version, **the business logic and data live in an (emulated for now) decentralized network of nodes** instead of a centralized network of servers.
The `Web3` architecture is similar to the `Web2` architecture, with one key difference: with the `Web3` version, business logic and data are hosted by decentralized network of nodes**

Let's take a closer look at the differences between our `VendingMachine` implementations:
<!-- todo: enhance precision RE where things are stored / executed / hashed-and-stored / etc -->
| | `WEB2`<br/>(the first one) | `WEB3-LOCALHOST`<br/>(the latest one) | `WEB3-ARB-SEPOLIA`<br/>(the next one) | `WEB3-ARB-MAINNET`<br/>(the final one) |
| --------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|-----------------------|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| **Data** (cupcakes) | Stored only in your **browser**. (Usually, stored by centralized infrastructure.) | Stored on your **device** in an **emulated Ethereum network** (via smart contract). | Stored on Ethereum's **decentralized test network** (via smart contract). | Stored on Ethereum's **decentralized mainnet network** (via smart contract). |
| **Logic** (vending) | Served from **Offchain's servers**. Executed by your **browser**. | Stored and executed by your **locally emulated Ethereum network** (via smart contract). | Stored and executed by Arbitrum's **decentralized test network** (via smart contract). | Stored and executed by Arbitrum's **decentralized mainnet network** (via smart contract). |
| **Presentation** (UI) | Served from **Offchain's servers**. Rendered and executed by your **browser**. | ← same | ← same | ← same |
| **Money** | Devs and users pay centralized service providers for server access using fiat currency. | ← same, but only for the presentation-layer concerns (code that supports frontend UI/UX). | ← same, but devs and users pay **testnet $ETH** to testnet validators. | ← same, but instead of testnet $ETH, they use **mainnet $ETH**. |
So far, we've deployed our `Web3` app to an emulated blockchain (Anvil), which is a normal step in EVM development.

Next, we'll deploy our smart contract to a network of real nodes: Arbitrum's Sepolia testnet.

### Deploy the smart contract to the Arbitrum Sepolia testnet

We were able to deploy to a testnet for free because we were using Remix' built-in network, but now we'll deploy our contract to Arbitrum's Sepolia testnet.
Sepolia is powered by a real network of real nodes, so we'll need to pay a small transaction fee to deploy our smart contract.
Sepolia is powered by a network of nodes ran across the world by various participants, we'll need to compensate them with a small transaction fee in order to deploy our smart contract.

To be able to pay the transaction fee, we will:

- Use our MetaMask crypto wallet
- Obtain some Arbitrum Sepolia testnet's token called `$ETH`.
Click Metamask's network selector dropdown, and then click the `Add Network` button. Click "Add a network manually" and then provide the following information:
Click Metamask's network selector dropdown, and then click the `Add Network` button. Click "Add a network manually" and then provide the following information (in the same way as in [the previous section](#deploy-the-smart-contract-to-a-local-ethereum-chain)):

- Network Name: `Arbitrum Sepolia`
- New RPC URL: `https://sepolia-rollup.arbitrum.io/rpc`
Expand Down

0 comments on commit d72c53f

Please sign in to comment.