WEBVTT 1 00:00:02.860 --> 00:00:05.619 Ashwath - Spydra: Okay, I've started the recording. So let's continue. 2 00:00:05.830 --> 00:00:16.089 Ashwath - Spydra: yeah. So basically, as I was saying, right, while we were developing our own developing chain code for for our own platform, right? It was really getting difficult for us to 3 00:00:16.129 --> 00:00:17.790 Ashwath - Spydra: basically 4 00:00:17.810 --> 00:00:22.550 So we put the same code in real time and truly do an iterative kind of 5 00:00:22.640 --> 00:00:27.469 Ashwath - Spydra: development in for hypology fabric. Right? And that's where 6 00:00:27.850 --> 00:00:29.659 Ashwath - Spydra: that's where we 7 00:00:29.670 --> 00:00:43.660 Ashwath - Spydra: started looking at. What are the different options for actually debugging chain code. Right? So what I'm going to cover today is basically some of our experiences while doing that. so the different approaches for debugging chain code that already exist. 8 00:00:43.730 --> 00:00:56.039 Ashwath - Spydra: So I'll cover some of that, and then I'll also cover a particular you know, extension for Vs code that we have developed as part of side. Right? It's maybe we have made it open source. So you know, you can use it 9 00:00:56.060 --> 00:01:09.099 Ashwath - Spydra: and as contributed as well. But we'll look at you know the ipod is a fabric Vs code extension, and see you know how that can easily make that process a bit more easy to debug 10 00:01:09.130 --> 00:01:14.130 Ashwath - Spydra: chain code, right with from within within visual studio port as such. 11 00:01:15.490 --> 00:01:22.760 Ashwath - Spydra: So basically, you know, first of all, what are the challenges while developing a chain code for hyperbolic fabric. Right? 12 00:01:22.960 --> 00:01:42.850 Ashwath - Spydra: First of all, you know, the chain code literally runs within within the fabric environment. Right? So the first thing that you need to have is a fabric environment itself, which means, you know, you need to deploy the peers orders. And you know, basically set up the entire hybrid fabric network. Right? Of course you have, you know. 13 00:01:42.880 --> 00:01:50.800 Ashwath - Spydra: default out of the box test network and scripts available to do that, but that still becomes a prerequisite. First of all. 14 00:01:50.940 --> 00:01:54.620 Ashwath - Spydra: then the second, that more, you know, painful process really is the 15 00:01:54.920 --> 00:01:58.630 Ashwath - Spydra: updating of the chain code, right? So when you are developing 16 00:01:58.720 --> 00:02:13.380 Ashwath - Spydra: something you will obviously update, and then you have to test it. And that is not a very simple process as such. Right? You have to install. You have to approve the chain port. You have to install the chain code on all the peers that are in the network. Then you have to approve the chain code 17 00:02:13.780 --> 00:02:24.020 Ashwath - Spydra: and the approval has to be done by each organization which is part of the network. And then the chain code has to be committed on the network. And then only, you know, it'll run basically right? 18 00:02:24.080 --> 00:02:29.849 Ashwath - Spydra: So every time you update the chain code. You'll have to go through this entire chain code lifecycle passage to to do that. 19 00:02:30.400 --> 00:02:41.549 Ashwath - Spydra: And then the third thing is, you know, even if you do this right. unlike traditional other languages and frameworks, right where you can literally run the chain code within an ide 20 00:02:41.650 --> 00:02:59.650 Ashwath - Spydra: and put a breakpoint. And then, you know, do line by line, debugging that is still not possible, really out of the box. Right? That's that requires there are some approaches to do that which I'll talk about. But you know, those are things which typically is a challenge for for 21 00:02:59.780 --> 00:03:02.720 Ashwath - Spydra: hyper developers. 22 00:03:02.960 --> 00:03:09.620 Ashwath - Spydra: And typically, what happens because of that rate is that people don't really do debugging within an ide as such. 23 00:03:09.630 --> 00:03:33.100 Ashwath - Spydra: mostly what people start out with and what we also started out with is, you know, just logging messages, or console messages and logging messages and files and things like that. And then you deploy the chain code. And then you, you basically see what the output is. And then you make some changes again, deploy the chain code. Then again, you know, see what the messages are, where the flow is, what what 24 00:03:33.230 --> 00:03:49.790 Ashwath - Spydra: Which code is being executed? What is the output of that? All of that, you log in messages, and then you try to figure your way around right that is very cumbersome, of of course, right? And that's what we also started to do initially. But then, you know, that was really not helping us a lot. And it was speaking a lot of 25 00:03:49.940 --> 00:03:52.769 Ashwath - Spydra: the developers time over a period of time. Right? 26 00:03:52.960 --> 00:04:05.120 Ashwath - Spydra: So that's where we started looking at different ways of actually debugging chain port. Right? And I apologize. Fabric does support a couple of different ways. so there is the ipad of fabric dev mode 27 00:04:05.250 --> 00:04:14.170 Ashwath - Spydra: which I'll talk about And then, you know, starting the with the newer versions of 2 dot X, 28 00:04:14.300 --> 00:04:26.840 Ashwath - Spydra: hypologic or fabric versions. Right? There is this new concept of deploying chain port as a service. Now, she input as a service model, although he's used for a completely different purpose 29 00:04:26.920 --> 00:04:40.159 Ashwath - Spydra: or it has been built for it completely different purpose. But it can actually be used to solve this challenge of of debugging she code as well, which I will, which I'll also get into. 30 00:04:40.190 --> 00:04:50.699 Ashwath - Spydra: But even these approaches right require you to basically set up your own fabric network and then do some configurations. First right to make all of that possible. 31 00:04:50.930 --> 00:04:53.540 Ashwath - Spydra: So let's let's look at these approaches for straight. 32 00:04:53.660 --> 00:05:09.029 Ashwath - Spydra: and I'll I'll cover the chain code as a service debugging method first, because that's the more recent. And you know, that's where that's the recommended model of deployment, also going forward for chain board. Right? So let's let's take a look at how that can actually be used to 33 00:05:09.130 --> 00:05:18.879 Ashwath - Spydra: Debug chain port while you're writing so essentially a quick background on the chain code of the service model itself. First. 34 00:05:18.990 --> 00:05:27.640 Ashwath - Spydra: fundamentally, the chain port as a service model has been designed so that you know you have more control 35 00:05:27.670 --> 00:05:32.669 Ashwath - Spydra: on how the chain code itself is built, deployed, and run 36 00:05:32.680 --> 00:05:39.259 Ashwath - Spydra: so traditionally right when you, when you create a change port, you will. You basically have to 37 00:05:39.490 --> 00:05:46.110 Ashwath - Spydra: you know, upload it or install it on the peer and then ask the peer to basically run it. 38 00:05:46.210 --> 00:05:54.540 Ashwath - Spydra: So the entire entire work of building the chain port from the source code 39 00:05:54.570 --> 00:06:06.219 Ashwath - Spydra: deploying it in a you know, in a container where it runs, and actually running, it was maintained, was done by the by the p or node as such. Right? 40 00:06:06.410 --> 00:06:12.549 Ashwath - Spydra: of course, you know that means that you can only it, you know. Run chain code with 41 00:06:12.760 --> 00:06:38.799 Ashwath - Spydra: which is supported by the with, you know, the Framework Versions which is supported by the peer. And you know you literally didn't have much control, and how it is built, how it is deployed, and all that right. That's where starting with the 2 dot X versions of hyperger fabric, there has been a different model where you have more to control on how the sheet port is built first of all, which is the concept of external builder, and then you. There is also the concept of where you can, you know. 42 00:06:38.980 --> 00:06:47.990 Ashwath - Spydra: Run the chain port by yourself so you can. You can run the chain code in your own container essentially. and then instruct the peer node 43 00:06:48.020 --> 00:06:59.319 Ashwath - Spydra: to connect your shing code in order to run it right? So you you are literally responsible for building, hosting the chain port and running it, and then you instruct the here to connect to it and 44 00:06:59.480 --> 00:07:01.690 Ashwath - Spydra: submit 45 00:07:01.890 --> 00:07:11.059 Ashwath - Spydra: the request to the chain ports can container or server that you are, run right. Essentially so, if I look at the code right? Let me just 46 00:07:12.020 --> 00:07:15.320 Ashwath - Spydra: show you some code of how that actually works. 47 00:07:15.710 --> 00:07:21.980 Ashwath - Spydra: so if I so this is the basically the chain for external sample 48 00:07:21.990 --> 00:07:33.020 Ashwath - Spydra: from the fabric samples itself. So if I if you go to the fabric samples right. there is the asset transfer basic sample that has different. 49 00:07:33.210 --> 00:07:45.659 Ashwath - Spydra: that is a bit extensive, and it has different versions of it in different languages and different ways of running it. Right? So this is the input external sample that I'm actually showing you. 50 00:07:46.120 --> 00:07:48.280 Ashwath - Spydra: And if you look at the code for that, right 51 00:07:48.310 --> 00:07:51.740 the way this This works is that 52 00:07:51.940 --> 00:07:54.960 Ashwath - Spydra: at the bottom there is a the main method 53 00:07:55.050 --> 00:07:59.130 Ashwath - Spydra: and a new chain code is instantiated 54 00:07:59.160 --> 00:08:09.380 Ashwath - Spydra: with the smart contract that has been written. And then this chain code instance is passed to a to input server right? 55 00:08:10.000 --> 00:08:23.009 Ashwath - Spydra: And the chain port server is then started. So literally we are. We are starting its input server and running it ourselves right? And while starting the change port server there are few parameters that are given. 56 00:08:23.060 --> 00:08:38.320 Ashwath - Spydra: One is the chain code, Id, which I'll come to what it is. And then there is an address. So this is the address. Wherever chain code server is literally running. And there are some samples. If you look at the environment variable sample provided here. 57 00:08:38.429 --> 00:08:48.659 Ashwath - Spydra: it's just a you know host and a port right? So it could be something like this where the she input is actually running. And on this particular port, right? 58 00:08:48.710 --> 00:09:03.820 Ashwath - Spydra: So that's what we are literally running the server on a particular address, and then, that's the first step right? And then the second step is typically, you know, when you deploy the chain port right? You will deploy, deploy the actual chain port on the peer. 59 00:09:04.020 --> 00:09:12.810 Ashwath - Spydra: But in the chain code as a service model you don't deploy the actual chain for you deploy certain files. Right? One is a metadata file 60 00:09:12.940 --> 00:09:18.880 Ashwath - Spydra: which basically tells you certain information like, what is the type? So there is a. So I was 61 00:09:19.010 --> 00:09:29.670 Ashwath - Spydra: telling that chain code as a service basically is all about running the chain for outside right? But before that you have to build the chain port. So there is a concept of an external builder. 62 00:09:29.740 --> 00:09:46.700 Ashwath - Spydra: and that is an extensive topic in itself. But without going into that in too much decade, there's a, you know, inbuilt or default external builder for chain code as a service. Right? So you're basically telling that this, this, the type of the chain code is that chain code as a service, and this is just a 63 00:09:46.850 --> 00:09:50.279 Ashwath - Spydra: label or a name for the chain for Italy. 64 00:09:50.540 --> 00:10:11.030 Ashwath - Spydra: So this the metadata dot Json doesn't contain much except for telling that this type, this chain code is of type chain code as a service right? And then the current connection information basically tells the instructs the peer that it should connect with this particular address in this particular port to actually submit the request to 65 00:10:11.160 --> 00:10:14.380 Ashwath - Spydra: to run the chain port. Yeah. 66 00:10:14.660 --> 00:10:25.950 Ashwath - Spydra: So that's how these 2 are linked. And then it's the connection. Dot Json file and the metadata dot Json 5, which is actually deployed on the beer instead of the chain code 67 00:10:25.980 --> 00:10:33.769 Ashwath - Spydra: to to support this entire mode. So we will look into that. But that's the overall High level high level concept. 68 00:10:33.880 --> 00:10:43.559 Ashwath - Spydra: So how do I use this now? Right to my advantage to actually debug chain code? Right? So the way to do that is let's say. 69 00:10:44.030 --> 00:10:46.299 Ashwath - Spydra: you know, if you look at the code here, right? 70 00:10:46.710 --> 00:11:00.170 Ashwath - Spydra: this is a go go and chain code. Right? So what if I simply try to run this within visual studio code, right? And the way to do that normally in visual studio code is that you go to the 71 00:11:00.280 --> 00:11:01.890 Ashwath - Spydra: run and debug section 72 00:11:01.940 --> 00:11:10.759 Ashwath - Spydra: and basically create a launch file. First of all, right. And when I create a launch file, it will basically detect that, okay, this is a go length 73 00:11:10.880 --> 00:11:18.360 Ashwath - Spydra: language, and it'll give you some options. So launch a package right? This is what we want to do. 74 00:11:18.700 --> 00:11:25.089 Ashwath - Spydra: so it will give you some configuration like this. Right, let me save that, and then I can actually click 75 00:11:25.240 --> 00:11:31.039 Ashwath - Spydra: this to debug. But if you do this plainly like this, right I need to select the 76 00:11:31.360 --> 00:11:37.149 Ashwath - Spydra: go and file first. Where the main method is. This is the file with the 77 00:11:38.260 --> 00:11:41.389 Ashwath - Spydra: main method, and then I can go and 78 00:11:42.150 --> 00:11:43.799 Ashwath - Spydra: start debugging right. 79 00:11:44.400 --> 00:11:46.829 Ashwath - Spydra: But if I do that 80 00:11:47.100 --> 00:11:51.360 Ashwath - Spydra: once it starts, it will actually to an exception 81 00:11:52.160 --> 00:11:55.110 Ashwath - Spydra: it should. It's still trying to start. 82 00:11:55.240 --> 00:12:14.229 Ashwath - Spydra: That's because, you know, it's when the exception. Yeah, it's through an exception. And it's basically saying, the CC Id must be specified. So it's coming from our code only because, you know, as we saw in our code. there was a chain code, Id and address where it starts. And we haven't configured those those environment variables. Yet, right? 83 00:12:14.360 --> 00:12:21.310 Ashwath - Spydra: So what I'm going to do now is that you know, because we know that we visual, sure, you can actually run this code. Now. 84 00:12:21.370 --> 00:12:22.860 Ashwath - Spydra: what I'll do is I'll 85 00:12:23.070 --> 00:12:26.760 Ashwath - Spydra: configure the chain port address to be local host. Right? 86 00:12:27.360 --> 00:12:33.689 Ashwath - Spydra: So simply, what we'll do is this should be this sad press. Right? The connection. 87 00:12:33.900 --> 00:12:45.889 Ashwath - Spydra: Okay, so not this access. So basically, we will configure. And I'll come to that. How to do that. But we'll we'll ask the The first step is to ask the visual to give port to 88 00:12:46.250 --> 00:12:49.559 Ashwath - Spydra: launch the chain code at local host 89 00:12:49.660 --> 00:12:55.320 Ashwath - Spydra: 9 9, 9, right? So that's the. And I will also provide a she input id, which will get 90 00:12:55.430 --> 00:13:04.810 Ashwath - Spydra: right. So those 2 we have to provide somehow, and we will run the chain for it local. First. the then, what we'll do is we will instruct the peer Node 91 00:13:05.040 --> 00:13:13.299 Ashwath - Spydra: to connect to the chain code that is running on local host. Now the Pr. Node right. What we'll do before that is that we have to deploy the peer node. 92 00:13:13.750 --> 00:13:21.999 Ashwath - Spydra: So for that, I've already, you know, deployed that in the interest of time. I haven't. So let me just 93 00:13:22.100 --> 00:13:27.810 Ashwath - Spydra: start backs list. So that is the typical network. 94 00:13:31.520 --> 00:13:42.780 Ashwath - Spydra: let me copy that command. So I'll just So this is the, you know. Test this network that comes in the fabric samples. And 95 00:13:43.410 --> 00:13:48.000 Ashwath - Spydra: I'll just say, start the network with the 96 00:13:49.660 --> 00:13:52.380 Ashwath - Spydra: start, the network with the oops 97 00:13:54.990 --> 00:13:56.470 Ashwath - Spydra: in place. 98 00:14:03.430 --> 00:14:10.300 Ashwath - Spydra: Okay, so I'll just say, start the network with the channel. That is all with by creating a channel, my channel right. 99 00:14:10.580 --> 00:14:20.380 Ashwath - Spydra: and when I do that it will, there is a fabric network that it will bring with 2 organizations like or one and or 2. So it will do that, all of that behind the seats. 100 00:14:20.510 --> 00:14:21.380 Now. 101 00:14:21.650 --> 00:14:27.149 Ashwath - Spydra: what we have to do is we have to basically deploy the 102 00:14:27.690 --> 00:14:30.720 Ashwath - Spydra: connection dot Jason and 103 00:14:31.900 --> 00:14:39.120 Ashwath - Spydra: metadata dot Json right into this network and then instruct 104 00:14:39.370 --> 00:14:47.810 Ashwath - Spydra: the chain peer node to connect to my chain port right? So for that. What I'll do is instead of this address, right? 105 00:14:48.530 --> 00:14:51.410 Ashwath - Spydra: What we will do is we will ask the 106 00:14:51.730 --> 00:14:52.850 Ashwath - Spydra: Do you have a node 107 00:14:53.150 --> 00:14:55.380 Ashwath - Spydra: to connect to the 108 00:14:55.990 --> 00:15:22.719 Ashwath - Spydra: local host. 9, 9, 9, 9. But remember that the peer Node is running inside a docker container. So for docker container, for a for a container running inside docker to access my local host. You have to, use a different way of doing it. You can either use the IP address of the bridge, or there's an internal, you know, Dns, which is host host or to top locker dot internal, which you can use, which basically instructs the 109 00:15:22.840 --> 00:15:26.599 Ashwath - Spydra: any containers that you have to go to the 110 00:15:27.010 --> 00:15:31.830 Ashwath - Spydra: local host on the host where the docker and docker is running right? 111 00:15:34.410 --> 00:15:39.540 Ashwath - Spydra: So this is what we are doing by doing this right? So the my chain connection dot Json, looks like this. 112 00:15:39.950 --> 00:15:51.509 Ashwath - Spydra: and the metadata or dot chase on is pretty simple. I think no changes there, right? So I've already. So and how do I deploy this? So you have to basically create a zip file 113 00:15:51.850 --> 00:15:58.129 Ashwath - Spydra: with the connection, or Jason, but it's simply zipping it into code org. 114 00:15:58.160 --> 00:16:01.830 Ashwath - Spydra: And then, you know. you ate this 115 00:16:01.980 --> 00:16:09.310 Ashwath - Spydra: a as well as the metadata or Jason, and then zip it again. Right? So these things I've already done, and 116 00:16:09.560 --> 00:16:11.410 If I look at the 117 00:16:11.810 --> 00:16:13.840 Ashwath - Spydra: sample folder. 118 00:16:14.100 --> 00:16:22.810 Ashwath - Spydra: I already have that zip file here. Right? So once you have the zip file, what you have to do is you have to simply 119 00:16:24.430 --> 00:16:27.550 Ashwath - Spydra: installed that zip 5 120 00:16:28.780 --> 00:16:31.950 Ashwath - Spydra: in onto the network that we just created. 121 00:16:32.010 --> 00:16:39.710 Ashwath - Spydra: So the above portions here, these are just setting some, you know, environment variables which you would normally do. You know, even 122 00:16:39.860 --> 00:16:43.470 when you want to run any command, using the 123 00:16:43.630 --> 00:16:46.090 Ashwath - Spydra: on to the 124 00:16:46.220 --> 00:16:56.189 Ashwath - Spydra: on to the test network that I just deployed right? So I am using the or one. So this is a test network that has 2 organizations. Right? So I'm using our one. And 125 00:16:56.450 --> 00:17:05.609 Ashwath - Spydra: what I do is install that Zip 5 with those 2 Json files, the connection, Jason and and the meterator Jason 126 00:17:06.060 --> 00:17:14.289 Ashwath - Spydra: as the chain code. So I'm actually not installing the real chain code or anything. Just so the zip file, right? And that is successful. 127 00:17:14.910 --> 00:17:27.430 Ashwath - Spydra: And then what you get out of this is the package identifier. So this is the chain code that the CC Id. That we are talking about. Right? So let me just copy this and use it here. 128 00:17:28.560 --> 00:17:43.740 Ashwath - Spydra: Since we have that right? Then what we need to do is to basically and just setting it as a environment variable. And then the next step is to approve the chain code. So this is nothing different particular change would approve. As you can see, it's 129 00:17:43.990 --> 00:17:58.200 Ashwath - Spydra: It's nothing different. we are using the name as Debug, PC. For the chain code, and we are providing the package Id that we got earlier, and the rest is, you know, providing the order of information. The Dls information channel. 130 00:17:58.290 --> 00:18:05.710 Ashwath - Spydra: and so on and so forth. Right? So let me just do that approve on behalf of. or one 131 00:18:08.110 --> 00:18:10.479 Ashwath - Spydra: which is basically successful. 132 00:18:10.550 --> 00:18:13.939 Ashwath - Spydra: And then let me approve on behalf of or 2. 133 00:18:21.990 --> 00:18:29.809 Ashwath - Spydra: And once the chain code is approved you basically commit the chain code, which is again, nothing different normally. How you do that by providing the 134 00:18:30.020 --> 00:18:36.329 Ashwath - Spydra: the Chain code name. The peer addresses the Order addresses the Tls configuration. 135 00:18:36.360 --> 00:18:40.880 Ashwath - Spydra: All of that. So this is, you know how you would normally do that. Nothing different. 136 00:18:44.120 --> 00:18:50.950 Ashwath - Spydra: And Once that is done, you'll see that you know the chain port is now committed to the channel right? The channel that we have. 137 00:18:51.370 --> 00:19:04.789 Ashwath - Spydra: So what we have really done is we have committed the we have deployed so chain code as a service way of doing it and set that okay. The peer should now connect to local host or my host 138 00:19:04.970 --> 00:19:12.590 Ashwath - Spydra: to submit the chain code. Request. Right? No. let's come back to my 139 00:19:13.810 --> 00:19:32.820 Ashwath - Spydra: visual studio, right? So, as I was saying, now we have to run the Visual Studio chain chain code with individuals, should you and basically provide these 2 pieces of information? Right? So that is where we have to add those as environment variables here. Right? So what I'll do is I'll add the 140 00:19:33.730 --> 00:19:40.429 Ashwath - Spydra: these environment variables in the launch dot Json. give a configuration. 141 00:19:40.780 --> 00:19:49.170 Ashwath - Spydra: So what I said is that the change code server address is local host 9, 9, 9, 9, where we want to run it. And the chain code Id is what we got from 142 00:19:49.490 --> 00:19:53.770 Ashwath - Spydra: the package. Id when we when we execute it 143 00:19:54.640 --> 00:20:00.570 Ashwath - Spydra: the installed command. Right? So this is a package identifier. It's the same that we have configured here. 144 00:20:01.700 --> 00:20:09.800 Ashwath - Spydra: So that's pretty much it. Right now. We have instructed the You should be able to launch the chain code and 145 00:20:10.030 --> 00:20:15.620 Ashwath - Spydra: connect here right and run it. Now let's see what 146 00:20:15.940 --> 00:20:19.220 Ashwath - Spydra: what happens if we run the chain code 147 00:20:19.410 --> 00:20:20.360 Ashwath - Spydra: again. 148 00:20:22.020 --> 00:20:24.919 Ashwath - Spydra: Okay, I have to select the go and file first 149 00:20:25.620 --> 00:20:27.659 Ashwath - Spydra: and run. 150 00:20:29.010 --> 00:20:43.590 Ashwath - Spydra: So now it will run, and it shouldn't give any exception right? So it's still trying. But it' yeah, it's it's it's it's started running right. But nothing has happened to now, because it has just started running for the chain code. So what has started 151 00:20:43.900 --> 00:20:47.640 Ashwath - Spydra: right? So now, the next step, typically you write to invoke a chain port 152 00:20:48.810 --> 00:20:52.800 Ashwath - Spydra: invoke a chain port. is to 153 00:20:52.930 --> 00:20:54.950 Ashwath - Spydra: basically 154 00:20:56.210 --> 00:21:02.179 Ashwath - Spydra: is to basically invoke a chain code method right? And the way to do that 155 00:21:02.450 --> 00:21:18.780 Ashwath - Spydra: normally people. How you they do that is using the fabric cli again. So let me go back here and let's try to invoke a method. Right? So this chain code has an initialized in it ledger method. And I'm just invoking it 156 00:21:19.860 --> 00:21:22.200 Ashwath - Spydra: from the 157 00:21:22.600 --> 00:21:33.579 Ashwath - Spydra: yeah. So let me try that. Okay, before that. What I'll do is now, you know, supposedly the debugging should work. So let me locate the unit chain for initialize. 158 00:21:35.130 --> 00:21:35.930 Ashwath - Spydra: Oh. 159 00:21:37.030 --> 00:21:43.659 Ashwath - Spydra: so the call you need legend method, and I've already put a break point. But you can put a very quick point anywhere you want. Right? 160 00:21:43.880 --> 00:21:45.560 Ashwath - Spydra: So let me just invoke it. 161 00:21:48.160 --> 00:21:53.000 Ashwath - Spydra: And now you can see that something is already blinking here. And 162 00:21:53.130 --> 00:22:18.579 Ashwath - Spydra: you can see that the break point is hit. So now, literally, the change input is running in visual should be a code, and when I submit a request to the peer, the peer calls or chain 4, and which is running with the visual studio, and then the breakpoint gets set right. So now you can actually ins inspect, you know everything that's If I. If you can do line by line debugging, you can inspect the variables. Right? What's happening? What are the values? You can look at the context. 163 00:22:18.590 --> 00:22:29.520 Ashwath - Spydra: you can, you know. Do F, 10 f, 11 step into step over all of that you can continue right. And I just pressed a 5 so that it continues, and then 164 00:22:29.830 --> 00:22:37.059 Ashwath - Spydra: you can see that the chain code invo is successful and you get the result. So this is one way of doing it right. So the chain code as a 165 00:22:37.110 --> 00:22:46.720 Ashwath - Spydra: jin put as a service external service model, you can actually use to your advantage to start debugging. Now, right once you do all this configuration? Right? 166 00:22:48.030 --> 00:22:51.909 Ashwath - Spydra: yeah. So that's that's one way of doing it. 167 00:22:53.740 --> 00:22:54.470 This. 168 00:22:57.600 --> 00:23:01.949 Ashwath - Spydra: yeah. So so this is this is this, this is literally what we did right? So 169 00:23:02.070 --> 00:23:21.439 Ashwath - Spydra: irrespective of what language it is, it's go lang, or Nodegs, or Java. As long as you configure visual studio to debug the language corresponding language. First, then, you can do these additional steps of configuring the connection. Dot Json emitted it, or torches from properly, and then start debugging it right? 170 00:23:22.530 --> 00:23:26.089 Ashwath - Spydra: So so this is. You know what what we went through. 171 00:23:26.880 --> 00:23:32.350 Ashwath - Spydra: There is a another way of doing this also which is using the fabric dev mode. 172 00:23:34.270 --> 00:23:40.309 Ashwath - Spydra: So I' not you know. Give you a demo of this because this is a little bit more complicated to set up 173 00:23:40.570 --> 00:23:47.029 Ashwath - Spydra: the first thing, you know, because there are certain different requirements for this. First of all, you know, there is no 174 00:23:47.080 --> 00:23:54.050 Ashwath - Spydra: test network kind of out of the box script per say, which will set set this up for you, so you'll have to. 175 00:23:54.090 --> 00:24:08.230 Ashwath - Spydra: you know. Download the peer download or build the peer binaries, and then, you know, run the order, peer, cli binaries yourself, and then do the configuration for this to work. 176 00:24:08.480 --> 00:24:11.370 Ashwath - Spydra: But the way this works is that you know. So this will work with 177 00:24:11.550 --> 00:24:19.390 Ashwath - Spydra: So the earlier model that I was showing you right, the chain would, as an external service that will work with only code which is written for the newer 178 00:24:19.450 --> 00:24:27.199 Ashwath - Spydra: external service market. This will work with anything right? Literally, because this here you will. Basically, you are basically confusing 179 00:24:27.330 --> 00:24:33.159 Ashwath - Spydra: peer to run in what is called as a Dave mode, and there is some documentation, you know, in the Hyper Ledger fabric 180 00:24:33.360 --> 00:24:43.550 Ashwath - Spydra: documentation site which tells you how to do that. But basically, what in order for this to work right? or what this does basically is 181 00:24:43.920 --> 00:24:49.000 Ashwath - Spydra: it runs here in such a way that when you update the chain code right? 182 00:24:49.390 --> 00:24:52.650 Ashwath - Spydra: You don't have to redeploy it. So the 183 00:24:52.720 --> 00:25:01.520 Ashwath - Spydra: the sorry you don't have to re approve it and commit it again. So the the steps of 184 00:25:01.640 --> 00:25:08.070 Ashwath - Spydra: committing the chain code and approving the chain code by each organization and 185 00:25:08.090 --> 00:25:12.449 Ashwath - Spydra: committing the chain code need not happen every time you can 186 00:25:12.760 --> 00:25:22.049 Ashwath - Spydra: change the chain code upload it again, and it will run the new change code without these additions to be done. So that is what fundamentally it does right at a very high level. 187 00:25:22.250 --> 00:25:43.310 Ashwath - Spydra: But for it to work right. First of all, you have to use solo, as the instances solo, as we all know, is sort of deprecated at this time, but it still works right. So for this particular reason of debugging, you can still use it because it's not really production port production deployment that you're doing here. Right? So you you'll have to use so low. So you know, you'll have to 188 00:25:43.710 --> 00:25:54.490 Ashwath - Spydra: create the Genesis block by running conflict the exchange with solo as the profile right? And then, while. 189 00:25:54.860 --> 00:26:05.579 Ashwath - Spydra: while starting the order of node. Right? You have to use the solo profile and the the samples, for that is given in this particular location right? 190 00:26:06.690 --> 00:26:14.280 Ashwath - Spydra: And then what then? What you'll have to do is when you start the peer node right? You'll have to start it in with an additional switch. 191 00:26:14.330 --> 00:26:17.449 Ashwath - Spydra: same here chain code dev is equal to true. 192 00:26:18.250 --> 00:26:29.080 Ashwath - Spydra: So what happens by doing that? And then you you'll have to install the chain code that you're written, and then approve and change and port one time. Right? So this this task you are to do one time. 193 00:26:29.790 --> 00:26:35.410 Ashwath - Spydra: So what happens by doing this right is that as you saying 2 things right? One is. 194 00:26:35.730 --> 00:26:47.120 Ashwath - Spydra: you don't have to do the pro and commit chain code again the second time you' up, update the chain code second time, and also that in this model also, instead of 195 00:26:47.520 --> 00:26:52.180 Ashwath - Spydra: the chain code being run by the peer. 196 00:26:52.360 --> 00:26:54.569 Ashwath - Spydra: you can actually run the chain code outside. 197 00:26:54.620 --> 00:27:11.920 Ashwath - Spydra: right? which is what it does. And the way you do that is, when you run similar to what we saw in the so input as a service model, you can actually run the chainput within visuals, should you, code? And while you are starting the chain port. Right? You basically configure some other 198 00:27:12.100 --> 00:27:14.340 Ashwath - Spydra: environment variables like the name 199 00:27:14.410 --> 00:27:19.870 Ashwath - Spydra: Tls has to be disabled because, you know, solo doesn't work 200 00:27:20.020 --> 00:27:20.740 with 201 00:27:20.900 --> 00:27:33.069 Ashwath - Spydra: well, with the Ts. And for that matter, we are to disable t us and then, what we say, what we do is that when we start the chain port we have to pass the 202 00:27:33.110 --> 00:27:34.560 Ashwath - Spydra: peers address 203 00:27:34.650 --> 00:28:00.240 Ashwath - Spydra: to which the chain code should connect. This here is the reverse. Right in the earlier chain code and service model. We were inspect in instructing the peer to connect to the chain code to submit request. But here we are doing the reverse. When when we are starting the chain code to connect to the here at this particular location, and then establish a connection to the peer, so that when the peer 204 00:28:00.300 --> 00:28:12.170 Ashwath - Spydra: tries to run a chain port instead of the peer running by itself. It knows where to send the request to which is chain code which is running within our, we just should be a code environment. 205 00:28:12.400 --> 00:28:13.830 Ashwath - Spydra: right? So 206 00:28:14.370 --> 00:28:23.259 Ashwath - Spydra: it's a similar model, but works slightly different. And you know that the doc's link that I pointed to has some details on how to set it up. 207 00:28:23.410 --> 00:28:27.869 Ashwath - Spydra: the site complication with this method is that 208 00:28:27.950 --> 00:28:36.760 Ashwath - Spydra: you know, first of all, you have to do more work to actually set up the network. And then the second thing is, you know, depending upon the language, right the way you configure 209 00:28:36.950 --> 00:28:44.010 Ashwath - Spydra: the chain port. Individuals, should you like you go for go you do this, but for nodejs 210 00:28:44.430 --> 00:28:51.869 Ashwath - Spydra: You have to slightly give the arguments in a different way. So the program, the way that you launch the 211 00:28:52.070 --> 00:29:00.399 Ashwath - Spydra: in go right, you have to launch you can directly launch the go file while in Node. Js, you have to launch 212 00:29:00.470 --> 00:29:15.419 Ashwath - Spydra: no module, basically. And then give your file as a argument to that. And you have to give some additional arguments. So the there is slightly different things to be done. And but still you know that this is another way of 213 00:29:15.630 --> 00:29:23.189 Ashwath - Spydra: debugging the chain code within visual studio code or any Id, for that matter, where you run. that you can go right? 214 00:29:24.700 --> 00:29:33.939 Ashwath - Spydra: So those are, you know, 2 methods that exist sort of out of the box within the hyperlink of fabric itself, which you can use to your advantage. 215 00:29:34.480 --> 00:29:45.149 Ashwath - Spydra: but of course, as we saw right, you still need to deploy the network first, that's one thing, and then you have to understand these additional configurations that you have to do. You have to do it in the right way. 216 00:29:45.250 --> 00:29:47.860 Ashwath - Spydra: and then only things will work right? 217 00:29:48.330 --> 00:29:51.759 Ashwath - Spydra: So that's where you know. Then we thought, why not automate. 218 00:29:52.110 --> 00:30:06.419 Ashwath - Spydra: or this that we have already talked about right? And can we do something much simpler? Right then? That's where we, as Spider, created the hyperlink of fabric debugger extension which I which I'll talk about going forward. 219 00:30:09.610 --> 00:30:20.310 Ashwath - Spydra: So I think it. Let me dive into the actual extension itself, which will give you a better idea. 220 00:30:21.810 --> 00:30:29.269 Ashwath - Spydra: So let's take the same chain code, right? Which is the chain code? External? Yeah. 221 00:30:30.160 --> 00:30:34.070 Ashwath - Spydra: And I'll open a different 222 00:30:34.280 --> 00:30:38.040 Ashwath - Spydra: open it into a different window. 223 00:30:47.580 --> 00:30:51.069 Ashwath - Spydra: Yeah. So this is the same same chain code. 224 00:30:51.440 --> 00:31:03.359 Ashwath - Spydra: But I've named it differently, but it's so opened in a different window, as you can see there's nothing in the lot launch, Dot Json, or anything. Right? So this is a fresh fresh sample that I just open. Think of it that way 225 00:31:03.480 --> 00:31:13.630 Ashwath - Spydra: right now, what you can do is that there is an extension called hyperbolic fabric debugger. Right? You can basically search it within. We just 226 00:31:14.060 --> 00:31:29.220 Ashwath - Spydra: the marketplace, and it will come up like this hypothetical, and once you install it right it will come up in the left wing. Now, if you go here, there's nothing there right now. But because we have not done anything right. 227 00:31:29.240 --> 00:31:38.639 Ashwath - Spydra: So let's say you, you want to debug the go land chain code here, right? And this is the same change. But as I was saying, which is written for a change, but it's an external service. Yeah. 228 00:31:38.920 --> 00:31:40.750 Ashwath - Spydra: So in this particular case. 229 00:31:41.320 --> 00:31:46.879 Ashwath - Spydra: I see there are some questions. I'll take the questions in the chat, you know, towards the end of the 230 00:31:47.180 --> 00:31:49.480 Ashwath - Spydra: presentation. But let me just cover the 231 00:31:51.520 --> 00:31:58.050 Kamlesh Nagware: first. There will be question, I think. secondly, this port 232 00:31:58.410 --> 00:32:01.459 Kamlesh Nagware: double and double and port number is a hard coded, or what? 233 00:32:03.130 --> 00:32:12.889 Ashwath - Spydra: Sorry? Which? Which? What was the question? The question from Ravi he mentioned, is chain code, port number, double line, 99 is hard coded port, or can we customize it? 234 00:32:12.920 --> 00:32:26.980 Ashwath - Spydra: Yeah, you can customize it. You can put whatever port you want. It's just a port where you know the chain code will be launched. So whatever you configure. So let me go back to that example. So whatever you configure here, right 235 00:32:27.290 --> 00:32:32.540 Ashwath - Spydra: the same you have to put here right to be should match. 236 00:32:32.640 --> 00:32:51.980 Ashwath - Spydra: So this is where you are saying where the same code should be launched. And this is the section where we are saying, you know it's in the beer where it should connect, so these should match that. So it's not hard coded you can. You can put whatever you want. I think that he mentioned the what are the types we have? I didn't get. What is the question? Maybe that we can ask. 237 00:32:52.860 --> 00:32:57.739 Ravinayag: Oh, okay, So if you look at this maternity, guess. And 238 00:32:57.860 --> 00:33:04.070 Ravinayag: you have what times to define? Right? C, so is it? What are the types that we have. 239 00:33:04.880 --> 00:33:12.629 Ashwath - Spydra: Yeah, so this is the only built in type, literally. But basically, this type you can use to. So there is this concept of external builder 240 00:33:12.790 --> 00:33:18.220 Ashwath - Spydra: in in fabric, right where you can say that 241 00:33:18.380 --> 00:33:42.149 Ashwath - Spydra: you can customize the way the fabric here will build your core, so you can define your own type, and then you can define a builder for that. If you look at here right, there is a sample builder that is given here. so this builder is what will basically use this type at the end of the day. So if you want to create your own builder right, we can define your own type and then use a custom builder for that. 242 00:33:42.690 --> 00:33:50.510 Ashwath - Spydra: so you can look at the how the external builder works in in fabric, and that will give you a much better understanding of how 243 00:33:50.790 --> 00:33:53.209 Ashwath - Spydra: how? How that kills? 244 00:33:53.730 --> 00:33:55.340 Ashwath - Spydra: Yeah. So here, if you see. 245 00:33:58.410 --> 00:34:07.779 Ashwath - Spydra: yeah. So we have to hardcore this in the sample builder for the type that we are going to do whatever. Yeah, whatever you define here, you have to use that in the builder. Essentially. 246 00:34:08.130 --> 00:34:12.420 Ravinayag: okay. But this is a built in type, essentially, that fabric. It's a 247 00:34:12.969 --> 00:34:13.650 Ashwath - Spydra: yeah. 248 00:34:14.980 --> 00:34:15.739 Ashwath - Spydra: Okay. 249 00:34:16.020 --> 00:34:30.739 Ashwath - Spydra: so let me switch back to the other screen port, right? So this is the same external chain code, but a fresh one right where, when we have not done anything. But we have just installed the hypothesis fabric deeper the extension. Yeah. 250 00:34:30.940 --> 00:34:37.640 Ashwath - Spydra: So the the the process is similar. If I have to debug, I have to first of all create a launch.ch. Inside, right. 251 00:34:37.690 --> 00:34:39.840 Ashwath - Spydra: So I'll create a launch for this on 5. 252 00:34:40.000 --> 00:34:45.349 Ashwath - Spydra: But you you see that there is an add configuration option here, right? Which, anyway comes. 253 00:34:45.719 --> 00:34:47.999 Ashwath - Spydra: So if you go to add configuration right 254 00:34:48.120 --> 00:34:53.760 Ashwath - Spydra: and scroll down to the Google section, you'll see that there is a option to debug fabric. 255 00:34:53.870 --> 00:35:02.890 Ashwath - Spydra: So this is this doesn't come automatically. This is coming here because I've installed the extension. So this extension is contributing this additional option here. So if you 256 00:35:03.200 --> 00:35:12.480 Ashwath - Spydra: select this right, what it has done is, it has created another configuration section here. Right? So there. Now, you can see there are 2 configuration section one is the default, one which. 257 00:35:12.610 --> 00:35:19.270 Ashwath - Spydra: which visual studio code create, which is the just saying, I can debug go go chain for. 258 00:35:19.390 --> 00:35:23.460 Ashwath - Spydra: And now there is another configuration section that is created here. 259 00:35:23.540 --> 00:35:31.629 Ashwath - Spydra: So the first one is called launch package, and the second one that has been created with the blockchain port. And if you see here, right in the Debug section. 260 00:35:31.640 --> 00:35:33.240 Ashwath - Spydra: does it drop down where? 261 00:35:33.630 --> 00:35:50.680 Ashwath - Spydra: Let me save it. It's not saved. Yeah. Now, if you go to the drop down, you'll see those 2 options here, right? So delete the other one, which is a default go one because it wouldn't work out of the box, anyway. And now you'll see that there's only one option here, right? 262 00:35:51.310 --> 00:35:57.829 Ashwath - Spydra: And if you see the configuration options here, one is just a name, the other is the type. So the 263 00:35:58.040 --> 00:36:02.970 Ashwath - Spydra: the extension basically supports golank and node. 264 00:36:03.000 --> 00:36:11.410 Ashwath - Spydra: So hs go is for go line. So this is good. And and if you change it to Node, and I'll show that. Come to that later. It's the it'll support Node. 265 00:36:11.580 --> 00:36:25.539 Ashwath - Spydra: And then there is another flag, which is this is a chainboard as a survey. So we are talking about. You know, there are 2 ways of developing chicken code right? Such a inquiry service way, or the older way, because it is a chain code as a service kind of a code. I'll switch this to true 266 00:36:25.960 --> 00:36:32.090 Ashwath - Spydra: right to instruct the debugger that the port has been developed to work with chain put as a service market right? 267 00:36:32.630 --> 00:36:42.450 Ashwath - Spydra: And that's pretty much it right? You don't have to. So what I'll do is I will also, just to be sure, what I'll do is I'll remove the network that we created. Right? So 268 00:36:43.140 --> 00:36:45.610 Ashwath - Spydra: I will. Okay, so 269 00:36:47.180 --> 00:36:50.179 Ashwath - Spydra: I will do dot slash 270 00:36:50.430 --> 00:37:03.190 Ashwath - Spydra: down. So I'll bring down the network right? The earlier one that we have created. So we don't have that network anymore. And all that we have done is open the chain port and created this configuration file right? 271 00:37:03.300 --> 00:37:07.670 Ashwath - Spydra: And that's it. Now, if I click on the book 272 00:37:08.270 --> 00:37:21.330 Ashwath - Spydra: now you see that some things are happening here. it's a starting local fabric network. And there is some things happening right? So it's actually creating a beer node, it's actually creating. 273 00:37:21.810 --> 00:37:26.179 Ashwath - Spydra: So if I look through the so what the message is here 274 00:37:26.310 --> 00:37:32.410 Ashwath - Spydra: everything that was done to create a network. 275 00:37:32.550 --> 00:37:33.330 Ashwath - Spydra: right 276 00:37:33.700 --> 00:37:45.110 Ashwath - Spydra: is being done automatically by the change code. Okay, I got an error because you know, as again, I have to select go find before I click the debug, which I always forget. 277 00:37:45.200 --> 00:37:46.620 Ashwath - Spydra: Let me do that again. 278 00:37:48.300 --> 00:38:16.399 Ashwath - Spydra: and if I look at the output here, right is, as you can see, it's creating a Ca container cli, container, order or peer. So everything that happens when you create a network is automatically happening here. So the chain code, the the extension, actually does all of that for you right? And then it deployes creates the channel. If I look through all of that it's it's creating a channel, and then it's deploying the chain port 279 00:38:16.750 --> 00:38:21.539 Ashwath - Spydra: into that channel. And you know. 280 00:38:21.700 --> 00:38:30.520 Ashwath - Spydra: everything that we discussed about how to manually configure the input as a service model is being done automatically by the plug Plugin, literally, that's what is happening. 281 00:38:30.810 --> 00:38:50.230 Ashwath - Spydra: So now, the debug is actually started. But as you are seeing earlier in order to actually submit a request. We use the Poc I earlier, right? But that defeats the purpose right. If now again, I have to go somewhere else basically use the poly and submit a request right? So that's where the second thing that the plugin does is 282 00:38:50.600 --> 00:39:02.119 Ashwath - Spydra: It provides a way to submit the request right from within visual studio. and the way to do that is by creating a file with a dot fabric extension. You can name it anything right 283 00:39:02.150 --> 00:39:12.010 Ashwath - Spydra: like I have named the already created a file called Hes dot fabric here. but the name doesn't matter, and you can actually create as many files as you want, right? 284 00:39:12.790 --> 00:39:33.289 Ashwath - Spydra: So and how does the file look? It's a Json file. Basically, it's a Json file, which you know, which is an array. And there are individual objects that you can create within it. And the structure of this is, first of all, you say, whether you want to be invoked or query. So just like, you know, when you're invoking through the 285 00:39:33.340 --> 00:39:35.770 Ashwath - Spydra: you say, you basically say that first. 286 00:39:35.820 --> 00:39:49.589 Ashwath - Spydra: and then which method? Right? So in it, ledger is a method which doesn't take any argument. So all that you have to say is invoke in it, Ledger, and you'll see that the moment you type in work. Right? So let me write something new here, create a new section. 287 00:39:49.600 --> 00:39:53.660 Ashwath - Spydra: I'll type in work. or 288 00:39:54.320 --> 00:39:59.779 Ashwath - Spydra: very. You see a send request Link appearing about right. So like here it disappearing here. 289 00:39:59.900 --> 00:40:07.589 Ashwath - Spydra: So you click that. and you can see that you know the result will be on the right. So the invocation is successful. 290 00:40:07.820 --> 00:40:14.979 Ashwath - Spydra: Similarly, I have, created a very query request and get all assets. Send request. 291 00:40:15.290 --> 00:40:18.080 Ashwath - Spydra: And you don't need to basically 292 00:40:18.300 --> 00:40:31.740 Ashwath - Spydra: send. Call this method and give you the results so literally. You know, you can invoke the chain port right from within visual studio, and of course you can put a breakpoint like, here, let me put a break point at the top. 293 00:40:32.100 --> 00:40:34.440 Ashwath - Spydra: So let's let me put it in. Get 294 00:40:35.950 --> 00:40:38.940 Ashwath - Spydra: read. Read a set here. Yeah. 295 00:40:39.300 --> 00:40:42.239 Ashwath - Spydra: and I go to the dot fabric file. 296 00:40:42.620 --> 00:40:44.769 Ashwath - Spydra: and let me 297 00:40:47.140 --> 00:40:49.400 Ashwath - Spydra: create new 298 00:40:49.550 --> 00:40:52.059 Ashwath - Spydra: section for that. But I don't have one. 299 00:40:52.180 --> 00:40:53.969 Ashwath - Spydra: So it's a read as it 300 00:40:54.120 --> 00:40:59.480 Ashwath - Spydra: is what I want to do, and arguments because this expects some arguments. 301 00:40:59.720 --> 00:41:03.620 Ashwath - Spydra: and what does it expect? It expects the context. 302 00:41:04.060 --> 00:41:08.590 Ashwath - Spydra: And an id right? So id is a string, so let's say. 303 00:41:09.270 --> 00:41:09.970 oh. 304 00:41:11.610 --> 00:41:12.780 Ashwath - Spydra: see! 305 00:41:14.010 --> 00:41:23.149 Ashwath - Spydra: So I said. One is one of the asset that has been inserted via the in It ledger. So I say, read, I said one, and send request. 306 00:41:26.240 --> 00:41:27.220 Yes, it is 307 00:41:28.230 --> 00:41:29.050 Ashwath - Spydra: exist. 308 00:41:30.890 --> 00:41:35.979 Ashwath - Spydra: Something went wrong in the chain code, I guess, but it's a it's a it's a 309 00:41:36.990 --> 00:41:40.299 Ashwath - Spydra: it's coming from within the chain, probably. So let's see what is 310 00:41:42.230 --> 00:41:43.250 Ashwath - Spydra: happening. 311 00:41:51.260 --> 00:41:53.630 Ashwath - Spydra: Let's see if I can. 312 00:41:54.390 --> 00:42:01.850 Ashwath - Spydra: I think it's coming from even below about here. So let me put a breakpoint here, and if I click on 10 request. 313 00:42:02.670 --> 00:42:10.500 Ashwath - Spydra: so send request here. we'll see that the break point is hit, and then you can do if 10 and 314 00:42:11.130 --> 00:42:17.709 Ashwath - Spydra: as you can see, it cannot read for whatever reason. But basically the request is coming in, and you can see that. 315 00:42:17.870 --> 00:42:21.540 Ashwath - Spydra: you know, the when it's actually reading the 316 00:42:21.740 --> 00:42:25.149 Ashwath - Spydra: the asset doesn't exist, and 317 00:42:25.220 --> 00:42:28.410 Ashwath - Spydra: some of the 318 00:42:29.980 --> 00:42:31.429 Ashwath - Spydra: which is weird. 319 00:42:32.480 --> 00:42:37.329 Ashwath - Spydra: But basically, you know this, this is this is how you will. 320 00:42:37.530 --> 00:42:50.860 Ashwath - Spydra: you can basically debug, right? so what? Whatever method you put right like, for example. in the create asset. Right? You can. We are calling the create asset. So I can put a break point within. 321 00:42:51.820 --> 00:42:58.800 Ashwath - Spydra: We then create a set here. Sorry. Let me go back here and with the big point here. 322 00:42:59.120 --> 00:43:06.700 Ashwath - Spydra: and if I send request the breakpoint is hit, and then you can see that the Id that was sent. 323 00:43:06.800 --> 00:43:10.960 Ashwath - Spydra: which is a one, is what is coming here. Right so. 324 00:43:11.220 --> 00:43:13.919 Ashwath - Spydra: and then you can, you know, 325 00:43:14.210 --> 00:43:16.229 Ashwath - Spydra: be back as you normally would do. 326 00:43:16.640 --> 00:43:29.050 Ashwath - Spydra: Yeah. So that's that's the that's the quick and easy way of doing it. As I was saying, you know, this works with the go lang as well as no Gs chain port. So let me just quickly switch to a different 327 00:43:29.590 --> 00:43:41.699 Ashwath - Spydra: changing port, which is no gst in code. And this is again of coming from fabric samples only. And this is the chain code that I'm using. Here is the asset ledger. 328 00:43:41.850 --> 00:43:48.560 Ashwath - Spydra: I said, transfer legendary queries, because this has some more advanced features around varying. So let's quickly look at that. So there's a 329 00:43:48.640 --> 00:43:56.540 Ashwath - Spydra: chain code that I just opened individual studio code, and, as usual, I go to the Debug section for you to launch, file. 330 00:43:56.620 --> 00:44:03.070 Ashwath - Spydra: create. No, no, no! Just launch files this time. And as earlier. 331 00:44:03.090 --> 00:44:06.670 Ashwath - Spydra: basically. 332 00:44:07.890 --> 00:44:20.280 Ashwath - Spydra: yeah, once, once you create a launch file, you can save it. And then as earlier, right this time. What I'll do is I will take this 333 00:44:21.010 --> 00:44:23.810 Ashwath - Spydra: configuration and 334 00:44:25.830 --> 00:44:29.149 Ashwath - Spydra: replace this with that. 335 00:44:30.130 --> 00:44:31.720 Ashwath - Spydra: And 336 00:44:32.890 --> 00:44:34.920 Ashwath - Spydra: instead of go, I'll 337 00:44:34.960 --> 00:44:40.970 Ashwath - Spydra: say, Node, this is a node based. Input and this is not a chain code as a service. So I'll switch this to false. 338 00:44:41.190 --> 00:44:45.310 Ashwath - Spydra: And yeah, that's pretty much it right? And then I go back to the 339 00:44:46.140 --> 00:44:49.810 Ashwath - Spydra: just file and start debugging. 340 00:44:54.980 --> 00:45:00.479 Ashwath - Spydra: And as you can see, it's doing a similar thing, it's creating the network. launching the chain port. 341 00:45:01.170 --> 00:45:05.500 Ashwath - Spydra: I know that. And once it's ready, it's 342 00:45:05.530 --> 00:45:11.279 Ashwath - Spydra: starts printing the message that it's fairly Again, I can period dot fabric file 343 00:45:11.480 --> 00:45:20.909 Ashwath - Spydra: But with the the methods that exist in this one. Right? So similarly, there's a needed ledger method in the Nodegs chain code that gets 344 00:45:20.920 --> 00:45:22.120 Ashwath - Spydra: initiated. 345 00:45:22.280 --> 00:45:27.140 Ashwath - Spydra: you can put a breakpoint. Let's do that in. Read a set here 346 00:45:30.350 --> 00:45:35.280 Ashwath - Spydra: upon it here. So this is a read asset and 347 00:45:36.620 --> 00:45:43.050 Ashwath - Spydra: and the big point here. 348 00:45:43.620 --> 00:45:44.480 Ashwath - Spydra: And 349 00:45:47.170 --> 00:45:52.740 Ashwath - Spydra: so when I click that it comes here. And, as usual, right? I can basically 350 00:45:53.180 --> 00:45:58.309 Ashwath - Spydra: inspect the the variables. The I can inspect 351 00:45:58.780 --> 00:46:10.859 Ashwath - Spydra: the Id. Here, for example, like in step through step over all of that right now. There are some additional features that this supports the the Plugin supports like. For example, if I go to the 352 00:46:11.050 --> 00:46:12.769 Ashwath - Spydra: dot fabric? 5. Right? 353 00:46:13.070 --> 00:46:17.579 Ashwath - Spydra: normally when you submit a argument right? 354 00:46:17.710 --> 00:46:21.820 Ashwath - Spydra: Everything, even if you do it, using the 355 00:46:21.910 --> 00:46:25.850 Ashwath - Spydra: string. So, for example, in this case, right? There is a 356 00:46:25.910 --> 00:46:35.739 Ashwath - Spydra: couch TV query that you can submit to query assets. But then you'll have to stringify it first like this, and then some normally right. If you look at the 357 00:46:35.770 --> 00:46:47.309 Ashwath - Spydra: the sample here, that's how they do it right This is where the Gauss TV, very option way of doing it is mentioned, and you know you'll have to stringify and then submit it right 358 00:46:47.460 --> 00:46:48.700 Ashwath - Spydra: like this will work. 359 00:46:48.710 --> 00:47:03.980 Ashwath - Spydra: But this is a bit difficult, right? And especially if your Json is huge. So that's where we also the Plugin also supports, instead of signifying it and support and and submitting it, you can basically submit it as a Json itself. Right? So this, this will work. 360 00:47:04.000 --> 00:47:09.140 Ashwath - Spydra: And this will also work right? So when you do that. it's actually changing. But 361 00:47:09.700 --> 00:47:10.410 okay. 362 00:47:11.140 --> 00:47:17.770 Ashwath - Spydra: let me show you by calling something else. First, I just for read a set, and then if I do this. 363 00:47:18.160 --> 00:47:22.040 Ashwath - Spydra: as you can see, the result is coming. so you can actually 364 00:47:22.590 --> 00:47:29.050 Ashwath - Spydra: so directly, right? have a json here instead of signifying it and then then submitting it. 365 00:47:29.740 --> 00:47:32.560 Ashwath - Spydra: if you go to the 366 00:47:32.840 --> 00:47:44.870 Ashwath - Spydra: extension here, there are some additional things that you see here. First of all. you this basically creates a network behind the scenes. If I go to my docker container now, right 367 00:47:44.920 --> 00:48:02.579 Ashwath - Spydra: there is a network that it has created with the Ca, Pr water or cli, and all of that right in you can actually manage the network. So if you're you know, if you're done with your debugging when you quit visual studio code. It will actually stop the network by itself, but it won't remove the network. 368 00:48:02.680 --> 00:48:22.619 Ashwath - Spydra: So if you want to, but manually stop, start, or remove right if you want to reset the network. So the way this still work is that when you when you quit visual studio code, it will stop the network next time when you debug the same network will be reused. So any as any, anything that you have submitted right, any transactions you have made. 369 00:48:22.620 --> 00:48:40.159 Ashwath - Spydra: Everything will be there in the ledger as such. So you know there will be continued. But let's say you want to start from scratch right, so you can remove the network. And then then when you debug the next time you'll get a fresh network all together. So there are some, you know options to manage the network that is created automatically by the Plugin. 370 00:48:40.400 --> 00:48:45.820 Ashwath - Spydra: And then the other thing that you can do is you you can use, you know different users. 371 00:48:46.160 --> 00:49:04.080 Ashwath - Spydra: So if you have a case where you want to use different users and do some testing right by default the Plugin will create 2 users for you or an admin and user user one or when Admin has an admin role and user, one has a client role within within fabric. 372 00:49:04.170 --> 00:49:08.009 Ashwath - Spydra: But you can actually create more users. Right? Like, I can say, create 373 00:49:08.230 --> 00:49:11.010 Ashwath - Spydra: user. And let's see. 374 00:49:12.720 --> 00:49:14.520 Ashwath - Spydra: And 375 00:49:14.610 --> 00:49:17.950 Ashwath - Spydra: that will be created. And in the 376 00:49:18.580 --> 00:49:30.210 Ashwath - Spydra: tested fabric right where your invoking or query you can provide an identity option with the user that you want to use 377 00:49:31.170 --> 00:49:33.449 Ashwath - Spydra: right? And now, when you do this. 378 00:49:34.790 --> 00:49:40.920 Ashwath - Spydra: And if you inspect the code here. 379 00:49:48.240 --> 00:49:48.980 Ashwath - Spydra: yeah. 380 00:49:52.630 --> 00:49:55.729 Ashwath - Spydra: somehow, the break point is not hitting 381 00:49:58.290 --> 00:50:01.330 Ashwath - Spydra: 1 s, let me stop this and start again. 382 00:50:07.580 --> 00:50:08.500 Ashwath - Spydra: Okay. 383 00:50:09.770 --> 00:50:12.970 Ashwath - Spydra: so if you submit this with user 10, 384 00:50:16.550 --> 00:50:18.040 Ashwath - Spydra: something is 385 00:50:18.710 --> 00:50:22.240 Ashwath - Spydra: gone wrong. You cannot run the pier. 386 00:50:23.900 --> 00:50:26.059 Ashwath - Spydra: okay, I think, maybe. 387 00:50:26.170 --> 00:50:28.370 Ashwath - Spydra: can I do I click something here? 388 00:50:28.720 --> 00:50:43.430 Ashwath - Spydra: Okay, I think, I'll probably have to reset the network. But I basically, you know, when when you when when you use a different identity. It should. And if you inspect the context object, right, you should actually see the different identity. that that you 389 00:50:43.540 --> 00:50:52.900 Ashwath - Spydra: basically set up right? So the plugin, basically supports multiple users to be created in a wallet and things like that. 390 00:50:53.550 --> 00:51:02.660 Ashwath - Spydra: so yeah, that's that's pretty much what I wanted to show you. So feel free to, you know. Download the plugin and play around with it. 391 00:51:02.820 --> 00:51:12.749 Ashwath - Spydra: As I was saying, you know, at Spider. We also provide a. Our mission is to, you know, make the adoption of blockchain easier. So we provide a platform that you can also 392 00:51:12.790 --> 00:51:22.920 Ashwath - Spydra: try around so you can go to Spider dot app, and if you go to get started right, you should be able to register yourself and try the platform out. You can create a hyperlier fabric network 393 00:51:23.020 --> 00:51:35.210 Ashwath - Spydra: within spider. And then you can try out the features. We provide a $400. Predict that you can use for free and try out the platform. So feel free to do that. 394 00:51:37.550 --> 00:51:43.139 Kamlesh Nagware: So thanks everyone. I'll take any questions that you have. 395 00:51:43.890 --> 00:52:02.339 Ravinayag: somebody's. Can I ask you, yeah, yeah, okay, I I just have a question. But somehow I understand that. But still I want to confirm from your side So when we do that deeper thing, and executing some transactions before launching it. 396 00:52:02.750 --> 00:52:07.879 Ravinayag: how then that transaction? You'll be there, I mean all the practical part of you. 397 00:52:08.460 --> 00:52:20.779 Ravinayag: The the question here is, will that be a transaction, that apple mechanisms? All those things will be there, or just a simple. when you launch the chain for just executing the phonetical function. That's it. 398 00:52:20.910 --> 00:52:23.710 Ravinayag: Nothing, I think, blocked in the car in that account. 399 00:52:25.030 --> 00:52:49.610 Ashwath - Spydra: so are you asking whether the transaction actually goes to the peer? Is that what you're asking? Or are you about? Yeah, it actually does go to the period. So you know, if you so basically, the you know what the Plugin does is it actually creates a real network behind the scene. It's a single or network, as you can see. So there's no no multiple organizations. Not but it actually creates a real network behind the scenes, and the transactions are submitted to the peer. 400 00:52:49.720 --> 00:53:01.149 Ashwath - Spydra: it's just that it's all managed behind the scenes for you. So you don't have to create your own network. But it's actually going to the hypothesis fabric. It's executing the code that you have written and everything. So it's nothing different. 401 00:53:01.650 --> 00:53:05.649 Ravinayag: Okay, okay. that is internally minded with the 402 00:53:06.550 --> 00:53:09.550 Ashwath - Spydra: correct, yeah, it's I internally managed by the plugin. Yes. 403 00:53:11.890 --> 00:53:15.789 Gourav Sarkar: yeah. I, I have a question. can I ask. 404 00:53:16.010 --> 00:53:17.599 Ashwath - Spydra: yeah, yeah, please go ahead. 405 00:53:18.470 --> 00:53:25.810 Gourav Sarkar: So just wanted to check that you mentioned. in the fabric we have the chain code as a service, and as well as the fabric, Dave mode. 406 00:53:25.840 --> 00:53:28.330 Gourav Sarkar: So when you do this 407 00:53:28.420 --> 00:53:36.949 Gourav Sarkar: debugging. So do you support both, or is it The change as a service is the only one that you are looking for? 408 00:53:37.100 --> 00:53:38.870 Gourav Sarkar: We support on. My. 409 00:53:39.630 --> 00:53:45.280 Ashwath - Spydra: yeah, we support both actually. And in fact, you know, in the samples that I was showing you right. The Javascript one 410 00:53:45.520 --> 00:53:51.419 Ashwath - Spydra: is actually written with the older way of doing it. So it's not chain, but as a service. So there is a 411 00:53:51.560 --> 00:54:03.709 Ashwath - Spydra: in the configuration for the debugger, right? There is a particular key whether it's a chain code as a service or not. So if you set it to false, it's the older method, and if you said it to true 412 00:54:04.000 --> 00:54:10.489 Ashwath - Spydra: which is the other one here. Then the the plugin works accordingly, and 413 00:54:10.740 --> 00:54:13.980 Ashwath - Spydra: it does the job for you. So we support both. Yeah. 414 00:54:14.690 --> 00:54:16.520 Gourav Sarkar: okay. thank you. 415 00:54:17.650 --> 00:54:18.330 Yeah. 416 00:54:19.080 --> 00:54:25.240 Ravinayag: Okay, I have another question. how this private data connections or 417 00:54:25.320 --> 00:54:38.480 Ravinayag: the mechanism. If I've mentioned in the chain code like. If if the, for example, it's like safe conditions in the chain code, saying that only from this organization comes in, you allowed to execute the chain code. 418 00:54:38.650 --> 00:54:42.410 Ravinayag: In that case, how that can be handled in the by the platform. 419 00:54:43.240 --> 00:54:46.950 Ashwath - Spydra: Yeah. So the Plugin plugins the reason 420 00:54:47.910 --> 00:55:06.160 Ashwath - Spydra: to just debug your code right it literally. So if you look at the the network that it creates, it's a single or network, and which means, you know, there's only one year to endorse. Right? So there is. No, there are no multiple peers. We are not talking about endorsement policies or 421 00:55:06.210 --> 00:55:14.069 Ashwath - Spydra: so private private data collection will work but endorsement. But there is no endorsement policy concept as it's in the 422 00:55:14.080 --> 00:55:19.469 Ashwath - Spydra: in the network that the Plugin deploy and the the reason for that is, it's, you know, it's 423 00:55:19.510 --> 00:55:28.610 Ashwath - Spydra: it's not really to test any of that right? It's not even connecting to any existing network that you have. It's deploying it somewhere. Right. So the only only intention is just to 424 00:55:28.770 --> 00:55:33.000 Ashwath - Spydra: deeper the code that you're written right? Which is what it is really trying to solve. 425 00:55:34.090 --> 00:55:43.360 Ravinayag: Yeah, I agree. but I I mean, I have that some thoughts here. What if I launch the network? And can I do that? People with that particular work? 426 00:55:44.670 --> 00:55:59.470 Ashwath - Spydra: not using the plugin. But yes, using the manual, the way that I talked about right? that, you know, you can basically do the right configurations, either as a dev mode or as an external service in your existing network. 427 00:55:59.600 --> 00:56:21.659 Ashwath - Spydra: They then you then it can do yes, but not using the plugin, but yes, in the roadmap, we want to extend the plugin so that the debug works it in the existing network that you have. We also want to provide an option to create multiple organizations and and those configure things like endorsement policies and all going forward. But right now it just creates a single single or network. 428 00:56:21.890 --> 00:56:24.890 Ravinayag: Thank you. Thank you. Yeah. Got it. Thank you. 429 00:56:29.270 --> 00:56:34.489 Ashwath - Spydra: Yeah. Is there any Doc to taste this out for the like? The step by step? Precision. 430 00:56:35.160 --> 00:56:44.189 Ashwath - Spydra: Yes, yes. So if you go to the Plugin itself, right? the extension plug in itself. 431 00:56:44.410 --> 00:56:54.640 Ashwath - Spydra: so you can actually see the documentation right here and there are links to the other, to the github or so, and things like that. So if you see here right, there's a quick start. 432 00:56:54.710 --> 00:57:00.859 Ashwath - Spydra: and you can view this in the marketplace also. So there is a quick start how to do that. All the instructions are here. Right here. 433 00:57:01.550 --> 00:57:02.860 yogi: Yeah, I done. Thank you. 434 00:57:04.640 --> 00:57:17.090 Gourav Sarkar: Yeah, just I have one more question as So this this debugger support both the fabric sheen as well as the contract Api both the types of chain code writings. 435 00:57:17.390 --> 00:57:20.419 Ashwath - Spydra: Yeah, yeah, it does. Actually, yes, correct, it does. 436 00:57:21.000 --> 00:57:21.660 Gourav Sarkar: Okay. 437 00:57:24.860 --> 00:57:25.530 yeah. 438 00:57:27.180 --> 00:57:31.980 Kamlesh Nagware: Okay, I do. Thank you. If any other question you can ask. Otherwise we can. 439 00:57:34.330 --> 00:57:40.579 Kamlesh Nagware: So you can share the this Vs code extension here, I think someone asking the check. 440 00:57:41.070 --> 00:57:43.959 Ashwath - Spydra: Okay? Sure? Sure. Yeah. Let me just 441 00:57:45.950 --> 00:57:47.720 Ashwath - Spydra: share that directly. 442 00:57:47.830 --> 00:57:55.989 Kamlesh Nagware: Yeah. And this recording will be available on how you call users Youtube general. So, and that will be also shared on the Hypervisor interceptor. 443 00:57:56.280 --> 00:58:00.820 Kamlesh Nagware: Well, So you can follow ipad in India. 444 00:58:04.520 --> 00:58:09.320 Ashwath - Spydra: I get to be trying to get to the chat window. 445 00:58:09.500 --> 00:58:10.609 Ashwath - Spydra: Yeah. Got it 446 00:58:12.000 --> 00:58:19.100 Kamlesh Nagware: so as well. Can you do? Can you make me cause I need to stop the recording? You don't want the commercial. 447 00:58:19.330 --> 00:58:24.980 Ashwath - Spydra: Okay? And yeah. let's stop the recording.