|
1 |
| -# simple-Dapp-typescript |
2 |
| - This is a basic CURD decentralized application in typescript |
| 1 | +# Dapp in typescript |
| 2 | +**A Create Your First dAPP On ethereum** |
| 3 | + |
| 4 | +#### AUTHOR: |
| 5 | + |
| 6 | +- [Vinod](https://github.com/vinodnextcoder "vinods's github profile") |
| 7 | + |
| 8 | +#### DESCRIPTION: |
| 9 | +This repository contains a source code to create simple CURD application and smart contract code. |
| 10 | + |
| 11 | + |
| 12 | +#### Setup |
| 13 | +- Follow this [Article](https://cmjagtap.medium.com/create-your-first-dapp-on-ethereum-6eb50b4083f2) to create a decentralized application. |
| 14 | + |
| 15 | +# Introduction |
| 16 | +```ts |
| 17 | +In this article, we are going to build a simple CRUD decentralized application on theEthereum blockchain. Also will create a CRUD smart contract for the sameapplications. This is a practical hands-on article. |
| 18 | + |
| 19 | +Details process https://medium.com/geekculture/create-your-first-dapp-on-ethereum-6eb50b4083f2 |
| 20 | + |
| 21 | +- 1.Basic understanding of solidity or general programming. |
| 22 | +- 2.Metamask extension on chrome or firefox. (To connect withweb3) |
| 23 | +- 3.Basic understanding of Web3. |
| 24 | +- 4. Wallet on metamask with some ether(coins) for a ropsten network. |
| 25 | +- 5. Nodejs or javascript understanding. |
| 26 | + |
| 27 | +``` |
| 28 | +## Smart Contract Deployment |
| 29 | +``` |
| 30 | +This is a simple curd smart contract, which deals with students’ data. |
| 31 | +Let’s deploy the contract in a remix environment |
| 32 | +First, navigate to address https://remix.ethereum.org/ |
| 33 | +Add new curd.sol |
| 34 | +file and copy-paste the code from the repository. |
| 35 | +From the left side click on the 3rd button deployment window will appear of metamask |
| 36 | +``` |
| 37 | + |
| 38 | +# Setup Steps |
| 39 | +``` |
| 40 | +Smart contract deployment on ropsten network |
| 41 | +First, create an account on https://infura.io get infra key |
| 42 | +Testing of a smart contract. |
| 43 | +The architecture of a decentralized application. |
| 44 | +Build the decentralized application (dAPP) to interact with the blockchain. |
| 45 | +Run and test the application |
| 46 | +get abi and contract address from https://remix.ethereum.org/ |
| 47 | +
|
| 48 | +Run commands nodejs |
| 49 | +
|
| 50 | +``` |
| 51 | + |
| 52 | + |
| 53 | +## Installation |
| 54 | + |
| 55 | +``` |
| 56 | +npm install |
| 57 | +``` |
| 58 | + |
| 59 | +## Run |
| 60 | + |
| 61 | +``` |
| 62 | +Step-1 |
| 63 | + npx ts-node src/index.ts |
| 64 | +################################### |
| 65 | + Insert Record uncomment this linse |
| 66 | + obj.createStudent('Vinod','MSc'); |
| 67 | +comment |
| 68 | +obj.readStudent(0); |
| 69 | +Step- ooutput |
| 70 | +{ |
| 71 | + from: '0x8aeaexxxxxxxxxxxxxxxxxxxxxx', |
| 72 | + gasUsed: 101374, |
| 73 | + logs: [], |
| 74 | + logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', |
| 75 | + status: true, to: '0x83977bf3e9xxxxxxxxxxxxxxxx', transactionHash: '0x37169068b6606193XXXXXXXXXXXXXXXXXXXXX', |
| 76 | + transactionIndex: 25, |
| 77 | + type: '0x0' |
| 78 | +} |
| 79 | +
|
| 80 | +---------------------------------------------------------- |
| 81 | +Step-2 Reading record |
| 82 | + npx ts-node src/index.ts |
| 83 | +################################### |
| 84 | + To read record |
| 85 | + // comment this line in the index file |
| 86 | + ---->> obj.createStudent('Vinod','MSc'); |
| 87 | + // uncomment this lin |
| 88 | + obj.readStudent(0); |
| 89 | +
|
| 90 | +
|
| 91 | +``` |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +MIT License |
0 commit comments