DApps: Create a decentralized application | Programming Made Easy | Skillshare
Search

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

DApps: Create a decentralized application

teacher avatar Programming Made Easy, Software Developer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

    • 1.

      Welcome to this class!

      1:23

    • 2.

      What are DApps and Blockchains?

      3:38

    • 3.

      DApps vs. Smart contracts

      4:37

    • 4.

      This course's plan

      3:15

    • 5.

      Installing the prerequisites

      8:39

    • 6.

      Creating our environment

      10:12

    • 7.

      Compiling the project

      8:27

    • 8.

      Deploying locally

      4:27

    • 9.

      Deploying on cloud

      5:30

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

105

Students

1

Projects

About This Class

This class will be structured in 8 lessons that contain practical steps for you to take in order to understand what is a decentralized application and how to build one from the ground up with zero prior experience. I will show you how you can set up your local development environment, where you will create a local blockchain, and make transactions on it. After this, we will deploy smart contracts both locally and on cloud using our Metamask wallets.

What you will learn in this DApp Course:

  • What precisely are blockchains and how they work

  • What precisely are smart contracts and how to deploy one

  • How to build a decentralized application using the HardHat framework
  • How to make transactions

If you are interested in decentralized applications and also want to create your own, consider this course for you.

There are no other requirements than an internet connection.

Meet Your Teacher

Teacher Profile Image

Programming Made Easy

Software Developer

Teacher
Level: All Levels

Class Ratings

