Skip to content

Commit

Permalink
Merge pull request #29 from cs-pub-ro/lab-dapp
Browse files Browse the repository at this point in the history
Add your dApp practical session
  • Loading branch information
CostinCarabas authored Dec 5, 2024
2 parents 3082cfe + 517ab9c commit a24c0e9
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
38 changes: 38 additions & 0 deletions chapters/dApps/lab/content/dApp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Decentralized Applications

## Objectives:
* In this lab you will build your first decentralized application (dApp);
* You will create a ping pong application where you will:
* Create an User Interace (template provided);
* Login via private key (pem, Chrome extension);
* Create a Smart contract (template provided);
* Interact with the User Interace and observe the blockchain transaction;

## dApp Description

The Ping-Pong app is a very simple decentralized application that will allow the user to deposit a specific number of tokens to a smart contract address and to lock them for a specific amount of time.
After this time interval passes, the user can claim back the same amount of tokens.
Sending funds to the contract is called **ping**.
Claiming the same amount back is called **pong**.

![Block 16826695](../media/description.png)

## dApp architecture

![Block 16826695](../media/architecture.png)

### Application Layer (The Frontend)

For the web app we'll have two pages:

* The **Sign** in page - here we can authenticate with ledger, web wallet or with xPortal app
* The **Dashboard** page - here we can either ping or pong, if we already deposited, then we will see a countdown timer until the time interval clears out.

### Blockchain Layer (The Backend)

We will create a smart contract that can handle the deposit (**ping**), claim (**pong**) and status actions (**did_user_ping**, **get_time_to_pong**). Let's say that, for now, this smart contract plays the role of an API in a dApp. Also, this is where our business logic resides.

## Step by step tutorial

Please follow the [tutorial](https://docs.multiversx.com/developers/tutorials/your-first-dapp) and create your first dApp.
Interact with the dApp and observe the blockchain transactions.
9 changes: 0 additions & 9 deletions chapters/dApps/lab/content/dApp/README.md

This file was deleted.

Binary file added chapters/dApps/lab/media/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added chapters/dApps/lab/media/description.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ docusaurus:
- Objectives: rust.md
- Tour of Rust: tour-of-rust.md
- CryptoZombies: cryptozombies.md
- Decentralized Applications:
path: chapters/dApps/lab/content/
extra:
- ../media/
subsections:
- Building your first dApp: dApp.md
- Observer:
path: chapters/introduction/lab/content/observer/
extra:
Expand Down
2 changes: 1 addition & 1 deletion util/grading.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| -------- | ------- |
| Lab involvement | 10p |
| Homework 1| 15p |
| <s>Homework 2</s>| <s>15p |
| <s>Homework 2</s>| <s>15p</s> |
| Project| <s>20p</s> 35p |
| Lecture involvement | 10p (bonus)|
| Practical final exam | 30p points |
Expand Down

0 comments on commit a24c0e9

Please sign in to comment.