From 10d451912e12e4dc0f6aefcd7038e30624c3bc1d Mon Sep 17 00:00:00 2001 From: vasmohi Date: Sun, 1 Sep 2024 13:34:57 +0530 Subject: [PATCH] feat: Added youtube video inside todo dapp tutorial --- docs/quick-start/developers/_deploy_todo.md | 113 ++++++++++++++++++ .../quick-start/developers/todo-dapp/index.md | 4 +- 2 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 docs/quick-start/developers/_deploy_todo.md diff --git a/docs/quick-start/developers/_deploy_todo.md b/docs/quick-start/developers/_deploy_todo.md new file mode 100644 index 0000000..7df7a45 --- /dev/null +++ b/docs/quick-start/developers/_deploy_todo.md @@ -0,0 +1,113 @@ +#### Create A Wallet + +To send transactions on the aelf blockchain, you must have a wallet. + +- Run this command to create aelf wallet. + +```bash title="Terminal" +aelf-command create +``` + +![result](/img/create_wallet_output.png) + +- You will be prompted to save your account, please do **save** your account as shown below: + +```bash title="Terminal" +? Save account info into a file? (Y/n) Y +``` + +**Make sure to choose Y to save your account information.** + +:::tip +ℹ️ Note: If you do not save your account information (by selecting n or N), do not export the wallet password. Only **proceed to the next** step if you have saved your account information. +::: + +- Next, enter and confirm your password. Then export your wallet password as shown below: + +```bash title="Terminal" +export WALLET_PASSWORD="YOUR_WALLET_PASSWORD" +``` + +#### Acquire Testnet Tokens (Faucet) for Development + +To deploy smart contracts or execute on-chain transactions on aelf, you'll require testnet ELF tokens. + +**Get ELF Tokens** + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +**1. Get Testnet ELF Tokens:** + +To receive testnet ELF tokens, run this command after replacing `$WALLET_ADDRESS` and `$WALLET_PASSWORD` with your wallet details: + +```bash title="Terminal" +export WALLET_ADDRESS="YOUR_WALLET_ADDRESS" +curl -X POST "https://faucet.aelf.dev/api/claim?walletAddress=$WALLET_ADDRESS" -H "accept: application/json" -d "" +``` + +**2. Check ELF Balance:** + +To check your ELF balance, use: + +```bash title="Terminal" +aelf-command call ASh2Wt7nSEmYqnGxPPzp4pnVDU4uhj1XW9Se5VeZcX2UDdyjx -a $WALLET_ADDRESS -p $WALLET_PASSWORD -e https://tdvw-test-node.aelf.io GetBalance +``` + +You will be prompted for the following: + +```sh title="Terminal" +Enter the required param : ELF +Enter the required param : **$WALLET_ADDRESS** +``` + +You should see the result displaying your wallet's ELF balance. + + + + +Go to https://faucet-ui.aelf.dev Enter your address and click `Get Tokens`. + +![result](/img/get-token-ui.png) + + + + +**Deploy Smart Contract:** + +The smart contract needs to be deployed on the chain before users can interact with it. + +Run the following command to deploy a contract. Remember to export the path of ToDoApp.dll.patched to CONTRACT_PATH. + +```bash title="Terminal" +export CONTRACT_PATH=$(find ~+ . -path "*patched*" | head -n 1) +``` + +```bash title="Terminal" +aelf-deploy -a $WALLET_ADDRESS -p $WALLET_PASSWORD -c $CONTRACT_PATH -e https://tdvw-test-node.aelf.io/ +``` + +- Please wait for approximately 1 to 2 minutes. If the deployment is successful, it will provide you with the contract address. +![result](/img/deploy-result.png) + +- Copy the smart contract address from the `address` field +![result](/img/Contract_Address.png) + +- Export your smart contract address: + + ```bash title="Terminal" + export CONTRACT_ADDRESS="YOUR_SMART_CONTRACT_ADDRESS e.g. 2LUmicHyH4RXrMjG4beDwuDsiWJESyLkgkwPdGTR8kahRzq5XS" + ``` + +:::tip +ℹ️ Note: You are to copy the smart contract address as we will be referencing it in the next quest! +::: + +:::info +🎉 You have successfully deployed your Voting dApp smart contract on the aelf testnet! In the next quest, we will be building the frontend components that allow us to interact with our deployed smart contract! +::: + + diff --git a/docs/quick-start/developers/todo-dapp/index.md b/docs/quick-start/developers/todo-dapp/index.md index 4945a04..7d6400b 100644 --- a/docs/quick-start/developers/todo-dapp/index.md +++ b/docs/quick-start/developers/todo-dapp/index.md @@ -10,7 +10,7 @@ description: Moderately difficult smart contract and dApp **Difficulty Level**: Moderate - + ## Step 1 - Setting up your development environment @@ -277,7 +277,7 @@ You should see **ToDoApp.dll.patched** in the directory `ToDoApp/src/bin/Debug/n ## Step 3 - Deploy Smart Contract -import Deploy from "../\_deploy.md" +import Deploy from "../\_deploy_todo.md"