Skip to content
CCPEDIAby Unity Nodes
VideosDaml 101: Getting Your Dev Machine Ready [2022]

Daml 101: Getting Your Dev Machine Ready [2022]

Nothing is loaded from YouTube until you press play, and then without tracking cookies.

About this video

📚Check out Daml Learning Center: bit.ly/LearnDaml 📖Join our forum and get started: bit.ly/tryDaml

This is a multi episode series intended to take you from the brief context behind blockchain and smart contract to the development of smart contracts using a next-gen smart contract language called Daml. The entire series can be found here: bit.ly/damlone

Daml is a development framework for creating systems of record that securely connect across business processes and data boundaries while retaining privacy, guaranteeing data integrity, and enforcing strict authorization. Allowing such systems to cross boundaries — legal, regulatory, organizational, or other — enables them to form seamless economic networks.

Transcript

2,016 words

Captions as YouTube publishes them, usually machine-generated, so names such as Daml and Canton can be misheard.

  1. 0:00

    in this video i'm going to walk you through getting your machine ready for development and in no time you'll be building your first smart contract based app pc mac os i got you covered hi this is steve shaw from digital asset had you told me six months ago that was possible to build a smart contract-based application or platform in just a few hours i would have told you that you you are crazy or in new york they would say get out of

  2. 0:36

    here or in singapore cannot lie i'm going to tell you that it's possible to do it using something called damn in this video i'm going to walk you through getting your machine ready for development and in no time you'll be building your first smart contract based app pc matt go ass i got you covet stay tuned singapore let's get started regardless of whether you're on the mac or pc your first stop is demo.com and

  3. 1:16

    you're looking for download demo connect this page shows you what you need to do and the first thing you need to do is to download visual studio code whether you're on a mac or a pc i'm going to go ahead and show you how it looks like on a windows machine and it should look the same for the the mac os as well and ta-da it's done all right i like to pretend to be mysterious so i'm going to go to dark theme and let's uh move on to the next step

  4. 1:49

    now back at our demo.com documentation our very next step is to install the jdk the java development kit and here we are i'm going to accelerate through these frames so we save time let's accept all the default and you should be just fine well not quite because windows is going to need to know where to find the java libraries that you just installed so we do this by setting the java home

  5. 2:16

    environment variable and for those of you who do not despise the gui i'm going to show you the fastest way to do this click on the start icon and what we're looking for is view advanced system settings look to the bottom and click on environment variables click on the new button under the user variables you see a variable name and value paste in java underscore home and then paste in the path to your java executable

  6. 2:46

    and click ok and click ok a second time and you are done and easy right now let me show you the painful way to do it i'm kidding all right this is powershell on the left and command prompt on the right if java is properly installed you can run a java space dash version on both the command prompt and the powershell and you should get a output like this that confirms that everything is good the next thing you want to do is to check for the path and see if you can see an entry pointing

  7. 3:17

    to where your java libraries are installed and this is the same one that you can find in the environment variables that we saw before remember that path is one environment variable and there are others like username for example having the java library show up in the path is not enough we need to add a new environment variable called java underscore home now if you try to query for java underscore home right now in the powershell or your command prompt you are not going to find it here the

  8. 3:49

    command prompt simply echoes what you are trying to find telling you that it cannot find it the reason for this is simple it hasn't been set check this out it's nowhere to be found setting it is easy enough back at the command prompts you can run these commands to find out what the variables are and the way to set variables if you were to google for the answer is to use the set command like so

  9. 4:14

    in this case i'm setting the variable variable 1 to disco or if you want something fancy you can do that and as you can tell it is inserted fantastic and over at the command prompt you can do a similar way to set it check it out the dinosaurs are there wait a minute something's wrong isn't it where on earth are my disco and pagers it's missing shouldn't it show all three variables it gets worse when you restart

  10. 4:48

    the powershell and command prompt and try to query for those variables again guess what everything is gone disco is gone pages don't exist dinosaurs have disappeared why because the variables in the way we set them only exist with the session once the session is over it disappears so we need a better way a more permanent way to set those variables and this is how we do so for both powershell and command prompts you can use the set x variable

  11. 5:18

    name followed by the value we're going to set var5 to texas and we're going to set var 6 to tattoos and if you check and run a query you will see that both of them will exist in this case we just need to refresh prom run it again and you see that it sticks and we can confirm this with the environment variables but let's take a look at powershell make sure it's there yep texas and tattoos

  12. 5:51

    there forever and click environment variables and there they are again so now we know that it sticks and it lasts across sessions so now what we really need to do is to find a path to the jdk copy the value and then set it like we did for the texas and tattoos now to find the path in powershell you can do path just to see where it is or you can use a get command dash or java and that should give you the string but it's a little problem here the ellipses don't show an

  13. 6:22

    entire string no worries just add the following to the end of the same command and you should be able to see uh the string the entire string of where the path is pointing to java executable now over at the command prompt you can simply type where java now in the event you have multiple versions of java and you want to point to a specific one you can use a command like this in command prompt to iterate through all the executables that you may have so you can

  14. 6:55

    point to the right one so back at powershell you want to execute this command set x java home and then the path pointing to the executable but before i do that let's just make sure that we're not cheating here this is the environment variables and you see that it's not there and we're going to go ahead and run this command to set it and it says that specified value is saved was saved let's go back to the variable and tada there it is likewise for the command prompt we do

  15. 7:28

    the same command and we go ahead and execute it just like the powershell and that should stick all right let's move on to the next step for windows it cannot be simpler click on the installer and let it run and accept all the defaults and you should be good to go when the demo sdk has finished installed there is a simple way to verify if it got installed correctly just go to your powershell or your command prompt and

  16. 7:59

    type in demo help and that should show you an output just like this which tells you that it has been installed now you can also type demo version which will give you the latest sdk version at this point in recording it's 1.16 believe it or not that is all you need to start to write some demo to create a new project type demo space create demo app and the name of your project click enter and you should get a confirmation that a project was created

  17. 8:40

    successfully now in the next line type demo studio and that opens up visual studio that is specially configured to read and have you work with your demo project now in this case when you type demo studio you will see that visual studio will open up but the folder structure looks wrong that is because we were not in the right folder so this is one common mistake that a lot of new developers make and that is to forget to cd into the name of the project which is a folder

  18. 9:21

    so cd into it and run demo studio again and you should see the file structure that was created for you there you go now in visual studio code if you open up the demo folder you see a demo file this is the demo file that you will be working with to write your smart contract more on that later i promise to take care of the mac people so you windows people can go and the mac people let's talk mac developing your demo project on the mac is identical to windows in the sense

  19. 9:54

    that we're going to use visual studio code so go ahead and install visual studio code and then the next step that we have on the mac is to set the paths just like we did for windows all the directions that we need to set up your mac is found on the web page the first thing we need to do is to run an echo shell command to find out what kind of shell you're using if you do not know it's either going to be bash or it's going to be z shell the following example i'm going to use z shell but

  20. 10:25

    bash is perfectly fine and the directions are all found in here for the two flavors so in my case i'm going to scroll down to the z shell or some of you may call it the shell and paste copy and paste this command this would do two things it will set the java home variable and the path variable for the demo sdk and yes you're correct we have not done the installation of the demo sdk quite yet but we'll take care of it in this two lines now go back to your terminal

  21. 10:57

    and do a echo java home and you realize that it's coming back blank uh-oh no worries fire up another terminal and you realize that it is really there that it has persisted fantastic now let's go back to our web page and proceed to the next step which is to install the sdk in this case we're going to issue a curl command from the terminal and if you would do a demo version you'll find nothing which is correct because we have not installed demo that's fine and we're going to copy and

  22. 11:30

    paste this curl command and let it run in the interest of time i've accelerated the frames but it should only take a few seconds now once uh demo sdk is installed you are ready believe it or not now let's start our new project by issuing a demo create demo app command followed by your project name like such and go ahead and this time i've learned from my previous encounter to make sure

  23. 12:01

    i cd into my project folder before running demo studio and if all goes well type demo studio and visual studio should fire up with your project ready for you so that's it i am excited because in the next episode we're gonna go right into the code and you're gonna be well on your way to developing your first demo app join me next time see ya you