Hyperledger Fabric setup on VirtualBox

38 minutes
Share the link to this page
Copied
  Completed

Transcript

Hello, today I'm going to show you how to set up an N work environment for hyper ledger fabric on level two. So, the reason I'm choosing a boon to other, I don't know, let's say Windows is because the last time I tried to set up a hyper ledger on Windows, I got blue screens when they tried to run the Docker. And the reason I'm not using Ubuntu for that matter or any other Nexus because it's very simple, and it has everything I gate. So in order to run the bundle, obviously it would be preferable if you can write it natively, but I like to play games so so I need that virtual machine and I'm going to obviously going to be using VirtualBox I can To show that you can use any virtual machine like VMware or you know, whatever. So I'm going to be using VirtualBox I assume that you know what it is.

And I'm going to show you shortly how, what result we're going to achieve. So this is the VirtualBox hyper ledger running right now. And I'm doing some coding testing out and stuff. Hit it is it's a, it's a blockchain running a, here's one here, and this one I'm using to instantiate the commands to access the chain code, as you may see. Anyway, so this is the end result we got to achieve. So let's start from the very beginning.

So what we need is to create a new virtual machine. I'm just going to set up more seams. All right. I'm going to create a folder for my hard drive. There's a hard drive. It is dynamically allocated.

Yeah, seems fine. Oh, okay. Let's start it up. Yeah, obviously you will need to download DLL bundle a I am going to provide the links in Youtube description, but I'm pretty sure it's easy to find. Yeah, obviously it can you So one day feel like it you know are cool into whatever or awkward or if you prefer, it should work the same way. Okay.

So, the installation process is, you know, quite straightforward that has really nothing to talk about it you just, you know, agree, skip, go on and you just wait till the installation is done. So, obviously, I'm going to be skipping this part, or maybe I'm gonna increase the speed, just in case just in case Okay, so here it is finally I have absolutely fresh levanto installed. I also updated it because if you don't update it, it gives asking you and I do not remember. I was too lazy to disable updates. Anyway so the first thing we need is to obviously find the console. It is.

So the next thing which we need is do basically is to start set it out setting up the hyper ledger. environment first thing you need is Dockers. So a bit of in many ways of installing it. This is the only just one. Oh righty. Oh by the way, obviously you can install Docker i O.

But if did they think I'm not using this is because I think doctor I Okay, I think let's say Docker. Okay, so here it is 1.5 and I have no idea. Whatever this Docker is, it's all a winner. I knew one, one point 17 so let's try that. I Oh, you know, one point 13. So those are all Dockers.

So you need to download it directly from the locker website itself. And obviously we need to Community Edition. And let's go Oh, also also Yeah, of course, if you if you already have a Linux and you already maybe probably you have already doctor you want to remove the old doctor. On this opposite you have didn't one you know 17 so I have an article. How do you check which version do you have? There is a simple command.

It's called LSB re lease. A comment. Ops. Yeah, it is artful. So I'm going to start writing every comment i'm used, I have used Okay, let's find the place to download the Docker. What do I need?

Okay, let's update I'm going to sell for a package heartful because my little division or open division is called artful. Now I go to pull, I do not know the reasoning, I don't remember why. But you go to stable then you obviously select division according to your operation system and less like the new one. Now, I'm gonna say the reason I'm not opening it, because if I remember correctly, if you just open it, and install it to UI, it doesn't start correctly. Video one doesn't start correctly. So what You want to do is you want to do that manually.

Okay, so we need to install it. It's gonna take some time, and I'm going to ride it. Second command, which I'm used is which is which is what? Yeah. This one. Alright, it's done.

So right now let's check if it's installed. Yeah, nice. That's good. Let's keep going. Okay, so next thing we need is Docker compose. Same stuff.

But yeah, this time you don't need downloaded directly, you can use a bt package manager Docker compose because this provides the version which we are satisfied with. So I'm going to copy the command i'm used which is abt Cache Policy and package name. Alright. So we're gonna install it Okay, it's done. Let's double check. Compose.

Good. Okay so the next thing when it is the go language environment because hyperledger users Well, if I'm correct, it can use other languages besides the go but go is the language to go right now. Obviously if you want to install a new one new go like 1.9 then I think you'll go by go Lang and latest or something I don't know, but I'm satisfied with the one it provides. Let's double check. All right. So right now we need to set up an environment for the goal itself.