Expectations Met?
    Exceeded!
  • 0%
  • Yes
  • 0%
  • Somewhat
  • 0%
  • Not really
  • 0%

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Welcome to this class!: Hello guys and welcome to this course on the centralized applications. My name is Alex and I'm a software engineer, but I have always been passionate about crypto. When I heard of the possibility of using an application that these decentralized, I was quite eager to devolve what this class will be structured in eight lessons that contain practical steps for you to take in order to understand what depths are and how you can create one from scratch at your own pace. I will show you how you can create a local blockchain and make transactions on it through a wallet. And how you can deploy smart contract both locally and on Cloud. If you are interested in decentralized applications and also want to create one, consider this course for you. There are no other requirements or prerequisites then an Internet connection for the project of this class, it will be extremely practical and it will involve you to follow the steps presented in the course. So you can start on your journey of creating your own decentralized application. And maybe one day becoming a professional web three dot o engineer. We thought the set, I think we already see you in the first lesson. 2. What are DApps and Blockchains?: Hello guys and welcome back to this course where we learn how we can create a decentralized app. In this lecture, we are going to take a look at the definition of blockchain and decentralized apps in order to better understand what exactly they are before starting to implement them. The blockchain is a key component of decentralized app developers. And this is the reason why we will go into detail regarding its definition. You can think of the blockchain as a distributed place to store data among nodes of computer networks. The crucial role of blockchains into cryptocurrency systems comes from its ability to store transactions in a secured and decentralized way. Another important thing is that all these trust is made available without the need of a trusted third party. The meaning of block comes from the way in which blockchain store data together in groups with certain capacities. These blocks of information are linked to the previous one when field to the max, thus forming a chain. The big difference from usual databases is that instead of tables, the data is put into these blocks that form a timeline. Once a block is closed and linked to the next one, it becomes unalterable. Apart at this timeline, just like time goes on, you cannot alter what has happened in the past. These blocks even get a timestamp once they get linked to the next one and they are in the past. Also, all the information stored in these blocks is made public so everyone can see them and check ownership of different acids stored on that blockchain. Here. As a more practical example, you can think of its applicability with LFTs and their ownership. The term depth comes from decentralized application. These are applications that run on the blockchain. Being decentralized. They are quite different from the other apps As they do not obey the control of any single authority. You can think here of centralized app like any EPA to have on your phone that is centralized by their owner. This decentralized apps can better safeguard user privacy and they can also resist censorship. Disadvantages also have some drawbacks, like a lack of ability for scaling and difficulty meeting User-friendly interfaces available. And as we will see when we will try to create our own depth. But without this being said. And I look forward to see you guys in the next lecture where we will make a plan for our course and see an exact roadmap for implementing this application. Thank you very much for sticking with me up to the end of this lecture. And I look forward to see you in the next one. 3. DApps vs. Smart contracts: Hello guys and welcome back to this class. In this lesson, we are going to take a look at the difference in between smart contracts and decentralized applications. There seems to be this confusion between the two. And people even thinking that they are one and the same thing, which we will see it is really not the case. Even though a lot of people think that smart contracts are the same thing as decentralized applications. This confusion is made a lot. This is not quite true. In the last lesson, we concluded that decentralized applications are just programs that are decentralized and they run on the blockchain. They have no central authority. These were decentralized means. They just connect the participants in the network. For example, you might have heard of lending programs that working the decentralized way of blockchains. And they are called DeFi. They allow you to borrow without intermediaries. Since there are no executives, all transactions happen automatically with the use of smart contracts. That decentralized aspect that compose depths could not be made possible without the use of these smart contracts. On the other hand, smart contracts are self-executing contract. In fact, it is a program or protocol in which a certain logic is late, as we will see when we will create one from scratch and deploy it on the Blockchain. Smart contracts are based on if commands. If a certain action occurs, it will trigger another action. They run only once certain pre-defined conditions are met. For example, if I want to take out a loan, I need to provide collateral. Only when this requirement is met. I will receive a loan. Or an even more concrete and simple example that might get to you more quickly. Let's say you are trying to maintain NFT. Well, only if you have enough Ethereum in your bathroom mask wallet to do that, the transaction will actually happen. Example is quite simple. In fact, the logic is of course much more complicated since it is intended to be the main regulator of decentralized platforms activities, meaning it should not get away with any fault transactions. So depths are applications that work on the basis of smart contracts. Smart contracts are elements of decentralized applications. They are not one and the same thing, but they work together to make these popular decentralized flow possible. In simple words, depths utilize these smart contracts to function indirectly connects a member with a provider. Now, you can see the whole workflow of decentralized application. So this is quite unique and different from the workflow of normal web application. As here, the blockchain is D enforce that is stored in Cloud. And the web browser remains the same as traditional web application where the web browser will they have been on your local machine. But you see the front end is made available with IPFS using HTML, CSS, and JavaScript. This is again the same as it would be on a web application that is traditional. But then we execute on the Ethereum main met with a smart contract and then Ethereum Virtual Machine, these transactions, and they are saved in retrieved from the blockchain where all the information is stored on Cloud, decentralized in computer network nodes. But this was about it for this lecture on the difference between smart contracts and decentralized applications. I really hope you guys got something out of it. And I look forward to see you guys in the next one. 4. This course's plan: Hello guys and welcome back to this course where we learn how we can create a de-centralized f. In this lecture, we are going to see what exactly is the plan for this course and how are we going to implement this application? To create a decentralized application locally as we will do, we are going to need to handle two things, the right and the read of information. Just like in a database, these operations are crucial for blockchain and decentralized applications. Now to writing a blockchain, you as a user need to make a transaction that will be sent to some authorities. These authorities are called very fires. What these will do is check that all the information regarding your transaction is all right, and that it can be actually made things like you have enough money in your account and so on. They will not make these verification for free. So each time you send a transaction, in order for it to get through, you need to pay what is called a guess fee. To have an identity and be able to make transactions on a blockchain, you will need a wallet. And for this, you can head over to mathematics dot IO, which is the most popular wallet nowadays. And it functions on a lot of cryptocurrencies, but mainly on Ethereum. In this tutorial, we will use a framework that is called hard hat, which will allow us to more easily make a blockchain like structure locally in order to better understand how we can work with it. Once we do that, we will move on to a test net stored on Cloud where things are behaving just like on the main net. We're real equilibrium gets traded through transactions. No real money will be maybe in this tutorial. So do not worry, you were main goal here is to learn. That is the reason why we will not use the Ethereum mainland. Now S4, the reading of information for our local node of blockchain. We will build it using a Node.js application. In the next lecture, we are going to take a look at how we can install NodeJS and also NPM and a few other things like the heart head framework that will allow us to furthermore get to the implementation of these decentralized application that we plan on doing. It follows this sounds interesting to you. I thank you very much for sticking with me up to the end of this lecture and I look forward to see you in the next one. 5. Installing the prerequisites: Hello guys and welcome back to this course where we'll learn how you can create a decentralized application. You are going to need NodeJS, which is a JavaScript framework. In JavaScript is a programming language in case you did not know. Don't be scared by these meanings. And three, discouraged if you have never written code before in your life. Because it is going to be very easy. Trust me, I'm going to guide you through each step and I will explain to you what to write in each field. After all, it's just text writing, so it will not be complicated, I promise. After running NodeJS, which we are going to need in order to run a script that we are going to get from public space, we're also going to need a text editor for our code. A place or an IDE, which is also the naming of it, where we are going to be able to modify our code that will help us deploy our collection of NHD is getting started with installing the Node.JS JavaScript framework. If you are on a Mac like I am, you can simply write this command to choosy on my terminal, which is the second line. I will highlight it for you just so you can steep, more clear. But if you are on Windows, you can also search on Google for Node.js. And you can see that it will appear at NodeJS that, or you can go ahead and click on Download. And then furthermore, select the exact distribution and operating system that you are owned. If you are on Windows, you can choose the windows recommended for most users version and then go ahead and download it. And furthermore, install it, as I said, now, going back to Mac, if you are going to install NodeJS from your terminal, you are first of all going to need to install Homebrew, which is going to make your life much easier and will also help you to install NodeJS much more easily. And actually that's what this instruction on the second line is. For. Once you enter it in your terminal, you will be prompted to write your password for pseudo axis so it can install it. And then it will go ahead and install it pretty much. Now, if you want to see if Homebrew is actually installed on your machine, you should just write brew and then dash v from version. And you should see the Homebrew and then the version of it. And pay attention debt, you also need to add to path the Homebrew in order to, for it to work and actually give your version to you when you write root dash v. And now the second step here, which is to actually install NodeJS using Homebrew, which we just installed, is to write brew install Node. Now, as you can see, it will go ahead and install NodeJS for us. As far as Windows goes, you can just go ahead and download the installer in the ingest, install it with the UI. If that's easier for you, you can do the same thing on MacOS. But from terminal with homebrew, I just find it easier. However, you prefer to do these processes fine. If you choose to install NodeJS with determiner. Again, you can just write after it is installed Node and then dash v to check if it has actually been installed and check its version. That was it for the Node.JS installing. And now we should just take a look at our IDE, which is going to be officials to the opcode. And we are choosing here Visual Studio code as it is very lightweight. And it will be much easier for us to run the code that we need to round with NodeJS using Visual Studio Code. And also if you don't have the latest machine, not a problem because Visual Studio Code is much more versatile and it does not demand such high System Requirements. So you can go on the download button from Visual Studio Code. And again, depending on your operating system, you should install it from here, it is going to be pretty straightforward. Now after we finished installing Node and also Visual Studio Code, we also have discussed that we need to have an identity on the blockchain. And how we do that is by having a wallet. And in our case, we are going to use the mathematics quality, which is the most widely used. Amongst people that are making transactions on the blockchain. And it is also a very secure option, even though not the most secure, because the most secure option would be to store your n if T is in the PBM on a cold storage device desktop linked online anyway, cannot be hacked. But this is the next best thing. As with the cold storage, you cannot make transactions. For that. We're going to just try it on Google mathematics and then head onto the download page. And this is just a Chrome browser, so we can go ahead and click on the installment payments for Chrome button. And you can see that we are directly redirect it to the Chrome extension page and we can click on Add to Chrome. You can see that it is used by ten plus million users. So that is a good sign. Now it has been added and we can get started with setting it up. Depending if you have a wallet, you can import it, but if you do not as I don't have any wallet already, I can create it. And then we can say that we agree we need to create a password here. So I'm gonna go ahead and do that. Now, especially if you are going to store the trivium here, I suggest that you have a very secure password, preferably one that is generated by some sort of machine. So not really your name and the number or the best word like this is my password. And then 1234 debt with network here is that it's not really security and you would be at a high-risk get head. And after we do that, we can go ahead and get a secret recovery phrase, which in case you lose your password for your account gets hacked, it's going to be less chance to get your account works to disease, again, very important. And you would click here to reveal your secret words. And then you would click on Next. I'm not going to do this right now, but you should definitely do it. And as you can see, we have setup our account right here. We are on the tibia minute we do not have any helium, but we have an account with public addresses. You can see the weekend bind sale or swapped to other currencies, our epithelium. This is the way in which we can buy the PBM we can buy NFP is in, we can buy anything with cryptocurrencies and also any cryptocurrency that these mathematics quality support and this is the TVM. There are a few more, but this was about it with the mathematic wallet also sell pretty much the setup is done and we are able to move on to the next step, which is installing the hardhead framework on our local machine. We followed that sounds interesting. I really look forward to see you guys in the next lectures, and I thank you very much for sticking with me up to the end of this one. 6. Creating our environment: Hello guys and welcome back to this tutorial where we learned how we can make a decentralized application. In this lecture, we are going to take a look at furthermore, setting up our count with the heart head framework. Which side you can see on the right part of the screen. Now, just to get a quick recap going, in the last lecture, we installed Visual Studio code in order to have an environment to write our coding. We also installed Node and npm and MP hex, which you can again check if you have by going into your terminal or command prompt if you're on Windows and writing node and then a space and the HV and then aversion should come up if it is installed. The same thing goes for NPM in NP x. Now, we want to create smart contract locally. And the way we are going to do that is with JavaScript, the React framework, and also the heart framework that you see again in the right part of the screen. Why are we using the heart framework is because it makes our whole application much more easier to be implemented. And it creates an environment for us that simulates the whole Ethereum network locally on our computer. And of course, we will create these smart contracts that we are going to do here locally later on the global test net as well, using another online too. But for now let's just get the basics right by greeting it locally using hardhead. The first thing after we already installed notes. So you can see that if I come here and I write node dash v, I have a version coming up. Also, all these things that I'm seeing here are open source and you can go ahead to the heart head.org on the Get Started. And here you have the entire documentation where they go ahead and tell you how you can install these two and also how you can run the app F32 is installed. If you find any missing information or something is not clear to you, of course, you can go ahead and reach out to me, but also you can go ahead to the official documentation and check out what they are saying and how they are doing stuff. Also, I have inspired from this open source documentation cell. It will be easier for you to follow my tutorial Dan to start reading the documentation. But just in case you want to go a bit deeper, you can go ahead and do that. But other than that, the next step is to switch to whatever path you want to or folder to be at, in my case, is going to be Desktop. And you're going to set up our React app that we will use to interact with this environment of IQ EVM default payment debt. Hard-hit is going to make available for us. How we are going to do that is we're going to write np x, and then we are going to create a React app. And this is exactly how it sounds. Create React app. And then we give it whatever name we want. So in my case, I'm going to stay, I am going to call it depth. This is coming to basically create a React app. After, of course I'm installing the package of Create React app. I'm going to go ahead and allow that. And you can see that with no problems, you can create the app if it does not have any uppercase letters in the meaning. And it will go ahead and do that. It might take awhile cell. I will skip over these process when heat is actually creating this app. And I will come back to you after it is finished. Cell, you can see that right now our application is actually done and we can change the directory to it. And I just did that so it all worked out. You can see all discounted the throat again. It ends with p-hacking. You, Mike, use that as a clue. S2, The thing is over. And next, we need to go ahead and set up hardhead in this folder that has the reactor have in it that we just created. We again, alongside installing and setting up hardhead, it will also meet some dependencies. As you can see in the right part of the screen, there are some dependencies here that the 11 It will give us some problem later when we are going to try to run this project if they are not installed. So we are going to install it right now. And we can just go ahead and copy these from the hardhead website. And again, it will go ahead and install all these dependencies of hardhead. And after that, we're going to look a bit at the configuration file of the hardhead project named we are coming to change the network node in order to be able to connect it to our mathematics wallet. But again, let us just wait until all of these dependencies are installed. Okay, so now that all of the hardhead dependencies are installed, we can go ahead and create a hardhat project. And for that, you can see here we need to learn MDX hardhead to do that. So we are going to go ahead and do that. You can see here we have quite a few options that we can choose. I'm going to create a simple project, a basic sample project cell. It is going to redirect me to the current path, which is alright with me, so I can click enter and then we can also create a clipping path for it. And we're not going to help them with our data. Do not worry if you do not understand what a gaping, ignore these or any of this stuff, it is not really that important. And you can also go back and look at it after you gave some more experience. Because the important part we are going to deal with here, and it is to change the config file of this hardhead application and environment. It is correctly here in order to be able to connect it, as I said, to our mathematics quality. And to do that, we need to change a file called hardhead that conflict that js. We can go ahead and, and get into it. I'm going to use the vi text editor to change it. But again, you can write code and then the name of the file and it will open you Visual Studio code in this file in it. And again, you are going to be able to change it that way. You can see that after the solidity part, I also added the paths with the artifacts member. And this basically specifies the path at which our smart contracts will be compiled that so in our case, it will go from the current back to the SRC folder and then into artifacts. Also, the networks know these needed here as this will help us with the mask. And this is where this gene IEP does. It will help us to actually connect these nodes that we are creating with our mathematics wallet. And this is the 1337 hard-coded here. After you do that, you can basically go ahead and save this file. So after we did all these, we can go ahead and start the node that we created with the command of MDX hardhat. Note, as you can see, this is our blockchain. It started on HTTP at the one to seven, that TO that, oh, that one. And these accounts have two parts in them. They have the public key and then the private key. The public key is the one at the account number. And also it specifies how much value it has in them. This is also test the premium, so it's not real money. And then here it is the private key that you should keep, as the name says, private. Now we can try to connect to our local blockchain that we created with the hardhead framework using mathematics. We can go ahead and click on the mathematics here. From the drop-down we can click and we can show and test showing high test networks. So we can go ahead and we can show the test networks. And then we also have the local host 8545 here. So we can switch to it. A few more things happen here, but now we are actually having an account on these Ethereum blockchain that we just built. That's pretty exciting. And in the next lecture we are going to take a look at exactly how we can make basic version of decentralized application, also called the smart contract. And also in future lectures we're going to take a look into how we can create these smart contracts on the global test net evolved. That sounds interesting to you. I look forward to see you guys there. Thank you very much for sticking with me up to the end of this lecture. 7. Compiling the project: Hello guys and welcome back to this tutorial where we learn how we can create a decentralized app. In the last lecture, you remember that we actually created our React app and also installed the hardhead framework Intuit and basically created with it simple application. Now we are going to actually compile this project that hardhead created and also send some Ethereum from one account to the other after checking out the solidity greeting file that is already installed by default by hardhead into this folder. If we go ahead and see the contacts folder, you can see here that we have the greater dots of file. Also another thing to note here is that in the SRC file, we do not actually have a meeting as tc is the place where we later on we'll compile the project will, we'll get the artifacts. So the return JSON file as the Solidity file of Greater East, what we will actually compile. But to checkout these greater dot saw content, we can go ahead here in determiner and open another tab and change the directory to contract. Then let's just do nano on discrete or soul in order to check out, as I said, it's content. And you can see here that what these actual solidity file does is provided to us basic contract needs. And these are, as we have discussed, the reading and writing into our blockchain. And it does this by a contract, as you can see, that is called Greeter. It has private field called gripping, that is a string. And then we have the grid function in the set greeting. So they said we think would be the writing and the grid would be the rebuilding. Of course, you do not need to understand the syntax of this linearity files. You just need to have a basic understanding on what these functions actually do and nothing else more is needed. But even though this file was created here by default, we actually need to compile it in order to be able to be understood by the JavaScript framework of react that our project works with. To do that, we just need to do an MPLS hardhat compile command. And to do that, first of all, we need to go ahead and quit this nano file. And then we're going to change the directory back to the depth one and we will do the MPS hardhat compile. And as you can see right now, it's downloading the compiler of hardhead and it will furthermore compile our whole project. You can see that it compiled them successfully. And how are we going to do that is by going to the SRC folder and you can see that it actually created these artifacts for their debt was not here before. And we can go even deeper emit into contracts as these are the smart contracts that it created. And we actually have one for degree per dot. So file, we have the JSON right here. And after we have done this, we can actually start the network and deploy contract. Now remember if you are coming back to this project after awhile and you closed it. In order to open it up again, you just need to go to the depth directory and dry it and px. Now, by default, it will start all over again. But right now with our project compile, we can go to our maximum escape County and actually important account and then transfer some deuterium to recount. So we can go ahead and open our Chrome browser here. And we can go on mathematics, and we can import our wallet. So as you see here, we have 19 wallets and we can go ahead and import the first one. How you are going to do that is you're going to click on the circle right here and click on Import Account. You just need to paste the private key and that's pretty straightforward. You just copy it from here. Then go ahead, paste it here, and just import it. And as you can see, it imported our 10 thousand Ethereum account here with no problem. But the thing is that we would need to create another account as the private key for this one is compromised, as you already see it in this terminal right here. So to do that, you can again go to the circle and create an account. And then this one is to be our actual account. You saw two remaining few just need to go to account details and then click on this pin right here. And to send some Ethereum to this account which is freshly made borrower maximus quadrat, which we know has top-notch security. We can just go ahead and copy its address and then switch on not to another network, but to our account. And then from here we can send some Ethereum. And it asks us for the public address which we just copied. And then for the amount that we want the stand, we can go ahead and send 1000 theorem. Then if we click on Next, it will also give us a guess fee that depends on how busy the network is at the time. We can go ahead and click on Send and you can see that it is spending and it actually was sent. And now if we go back to our count, you can see that we have 1000 PPM on it. They TVM was sent. And also another thing here into the console, we can see that things are happening in our blockchain and things are written, as we have explained in a previous lecture, they are publicly available to be seen by a viewer on each transaction. And also it happens in a way that you cannot modify transactions that already happened. So you can see here, our transaction went through the Ethereum centroid transaction. It has an ID. Also here are the public keys of the two wallets that were implicated into this transaction. You can see that it was the from this account, this account, and you can actually see the 0 X5 eight D is here as well, so the data is accurate. You can also see the value that gets used and also the block written, and also there some other stuff that happened other than this transaction. But I think you get the main picture and you see how these blockchain is actually working at a deeper level, then we would have just seen if we deploy this smart contract directly on the main hat, we will do in future lecture. But QC, the basics and how it is actually working gets pretty important in my opinion. But other than that, I really hope you guys got something out of this lecture. And I thank you very much for sticking with me up to the end of it. And I look forward to see you guys in the next one. 8. Deploying locally: Hello guys and welcome back to this course where we learn how we can create a decentralized app and also how to interact with it. In the last lecture, we set it up our environment. We also created a React application where we deploy the heart framework and that created an entire smart contract for us. But in this lecture, we are going to deploy this smart contract that we took a look at in the last lecture. If you remember, in the last lecture we took a look at the contract that was already in this folder and it was created by hardhead. It mean was greater source. So we can take another look at it by just going ahead and opening it up. And you can see that these had basically the greeter and set greeting functions that were meant to communicate on the blockchain. And basically we're reading and writing functions. To deploy the script. We already have a way automatically to do this, and it is provided by hardhead. And the way we are going to do that is to go to script and then sample script.js, which is the way in which we are going to deploy this on our local host, on our own network. And we have a command for that. But for that, we can go ahead and list again all the structure for this demo folder. And you can see that we have the scripts folder. And if we go in it, we see furthermore that we have the sample script.js. And if we take a look at it, you can see that what it does, it has only an asynchronous mean function. And when it is run, this function gets executed. And what it does eat declares two constants. And the first one, it is going to get the contract factory with the name of greeter. And then we're going to deploy our greeter object, which is the constant here with the hallow hardhead string. And then we will wait until this gets deployed. And then we will also log that it got deployed successfully. And then we will see the address after we will execute this, we will see, as we saw in the last lecture, is right here where our project was running. We are going to see here the logs, but other than that here domain after it is done, is going to exit the process. And of course, the greeter that SOL we took, luckily it earlier, it had those two functions and rethink. Function is going to be executed with the message of Halo hardhead. But to basically get these executed, what you are going to need to do is to go to the root directory of your application. In my case, is the depth route. And go ahead and write np x hardhead run. And then Scripts dash sample script.js. And once we do that, the command will go ahead and deploy our contract. And we will see that in just a second. I had a little typo there, but as you can see, it tells us the greater voice deployed to this address. As I already told you that it would tell this. And also this address is very important because it's the address in which you can interact with the smart contract that you actually create it. So with this being said, this is the way in which you can locally deploy a smart contract that is created by heart head. And I really hope you guys got something out of it. I thank you very much for sticking with me up to the end of this lecture and I look forward to see you guys in the next one. 9. Deploying on cloud: Hello guys and welcome back to this course where we learned how to create a decentralized application. In this lecture, we are going to deploy our first smart contract on the Ethereum blockchain using the remix Ethereum IDE, the p is available for free online. So if you remember, in one of the last lectures, we talked about smart contracts and what exactly they are. And we understood how they are exactly useful in the context of MFT. Now, we're going to deploy one on a local test network. So you do not have to worry because it will not cost you anything to deploy it on a test network that is locally. And you can play with it as you would with a one that would be deployed on the main net. So with the real deal, now, first step is to do, as you see on the screen VC, the remix website. The link to this website is the remix dot dot ORG. Once you are on the website, you can create a new dot SOL file so you can write your script in it. And how you are going to do that. You are going to go in the top left screen on this page that is available right here. And you can click on it and you can see here that a new file, these being made available for you to enter each name. And we're going to give the hours smart contract name. And you also need to write its extension, which is going to be that SOL. So next you are going to have to write this code into your SOL file. And this one just specifies at the line to the version of the ESP edX license of MIT is not such a big deal. Every smart contract, we'll have that pragmas solidity up there with a specific version. But next you can see that we define the contract with the name of counter. Then we define the integral, which is the count of the contract. Then we define a method which can increment the counter. And increment means basically add one to each value. And we also have a method which will return to us the number of the count value. Now for these smart contract that is written there, we need to deploy tried and how we can do this? Well, we can go in the left menu bar, the solidity compiler first of all, and then we're going to compile our gut SOL file. You can see that it compiled very quickly. Next, to basically see inside your smart contract, you are going to go one tab lower to deploy and run transaction. If you click on Deploy without the published to IPFS, the interplanetary file system. You are going to see that basically it will deploy it locally right here on the diploid contracts. And you can see information about each one of its fields. And also you can see the logs of the transactions displayed in the bottom part of the screen. If you click on increments, you can see the log det, the transaction first of all, to counter that increments the spending. And then the transaction actually happened, as you can see from these green tick displayed right here. And you can see that the count went from two to three. And when we click on getCount, it is three as well. Now again, if we increment it and get count, it is for the count gets RBD to four again, but only once we hit it. So you can see that all of the fields that we wrote basically work. Also the way in which you can see your contract is actually deployed on the desk network is from the current environment of JavaScript VM, which is displayed right here. So if we had the injected web dot three, it would actually deployed directly into the Ethereum blockchain. And you could be able to make a transaction from it to your mathematic wallet. So you can see basically how a smart contract works. What is the code behind it? Again, this is a very simple smart contract that only has three fields. If you go and check on ether scan, a contract that you want to meet or just check its fields, you are going to see that it actually has quite a lot of fields. But this was about it for this lecture on creating and deploying our very own smart contract. I look forward to see you guys in the next lectures. And I thank you very much for sticking with me up to the end of this one.