And now we need to add that bath to our working moment to our whatever it's called. Let's check if we have of him. Yeah, we do have a boom. Oh we don't have Okay, so I would need to install you can use any like nano or you can even install g edit I think if you feel more comfortable with user interface, graphical user interface anyway, so let's go and add it oh boy This blue though sport is that all yeah for now that's all Yeah. What do we need to do? Yeah, we need to reopen the console.

Close it down. Let's check if gopath forks, okay does work. Now the next step is to install Node j s. Okay, so the same thing I've done with Dockers, I will have to install it manually. Still no GS, as does the one. Yes, I think this is the one. Okay, I'm going to install the eight one and whatever.

Do I have curl? Okay. Start a key Yeah, it's gonna take some time. Oh no, I was wrong. It was very short. Obviously We've just covered install it.

Okay, yes, let's go ahead and install it. Oh, this probably gonna take some time. I have a frog again. Okay, now am I good? Okay, let's also I think it's, I think it's already installed, but just double check. To be sure.

Yeah, it's already there. So what do we need? Now we need to check if it is installed, no GS version. Let's check. Yeah, nice. Nice.

Very nice. Let's update NPM Trouble, right? outdated but yeah, no. Okay. The next next thing we need to do is add. So yeah, right now we do not have permission.

And obviously we can go with sudo and it's not even running. So what we need to do is we need to add our user user. Okay. Yeah, what I need to do is right now I need to log out and login again. I wish I could tell you why. But I don't know.

Okay, let's try. Okay, it's not running. Okay, so as time goes by new features, new bugs, new way of solutions comes by. So this time I had an issue with the Docker, which I didn't have the last time. So I've had this solution which basically you have to unmask servers and a message socket, and all that then you get stopped. So after that, they'll show you something like this.

Was it that I know right now there's no images so you know, it's empty. But this is how it should work. All right. So I always They're gonna provide commands i'm used, I'm used. But that is a probability dad. You won't even need to do that.

So again, author the installation, if you press right docker ps like this It shows what i right now see what I see right now. It means you don't need to do anything for us correctly. Okay, so next stage step is to get us some Docker images. So I'm not going to provide the links because they change Constantly what I'm going to do is to show how you find that so hyper ledger fabric and you go to official website not not this one, not this one. Yeah, you need to read read the docs. All right.

What is it? Is it here? Oh, yeah, I think it's here. Yes, it here. Yeah. So then the link is different than the last one diversion is different.

And you obviously want to Install the latest version. If you get Yeah, it's gonna take some time, it's gonna download all those images. Okay, let's keep on going. So the next thing we need is to check. Oh, yeah, that is one thing which I forgot is obviously when you issue the last command, which was this one, it's going to download the, you know, the executables to that folder, the current folder. Yeah, you're working it.

So, in my case it's a whole bit. I think it is. But it's fine, you know, whatever. So right now what you want to do is is add them to work environment, so we can access it from anywhere and we already have done this Yes, this one that says a little bit more. So I think it's a whole bit and weapons bath itself and obviously we will need to restart. So it loads perhaps we have set up.

Let's check it out. Yep, here it is. Okay. It does work. What we do want to do right Now basically, I think it's, it's, it's done. Yeah.

Yeah, it's actually it's actually done. We are ready to work on it. So what can we try? We want to start the hyper ledger. We want to instantiate chain code, and we want to obviously to access it. So what I'm going to do, I'm gonna go and start preparing the workplace.

So first thing which you need to do is is to download different fabric samples. So yes, I think I'm gonna use This one is that the one I want to use. Now Actually, this is not the one I want to use. This is the one I want to use. This is the one I want to use. Obviously this one is assumes that you know a little bit more about channels about the orders and about the other peers.

But this is not my intention, I just want to I just want to demonstrate how to set up the environment how to start the hybl is this you know the depth environment, hard side def, the hyper ledger for development so, Right now we're gonna skip decoding. And I'm going to show where basically the code resides. So first thing we need to download the samples, which are I think are like yeah, I think over here, down the samples here are where they are. Yeah, I've got great. Yeah. And they should be.

Okay. Fabric samples. Okay, we're done. Let's double check. We want to go To change code, Docker dev mode. Basically, it's a script which just runs a bunch of Docker images and connects them to each other to establish a simple hyper ledger network.

So in order to understand you need to get to me to read this file. And right now I think what I want to do is to stall sublime, but it's not necessary, because my intention right now is to just to show you the code, and I can do this dad and I can do that online. So what I want to do right now is just follow this and set it up. So we already done this step. We have this Yeah, that's good. Let's go back visit Yeah, this is this is just shows an experience a little bit about chain code, which we are not interested in right now we are interested into how to start.

You are building the chain code. What this actually this doesn't use it you just compile it to check whether you know it's compiling at all any errors. But this is this tutorial does not provide you with how it actually uses the source code and adds it as a chain code into hyper ledger network. So we already have done this. We have a bunch of Docker images Double check. Yeah.

All right. So the next stage is just to run the hyper ledger network. And that's exactly what we're going to do. Both Come on is that correct? Okay. That's why Yeah, this is the first time we need to spread.

In the last one I used Terminator, but I skip this time because it's messes up with the abt reporters. And after that, you cannot download something. I don't remember what what kind of message Sit up so I just get this and do this as simple as possible. So let's start it. Okay, it is. So, Winchell is going to shut down automatically but I'm going to show you how to avoid that for right now we're just gonna open Yeah, we're gonna send this Do you have an a dive?

Watch Great. Okay, so you have on your, but that actually yeah I want to see them at once all at once and the further bond Yeah, it doesn't have cascading like Windows does. Or maybe I don't know how to do that. Yeah, hit it is Stein off because it's just one minute. So what we do is add the environmental variable or constant or our option, whatever they're called and just add a ridiculously large number so it doesn't tie him out. If I wrote that option correctly, it should turn out.

Okay, so the next stage step is to start and compile to add the chain code Let's go to the second one based it is or what I do. Yeah. Hit it hit Is that real code? It is the code. Okay, so before that I just want to tell you where it takes the real code. It's not from this folder when launching this is actually I will have to launch another terminal.

It is Yeah, here it is. And the chain is that correct? Yeah, here it is. Marks exactly this this particular folder. So if you want to Let's create just just just to demonstrate it app zero. And I think it will need to restart, reconnect.

I don't really remember. It's double check. Did it? Yeah, it's already there. So you need if you want to fool around, you need to add that to the chain code directory, the path, whatever you want to call it. So because the code we want to test around for around is the s a cc?

Let's go to sscc. And check it is go Is that correct? Go built yet. Now this is the radio built. This is the real code, which is going to be added to the hyper ledger. Oh, just yeah, August The app I want to show you the code is let's try to find it.

It is Shane cold, wet fabric samples. Bring samples. Is it here? Yeah, it is here. So chain code. s ACC.

Yeah, it's very bulky. You can barely see. Oh, yeah, well basically what it does is instead of shades and though these functions are like a standard ones, which hyper ledger expects. So, this one what happened before the Ching got this instantiates it's accepted or some parameters and so on, and so on. This one is where you actually send your functions to. So right now it has only one function set and everything else going to be assumed that it's get.

So, as you can see, and the functions are over here, the set and they get this is the set one writes to the blockchain and to get one opposite the reads, so we want to check how does it work? Okay, so it has built is ready to be deployed. How do you deploy? It is vault command. So you have to deploy the chain code or particular PR. And the name is this is the name of the channel.

Actually, no no, this is the name of the chain code. And this is the name of the double show you. You see the better fathers out there. So we're not adding the obviously we're not adding this markup the source code we adding the banner itself editors could go this installed and we want to now work with it. Okay, hit it is now installed as a chain code version zero name my seal which we provided over here I think they'll have to close this stuck with me. I'm just gonna minimize this.

Alright? Just a second place. So sent desktop to Okay, so it's already in desktop too. But it's still shows over here. Not very strange anyway. So we're going to install the chain code.

Okay, no code so far no error so far. Next step is to instantiate initiated. Let's go ahead and do that. And now we want to invoke so basically we'll want to set some particular invoke the set function. Okay, let's go ahead and invoke like an X GG. And, obviously, we'll want to now to get that value.

Now in order to get the value, we don't need to second parameter, so we're gonna remove this and the payload is GG. So obviously, there's another way is to query directly for this command. And what we want to query is empty X key and the query result is GG. Okay, so basically that's it. So in the following video on probably going to provide some simple logic. Like probably I'm going to implement the supply simple supply chain.

I'm just going to show you the steps and basically how you do it and how you test it, how you debug it. Okay, thank you for your attention. See ya.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.