 this. Okay, so welcome to this Hyperledger Sweden Meetup. My name is Roland and I'm your guest for today's session. And as I've mentioned, today, I think we will have a great session. So that is the 10th session in this row. And I think that's a small, we have something to celebrate with this. And in this session, I will discover a special topic. So this topic is from a user request or from somebody who is watching this series. And he came up with a question, how we can use the Node.js SDK with the development network. And when I talk about development network, I mean the Docker Dev Mode, this is the network we have developed on the end of January. So we can use Docker version of that or a binary version. And this request is about the binary version. So today, we will see how we can make this, we can use this binary version from SAP and the order. And then we can write the Node.js chain code. And also how we can use the Node.js SDK to connect to this test network. And this is the session today. So, okay, a short overview. At the beginning, I will give you an overview about this development environment. So we have done this in the past. So I have linked this support material here from the 29 of January this year. And in this support material, you will find two links. One of them is broken. So I will fix that as soon as possible. And in this session from 29 of January, we have seen how we can create a binary version development environment. So this means without any Docker system, and how we can use a Docker composition to use them. And there you will find a detailed step-by-step guide how you can set up this. And today, we will use this setup. And we will try to develop or we will use this predefined chain code as a transfer basic example. And then we will show you how you can connect to this network. And that's the reason why I have divided this session into two parts. The first part is the preparation of the chain code development environment. So I will show you all the steps again. The only single missing steps are how you can build the go binaries for the B and the order and how you can clone the favorite repo from the official GitHub repository. But this information is also in this support material here. And then we will see how we can use this chain code and what is the advantage of this PDF mode. And then we will see how we can use the Node.js SDK to interact with this dev network. And yeah, support material is here. And here's a link of that. Here's the link of the support material from the previous session. And then here you will find my two links to the Hyperledger favorite documentation and then to the favorite chain code node version. It's also always a good tip to read this documentation and to see how things can work. And here a short overview of this development environment. So this is a try to make this a little bit understandable. So when we use, in this example, we are going to use the binary version. So that means that we will not use any Docker environment here. So we have the possibility that we can build and go binary for the order and then go binary for the peer. And we can run this to systems and then we can start the chain code by hand and then we can interact with this chain code. And in this scenario, we will have here a simple network. The favorite repository gives us all the binary, all the crypto material and config which we need. And that's also the key to this task. So when we look into this favorite repository, then we will find the folder called sample config. And in this sample config, we have a folder membership MSP membership service provider with all the the crypto materials and certificates we need to get this running. And yeah, so we will have this, we will use only the binary versions. So and then we need some tools to control this. So maybe we can use this with a terminal multiplexer or we can use it with the jobs command or with the age stop command. So we can because we would like to run this order on the video in the background. So we will not see the in the photo in the photo ground that the terminal is blocked in this way. And yeah, so then we have a peer and the order are running. And we have to create the Genesis block, we have to create the channel transaction, we have to create the channel, join the channel, install the chain code and approve and commit the chain code according to the new lifecycle development in fabric 2.2. And so, and this means this are the elements from this, from a typical development environment which you can have on your local machine. And then we need the favorite Node.js SDK. So we have to install it with the npm command. So current version is 2.25, I think. And then we need the connection profile. So that's an important part or the tricky part, how we can make this, how we can make this connection profile or which information we should put in the, into this connection profile. And this is an important task, how we can do this. And then we have to create an identity to interact with the network. And in the favorite sample conflicts, we will see that in this membership service provider folder, we will find an admin chart and a key store with a private key. And we need both of them to create an identity and to convert this, to convert this identity to and look to the local wallet. So the Node.js SDK works as a client. And this client has a wallet, the local wallet, the file wallet in our example. And we have to convert the existing crypto materialistic, the, the, the signing certification and the private keys to this local wallet identity, because we don't have a favorite say running here. So we cannot read just the end roll and new identity. So we have to use this one. And for this, we will create a small script. I call this edge to wallet. So you find the script or parts or elements of this script also in some favorite samples, especially in the commercial paper repository or example. And there is a similar script on this also called at two wallet shares. And with this, this is one of our first tasks. We have to create an identity for this local wallet. And then we can use this identity to interact with the network. And these are the steps we have to do here now. Okay, so, yeah, here I have a step by step in a guide here as an overview. So the first step is that we have to start the development network. And we need the chain code for this. And I have copied the asset transfer basic chain code. And we can do a little bit with them and try this to, to modify or to, to test if the chain code is working or something like that. So we need a chain code. And since this session is all, all about the Node.js. So we use the Node.js version from that. And yeah, that's the first thing. So we need the network and we need the running system with a chain code. And then we need the connection profile. So we have to create this connection profile. The connection profile is nothing more than a JSON file or a YAML file, which contains some useful information for from the network. So in this connection profile, you will set your peer, your address, a peer address, or your, your peers from the peer, a TLS certificate, for example, the order of information, or the channel information. And maybe this is also another important piece to get this running. So since this development environment is not so, I'm not sure if this is a real, real network, because we only have a limited network. And that's the reason why I think the discovery service is not working. And that's also the reason why we have to disable the discovery service in the connection part from the Node.js application. And we have to write our connection profile by ourselves. And yeah, so that's not really difficult. You only have to know what you have to fill in on the right position. And then we have to convert the identity. So Hyperledge Affair is an permissioned blockchain system. So every transaction needs an identity. And we need one identity. And we cannot take any identity which not belongs to the system. So that's the reason why, for example, you will find an admin certificate and also the private key of this admin. And then we can take these two files and then we can put this into the local wallet and create an identity which the Node.js SDK can read. And this is done with this extra wallet script. But this, you can do this also for a regular for the test network in the test network example. And you can do it also in your regular network. So that's, there's no different to do this. And then we can create a short command line interface program. So which we can start from the command line with the node profile, with the node command and then interact with the network. So I call this index.js. And then we can interact with the network. But on this position, you can also write the Node.js application, express.js application. You can use another West API framework where you can create whatever you want here. But these one, two, three, four steps are the steps we are going to do now in this session today. Okay. So I think the first, the important part here is when we have to look where we find all this information. So, and in this favorite death folder, we have created in the last session, we have also cloned this favorite repository. And then this favorite repository, we will find this sample conflict folder. So this is important for us because in the sample conflict folder here, we will find all the needed elements for our test network. We'll find here the conflict TX YAML file for the configuration. We will find here the core YAML file and also the order YAML file. The core YAML file and all the styles are important for the connection for the conflict path, the conflict path. And when we look into the MSP folder, you see here, here is admin certs, for example, and so on. And the key file from that. So we can use this information to create a local identity. And yeah, so that's important to know that we can find all the elements here in this folder. And also important to know is when we look into this conflict TX YAML file here, then we see the name of this network. So, and important here is the membership service provider ID so that we, because we have to use this in the connection profile, the name. Okay, so the first step is now that we start our network. And I use this terminal multiplexer for that. And we need two environment variables here. We need the path. So we have to extend the path with our favorite build path here. So this is the only part which I don't, I'm not showing here in this example how you can build the binaries here. So we have here the order and the beer and this conflict TX again file to create the genesis block and the trans channel transaction. But how you can do this, you will find this in the documentation. And you can find as well this in the documentation in the official fabric documentation. So but not in the 2.2 version, you will find this only in the 2.3 version. I don't know why. But in the 2.3 version, you will find also official documentation how you can use this def mode in the binary version here. So okay. Yeah, so we need the path and we need the fabric conflict path because we have seen here are all important environment files are located. So okay, so now the first step like in every system is that we have to create the genesis block. And we have here the same, we need a profile for that. And this is the sample def mode solo profile. And you find this here in the, you will find this here in the conflict TX example file here under the profile section. So sample def mode solo, here have the profile for that. But you have also here other profiles. So you can experiment also with other profiles here. But I think for the testing, that's the simplest this keep keep the thing simple. And I think that's a simple version or a simple way to do it. Here's the solo order for that. And I think that's enough. Okay, so then we can create this genesis block. Sorry, I have to look if I have done my housekeeping. So please, but we don't have any troubles here. So empty and the data folder should also be empty. Okay. So no, let's create the genesis block for that. And with the genesis block, we can start the order. And to start the order, we can do this in a single line. And we will we will, we will leave the order running in the background. So please notice this here. So we deliver the standard output and standard error to the, to the background. And that will sleep that the order not is running in the background and is not blocking the terminal here. So and also when we leave the terminal leave our session terminal session here, the order is running again. And then the order should run. We can check this with a command jobs, for example, and you see here the running order. Can you increase the phone size? So which size, the left, the left side, this side or the other side? I think here it's, this is large enough. And, and here this you can follow this both please. So I think then we will have a little bit too less space on the screen. You can follow this in the on the GitHub page. And the same document document on this link I have posted it in the chat. And then you can follow this directly there. So and okay. So now the order is running. And the same we can do with the beer. So we can start the beer. And the important part here is that we start the beer in this depth chain quote beer chain quote, the depth mode is equal to two. So, and this is the important parameter to start the beer in this mode, in this particular mode. And then we can hear, we can, this is the command here. And here we set some environment variables for this for this command. And here we have the beer decor peer file system path. This is where the blockchain live, but there's all the data. And here we have debug variable. And we have the train code listen address and the operations address. So in the documentation from the meetup from end of July, you will find both commands a little bit more explained than here. So when we have jobs, then we see here to running jobs. So we have to order a running and we have to be a running. And you can also use a stop for example, to inspect this. And then you can search for that. You see here, you're being all this running. And also when you do this with the order, you see also the order. So okay. So the jobs command help you to display the option. R is the oil running jobs means all our running jobs. So okay. And the next, now we have the beer running, we have the order running. Now we need the channel transaction. And we have to create it also with the conflict TX file program. And our channel should be channel one. And yeah. And we also use here the profile for this the sample single MSP channel profile. And this profile came also from the conflict TX YAML file, which I have shown you previously. So and then the artifacts folder. So now you have here your Genesis block and also this channel transaction. And then you can create the channel with the be a channel quit command. And then we can join the channel. And then we have to install the chain code. So and for installing the chain code, we have to follow the new life cycle chain code lifecycle approach or workflow. And that means that we have to package the chain code. Then we have to install the chain code. And then we have to improve the chain, approve the chain code. And we have to improve the chain code only for a single organization because we have only this sample organization. And then we can we can commit this chain code. But these are the same steps as you do it in a normal network here. Okay. So and here I have copied the asset transfer basic asset transfer basic example chain code. So we can look into this folder chain code. No chairs ATP. And this is the chain code here. Later, we will see a little bit more from this chain code so that we can see that this is also also running and working. So but here's the chain code. And then we have to package this chain code. And for no chairs, we have to specify the these option this line option with the value and note. So when you do it with the goal lang, then you don't have to use this because the goal is the default language. And yeah. So and for note and for Java, you have to specify here this option with and in this case, is it not for no chairs. And we give them a labor, you know, my chain code. Okay, so then let us package this chain code. And also to do this process you find in this in my GitHub, also a session where I have detailed explanations of how you can install back edge and come and install proof and commit chain code. And what is in this. So here we create an ATP target zip file. And what is inside of this zip file. Yeah, so you can look to the session and then you will find here also information what is inside of this chain code of this package here. And why is it important. Okay, so now we have this package here. And then we can install it. So simple beer life cycle chain code install. And we have only one peer address. So it's the local running and local. So this took some takes some some seconds until this chain code chain code is built. Yeah, so now we see chain code identifier. So and we need this identifier for later. So let me check it just the same. No, it's another one. So you have to copy this. So and I export here and environment variable. The only reason is we need this environment variable here on the start command of the chain code. And so in this way I can keep this line a little bit smaller. So that's the only reason why I put this in an environment variable. And we need this here in the in the proof step as well. And then we can start the chain code and to start the chain code, we move switch into this into this chain code folder. And then we can start the chain code. And this is the place where when we change our chain code, we can stop this chain code and we can start this chain code on this position every time. And then we don't have to do the whole approved process and also the install as an upgrade process when we change the chain code as we have to do it when we use this in a normal system. So when we use it in a normal favorite system, then we can install a chain code, of course, but then when you change the make some changes to the chain code, then you have to upgrade the chain code. And that's the difference between a normal network and this deaf network. And this position here, we can stop the chain code or simple control C and the chain code is stopped. And then we can start we start the chain code with this single line. And then we can immediately test what is the which effect has our modification on the chain code with a new transaction, for example. And yeah, so there is nothing special in the only special is thing here is that we have here the the fabric chain code stop command here. And that means that we have to install the fabric. I think the fabric fabric common package, the fabric network and the fabric network package. And with the fabric common npm package, then also and fabric chain code node program will be installed. And also this information is in the last in the session from end of January. Okay, so let me stop this now. Okay, and now the chain code is running. And then now we have a blocked window. So now we have to create a new panel here in this terminal multiplexer. So we can do this with control P and comma, not comma, quote. And now we have a split that panel here. And for the same, but we have to set the environment variables again here. And then we need to identify here. All right. So and then we have the two final steps here to finish the installation process. So our sample organization has to approve this chain code. And this is done with the command be alive cycle chain code approved. And with the package here. So yeah. And that's it. And we have here a valid transaction. And then we can commit it as a final step in this process. So and then we have this chain code committed. And since this, then from this time on, we don't have to do this approve and install stuff. We only have, we can only start and stop the chain code in this terminal here. And then we can make changes to the chain code to the notorious chain code. And then we start this again. And then here on this position, we can use the CLI or the notorious SDK to interact with this chain code. And when we test this, so we can use the PR chain, chain code invoke command here. So this is the standard chain code. So let us make a short look into this. This I will make a little bit larger. So very, very notorious. So too large. So and yeah, so the important parts here of the chain code is this is the index file here. And we have a package tracing file. And then a package tracing file we need here. Yeah, but that's not important yet here for the test scenario. So when we install this notorious chain code in the test network, for example, then we have to set here the start command. And here you see also this favorite chain code node command with the start option, but not with this option as we have seen prior here. No, no, now I'm wrong. So no, okay, forget it. This was my mistake. So and yeah, but this is the important part here that the chain code is also starting. And in this library here we have this asset transfer tracing file. And this is where the chain code here is organized. And we have here an init function. So this init ledger function. And this is the function we are going to call now that we have some test data into the into our blockchain. So we can do this. So we have to be a chain code command. And we have here the invoke command. The invoke command is responsible for sending something to the order. So make an to make a new asset or to update an asset. And the query command here is only sent to the peer. So and let us set some environment. And we have here some chain code data. And then let us see if this is working. And you see here asset one, blue, five, that's one. Let us check if the invoke also works. And when we query the a one key, then you see here the owner, the price value. So or in other methods, get all assets. So this is wrong. Why is this wrong? There's a small error. Okay. And you see here the asset. So now this is our starting point of this scenario. So now we have this chain, this net, the network is running, the chain code is running. And we can also query the new chain code with the CLI commands. Okay. Okay. So I'm alone here in this session. So because of because of the chat, so I will try to ask all the questions in the end of the session. So, yeah, so it cannot moderate the session, the chat and and the session here at the same time. So I will ask, if you have any questions, write the questions into their chat. And then in the end of the session, I will try to answer all your questions. Okay. So this is the part here. So this is our starting position when you see here. So now when you we are here now, we have a channel, we have a chain code installed and we have used here the CLI with the CLI commands, we have tested this chain code. So and this is working. And now we try to make this also make this one, this chain code also callable through the Node.js SDK. And for that, so okay. The first thing is we need a new, I put this in a new folder. So I call this your client. And we make an npm project npm init. So we need one favorite one npm package for for this test. So we need this favorite network and we save it into the package tracing file here. So this is also part of the preparation here. So this will take one seconds. And then we need the wallet folder here. And then we can try to create these connection approaches. And then we will create we will create this at the wallet tracing file. And then this index file, index.js file to start to interact with the network. So okay. That's it. We have this in place. And now we have to create this connection profile. So I have prepared this for you. Let me copy this. So okay. So as I have mentioned, the connection profile is you can have it as a tracing file or as a YAML file in the YAML format. And the file itself is nothing more than some information about the network. And when we have the discovery service running, then we need less information. But when we don't have this, like in this scenario, we have to name all relevant information here. And one of the important part is here, the organization. So we have to name the organization. The organization is SampleArch. So we know this because we have looked earlier into the conflict TXYAML file. So and then and there are the membership organization, the name of the organization is SampleArch. So and that's there. Also the information where this client belongs to. So then the connection, timeout, peer endorser. So that's a standard value. So you can take it as it is. The second part is we need some information about the channel. This block here, in this block, we have to define the channels. So we have only one channel. This is channel one here. And channel one has other ones. And the other one is based on the local host. So we can put here local host here. And we have peers. We have only one peer. And the peer is also on the local host. And we have to say some properties for this peer. We can say the distance endorsing peer, of course. And if not, then we will not make an invoke. Then we will make chain code queries. And also when we event source. So when we want to make a chain code where we use events, and then we have also to set this to true. So it's also good for the testing, for the developing. So in this block, we have to define information about the channel. And the channel name is important. Then the order position is important. And the local and the peers are important. So and that's it. So and then some information about the organization itself. It's the sample organization. The member MSP ID is sample ARC. This is also we have seen in the ConfitDX YAML file. And the peers, we have only one peer. This is the local host on the local host. And also the order. And here's important for the order. So and per the peers here in this block and in this block here, we have to define the URL for this order and for this local peer. And here we have to set on the right part. And in this scenario, we don't use a TLS. So we don't have to use the S here. So GRPC is without TLS. And GRPCS is with TLS. We don't have any TLS here in this development environment. And that's it. And this is the connection profile in a minimum configuration, which we need to interact with this test network. No, the board is not fixed. You can we have set this in the in the configuration here. When we start this, you can change the sport. As in any other configuration of a favorite network. Okay, so, and that is the connection profile. So, but we have to find this information. And we can just we find this informations through the ConfitDX YAML file. And to the knowledge that we have to name all these things in this config, this connection profile file, because we don't, we cannot use the discover results here. Okay, so this is the connection profile. And the next step is here that we have to create the add to what I've just found. I've created this. So copy this and paste it in. So in this file, the only thing what this file and the ass is that this file takes the certificate from the user and the private key from this user and put this to this local wallet. And the Node.js client can use this wallet ID to interact with the network. And this is one way to get an identity to this local wallet. And yeah, this is standard node, we need this to standard Node.js models, we need the file system and the path. And then we need the devolets object here for your favorite network module, which we have installed. And then we have here to define, we have to write the right path on our current location here. Since we have this in, we have a client folder. And then the parent folder, we have this fabric folder here. And then here's the path to the fabric and the sample config. And then you have here these admin certs folder and the admin certs PEM file, which is the sign in certificate. And the key file for this user is in the key store file. It's the private key file. And we gave them a name. So the identity label name could be any name. So we call this admin. And then we can create here a wallet object from this, this is a new file system wallet. So we can have different wallet types and the file system wallet is one of them. We can have a memory wallet system, or we can even have a couch TV version of this identity bullets here. And then we have to construct here an identity. So these are the identity credentials here, certificate and private key membership service provider. And the type is the is X five zero nine. And this is the standard type of all certificates. And I think only this type is supported at this time. Yeah, and then when we have this identity object, then we can put this into the wallet. And that's it. And here we try this, we wrap this in a try catch block. So if an error is it catches. And since this is an asset point process, well, we have here the init function. So we have a function. And when this is ready, then we can print here out that we have added some identity to our local wallet. And otherwise we have here and we catch the hour and write the trade stack here. So and if this everything is working, then so, oh, I'm creating a wallet, we need the wallet. And this folder is empty. And then we can say, okay, we call this note at two wallet script. And the identity admin successfully added to the wallet. And that means that we have now here and file admin ID. This is a JSON document. So the jku parser is very useful here on the side. So and then you can have here, you get a nice output. And you see here what, what this, what is, what is it for. So we have here, we read this certificate and bring it in the one liner and also the private key. So I think you can do this also by hand. Because the only thing what you have to do is you have to to bring the certificate in one line. And the breaks should be this backslash ends in this backslash end format. And the same for the private key here. And then we have this MSP information and discussion board. And then we have an identity, which is, which can be used from the Node.js SDK to connect. And that will be our next step. So for the next step, I need a new file I call this helper.js. And this index.js file. So the helper.js file has some helping functions for me. So I use this on several, in several examples. And the index.js is the final program file. So and then the helper file, we have here a method is called build connection profile. And, and build wallet, but I haven't used this here with the JSON string. So that is what you're formating when we receive and recite, then we can make a nicer JSON output with that. But the build connection profile here is important because it reads this connection profile JSON file. And past the only thing what this file does is it reads the connection profile JSON document here. Or if it's a YAML file, then you have to read it as a YAML file. And then we pass this content as a JSON and give this back. So this is what this helper function here is for. And main program contains this helper function and the depart module from the Node.js. And then here are some requirements for the, from the fabric side. So we need these wallets and gateways objects here. And we define some variables or constants here. So we need an, we have to set which identity we want to use, which channel we would like to use and the chain code name. So the identity is the admin identity. So that's the name, that's this name here. So the admin, the channel is the channel name and the chain code is the chain code name. So that's easy. And here we read the connection profile from the helper function. Then we create from the helper function this file system wallet here. So we have the wallet path here. And then we need the gateway. So we create the gateway. And the important part here is in the gateway connect method. So the gateway connect method needs the connection profile as in this case as a JSON document. Then the wallet information. So, which we have created here. And then the identity label, so which name admin in this case. And then this discovery information. And here we have to say, and it would false. So that's the part when you, when you use this in the normal test network, for example, then you can use your true. And then you don't need to define the channel and the order and so on. So then I think there's only some limited information needed, the TLS certificate, the, if you use the certificate authority and the PA information. And as local host true, that means that your system runs locally on the same machine. And this, it doesn't make a difference if this one in the Docker container or it's once in the primary version here. But the important part here that you say, and they will false. So that's the important part here. But if all that is true, of course, because then it's easier to get all informations for the Node.js client. And then with this information in place, we can create the network. We get the network from the channel name. Then we have the network. And then we can get the contract. And then when we have the contract, we are ready to go for our chain codes queries. And, and then so this is now my implementation here. So you can do it however you want. So I have, I have here some arguments, which I can import from the CLI command. And I say the command, the argument two are here is the method. So this is the chain code method. I would like to call. And the first is to get all assets. And then we can say contract, evaluate transaction, get all assets. And then we will receive the result here as an asynchronous process with the await here. And then we can console simply console log this here with the helper and position swing as we have seen from the helper function. And the same with the read asset. So I have also here an LSIPS block for the sweet asset functions. And we can also call the sweet asset. And we have here to name the asset, which we are going to read. And this is the name of the chain code metal. And you can to know what is in what is exactly, then you have to look into your chain code. And you see here, so this is the read asset. So this create asset. And you also update assets. So this is the standard methods you can find in this basic asset transfer example here. Okay. So let us read asset method. Okay. And then we have also created prepared to create asset and so on. And then we have, if you are finished, then we can disconnect from the gateway. And then we close the connection together. And that's all. And if this is working, we can try. So we call it a node index.js file. And then we say read asset. And what was it? I said one, for example. And you see, it works. But you see, it took a little bit on time because there is always a connection. Then it's the read process. And then it's a disconnect here. And also when we say, okay, create asset, this method create asset. And then we can read asset A5. Then you see, we have here this sunshine. And in this way, you can interact with this method. And when we want to make a small change to this, so we want to debug this a little bit more, more console lock. We can control big, zero. Then we switch. And now we stop the string code. With control C, we can stop the string code. And then we can make some modifications here. So maybe we want to read asset, read asset for the test. So now we have changed the chain code here. And when we call the read asset method, we should see here this modified text. And to start this string code, we, the only thing we have to do is we start the chain code again with this command. So now it's running. We can switch back with control B1. And then we read the asset again. And then you see here, read the asset for the test. And now you have, and in this way, you can change all the chain code, all your chain. You can develop the whole chain code step by step here and test every step, every single test, every single step. And so I think with that, you have a really good workflow to develop a chain code and to test it. And this works as well in Node.js and also in Go, for example. But in Go, you have to build the chain code before. But it's also a single keyback on your keyboard to build the chain code here. And when we look there, okay, so then we look here to the hstop command. If you see here, pnode that your peers are always running and control. And you can also leave this session with control B detach. And then when you come later back, all this is running into this subject session to make sure it's attached. So this one also. And then you can come back and do your work again. Control B zero. Stop your chain code. Remove your test. Start the chain code again. Switch back. Test your Node.js and you'll see read as that one. And in this way, you can use the Node.js SDK to interact with your test network and also the normal CLI commands, which we have seen before. So this is working as well. So when we tried to query read as that, this was a five. And you see the same result. But of course, this is a little bit faster. And that's the reason why in the Node.js application here, so you should make it's better to make an West API. And when this West API is running, then as long as West API is running, you connect only once. And during this West API, this express cheers, for example, is running, then you can call the API end points from this West API. And you don't have to connect every time, every request to their favorite network. So the connection is stable. And then the response will be much faster. And then it's here in this example, where you have always to connect. And the final part here is also you can, so if you have problems, then you can debug this. So and the Node.js SDK has a lot of has for the debugging levels here involved. And you can set environment, one environment where we're able to hear this, this hfc logging, and which this you can define here a logging level, when we see, for example, this debug, then we can set this here. So and then when you use this one, you see a lot of debugging formations here. And you see, so here we have the result. And then here, the gateway disconnect starts later. And you see here, there are a lot of debug informations, which could be very helpful when you cannot read the connection profile, when you're facing some error with the, with the connection, or with anything in there, in the, in the system in the Node.js client. And then you can use this. And you can see how far the program comes. And then you maybe it helps you to find the error a little bit more easier. So I think that's a useful information here. And you can limit this also to errors, for example. Then you can say here, so when you say debug, so you can say info running error or debug, and this is the, the, the method, and then the output here, where, where should this message up is printed, and then you can send a console, it's like this, or you can deliver it to a file. And when you say, okay, I have here the error, I want to lock the error, and I want to lock the error into the, into this error lock file. So no, it's also possible. And you can combine this. So you can make also this one. So you can say debug console error in this file. So like this. I think this will also work. So you can hide this. So sometimes it's difficult to leave this quarry, this quarrying. So when we unset this, then you can read off this information. Okay, so let's wrap up our session for today. So let's come back to this slide. And what you have seen here is how we can use an fabric depth network, how we can build this. So we have seen that we can use the binary versions. And we can let the order and the beer running in the background. We can see how we can monitor this with the jobs command or of H stop, for example. And we can use also this terminal multiplexer to control this. Then we have seen we can connect this with the CLI commands very easily. So that's the normal way. But sometimes you want to use also the Node.js SDK for that. And this is a little bit that comes with a little bit more effort. So and we need the main steps are we have to know what is the connection profile here. And we need an identity. And the identity is delivered from this sample config membership service provider file. And we have to convert this and the converting process is a simple or finish in a simple chasing document with the signing set from this user and the private key from this user. And with this information, we can create a small program. And then we can use this identity to we can use this identity and the connection profile. We need both of them to connect to the fabric test network. And then we can hear the two, we can use the evaluate transaction function or we can use the submit transaction function to interact with the fabric network. Okay, so I think I'm in the end of the session. If you have any questions. Hi. So there are a lot of comments. I will look to this. So I was trying to execute a lot of commands from the host machine, but I was able to I don't know. I haven't tried this here. So I have to maybe I have to test it, but on this I can give you an answer, I think. So there can so much. So for the CLI container is this gives me the point where I have to say the CLI commander is used in the 1.4 favorite question and not in the 2.2. So if you use 1.4, then I'm not sure how you can do this. But I think there will be a way. But this question, I don't I cannot answer it. I have a question regarding the concept stuff gets that function. Is it read the value from the word set or blockchain? Yes. So let us switch to this. So this is to get state here. The get state reads always from the word state. And the blockchain is the blockchain. With blockchain, you mean the history, the other versions of an asset. And for that, there's another command where you can query the history of an asset. But the get state gives you always the word state. You reverse it from the level to be database or from the couch to be database here. And this is always the latest, the latest version of an asset. Yes, get set returns the value of a specified key from the ledger, but always from the last, the last state of this, of this asset. Ledger is worth that in blockchain. Yeah. Just so, yeah, I don't know. So the word state. So when we talk about an asset, so an asset is an element in this fabric blockchain. And to get the information very fast, in hyperlink traffic, there is a word state. The word state is represented in the database. So in the level to be database, or in the couch to be database. And all these queries goes to the word state. The word state is also the latest state of an asset. And when you talk about the blockchain, then you mean the ledger, for example, or also the ledger. So there's, I don't know, we have to look what is the right term for that. But it's easier to understand that we have in the word state the last version of an asset, and all trio versions of an asset, the history of an asset is stored into the blocks, into the blockchain, into the ledger. So the boards, I think the boards you can change, you know, 70, 15, 70, 51. So these are standard boards for the order. But when you define the order, you can define part of your own. So for that, look a little bit into the Docker Compost, Docker Compost, YAML file, Docker Compost files in the test network. So in the test network, you find also configuration from where you use the raft ordering system. And then the raft ordering system, you can have more than one order. And then you can see how the port numbers are organized. But you can use here every port number as you want. So because to connect to this peer or to this order, you have to you have to name this port. So you have to name this in this, in some environment variables. And as long as this environment variables match the part of the peer or the order, then you can use this ledger is combinator. Okay. My first time attending is me. Thank you. Yes, you know, so you have here a playlist. So we have on the Hyperlature, on the official Hyperlature channel, we have a playlist from Hyperlature Sweden. And there you can find all the videos, all the recordings. Awesome. I would like to introduce myself, Chris Gavril in the room and talk about the fabric docs workroom group and invite everyone to get involved. Yeah, that's cool. The get history for key function is really interesting. Yes. So and that's the answer from for the get state for the get state. So they get history for key function. This function gives you the history of an asset. And the get state gives you the last state of an asset, the so-called third state. Okay, so are there any other questions? Okay, so yes. Please tell me your question. Differences for the connection profile when using certain authority. A good way to see the differences is when you start the test network, then the test network create for the organization one on the organization two. And for every new startup and new connection profile in the JSON and in the YAML format. And when you start the network, these connection profiles will be created dynamically. So when you when you test this test network, and you start this test network, then you can look into the folder crypto config organizations, and then you find the folder organization one and the organization two. And there you will find this connection profiles generated from the boot process. And in this, you will see also how you define the certified information to this connection profile. And with this file, you can see and learn how you have which information, which properties and which values you gave have to have to give to this connection profile and to see, and then you can see what is needed to define this. I think this is a good way to see how this works. But you have to start the tricky part is you have to start the test network. And when you stop when you when you when you stop the the test network, then all the material and also the connection profile will be deleted. And then it's gone. So you have to start it. And then you have to look into this folder. And then you will see in the folder for the organization one and organization two, two connection profiles, one in the JSON and one in the YAML format. Okay, for the certification, do we have to use the local container? I don't know. I don't, I don't know for the certification. So I think normally you have to the certification is on Fabric, I think Fabric 2.2. And then the documentation from Fabric 2.2, there isn't any information about how you use the development network and how to use the, I think the binary information. So this started in Fabric 2.3. I think you have to use the Docker container, but I cannot say that I don't know. So I don't know, which I have, I don't, I don't found, I haven't found any information about this. So, but I think the normal ways to use the Docker container, and I think in this way, should also the, the certification. Roland, I don't know the specific answer to that question either, but I do remember that we had had somebody from the hyper or from the Linux foundation training team come and present to the Sweden group a while back to talk about the training and certifications, so that if people are interested, that recording is also on YouTube in the Sweden playlist. Yes, thank you. Thank you for this information. Okay, so I think you, the question and the deco and they are now finished. So if nobody has any question here, so you would like to come into the session now, if I understand this correct? Yeah, yeah. So hi, everyone. My name is David Boswell. I work at Hyperledger. I also want to introduce everyone to Chris Gabriel. We, we are involved in the hyperledger fabric documentation working group. And I thought that there would be a lot of interest in that group with the people here. So, you know, like everything at Hyperledger, the fabric documentation is an open source effort and anybody is welcome to get involved. And it felt like this group would be interested in that, you know, I think you obviously are interested in technical information about hyperledger technologies and there probably are places where you would like improved documentation or new documentation. So, you know, we just wanted to talk a little bit about that group, invite you to it, you know, we always welcome your input comment contributions. And again, if you're wanting better improved or more documentation for the, you know, the content you're wanting to, you know, review as a group, you know, the group that the fabric documentation working group could be a really great place for that. So, Chris knows much more about it than I do us. I'll let him kind of give an overview, but I just wanted to say hi. And I'll drop a link here in the chat to where you can find out more about what Chris will be talking about. So, hello, everybody. Nice to meet you. Can you hear me okay? Yes, Nick and you're very nice to meet you all and very interesting presentation, by the way, Roland. This is my first time seeing your group here and very well done. My name is Chris Gabriel. I am a volunteer contributor to the documentation working group. I've been involved with the groups since almost the very beginning in 27 late 2017. We've had some turnover in the group and we're hoping to recruit more members. So, we are looking to other established groups in the community to maybe come in and share their knowledge. And there are very good instructions on how to become a contributor to documentation on the Fabric website. David can link to it. It shows you how to set up a GitHub fork for Fabric and how to contribute documentation step by step, creating pull requests and the like. So, just a quick short introduction and a pitch. We recently started to meet or decided to meet every other Friday. So, we had been meeting every week, but a lot of the document heavy lifting had been done on version changes, but there's still much more work to do. An example of that would be, you may have seen there is a change in the Fabric GitHub repo to rename the master branches from master to main. So, if you think about everywhere in the documentation in code snippets, we reference in instructions a master branch. Now, we have to go back and re-document all of that stuff to main. So, there's an example of how other groups can come in and help clean that sort of stuff up and any help is greatly appreciated. And if you're just not sure how to start or how to contribute, the best thing you can do is join our weekly documentation call, ask questions. And we also do some technical demos during that call. I am the founder of a blockchain company based on Hyperledger Fabric. We do a lot of work in a node SDK. And we have working applications and use cases that we have the APIs written for and the front-end Angular apps for the UI. So, we do a lot of demos around that as well, not just total documentation. So, anybody who's interested in that, please feel free to drop by. And David, I think, dropped a link into how to contribute. And David, if you could just put the meeting link in there, that would be great. Yeah. The good news about the meetings is they fit really well with when you're meeting regularly too. So, they're every other Friday at 8 a.m. Pacific. And I just dropped a link to the Wiki page where you can find more details about the meetings. We book an hour for that meeting. Sometimes it doesn't take that long. So, and if we go every other week, it's not a huge time commitment. But to me, how I learned Hyperledger Fabric really good was to become a volunteer in the documentation work group, because no better way to learn it than if you have to write the instruction manual for it. So, thank you. Appreciate the time. Yeah. Thank you for your input. Yeah. So, I think, by my side, I have to say documentation is very good. And I think also for the certification. So, I think to pass the certification, you only need the documentation, the official documentation. So, you'll find a lot of useful information in and also the examples. And I think the switch from 1.4 to 2.2 with the new test network, this is really, really good because you can with a single command line, we can start in the new Fabric 2.2 with the new 2.2 test network. We can start a lot of different scenarios to test and to play with. And this is really, really easy. And I think it works every time. So, it doesn't matter if you want a Fabric network within certified authority or if you want culture to be, for example, so you only have to use the proper key for that, the option for that. And then the network is starting, then you can try and play with that. And that's, I think that's an improvement to the 1.4 version because the 1.4 version was a little bit more difficult to use all the different situations. And that is really good also for starters. And in my session here, I can use a lot of different scenarios with the new network and you can start it with any effort. And that's, I think it's really cool to test and to use and of course to learn of also, and also the background scripts are very good documented so you can learn from this a lot and to see how the things work together and then you can take some snippets for your own project, for example, or learn or modify it in your own way. So, I think the 2.2 version are really good. But one question I have, so why you find the documentation through the DEFIN network here that appear DEFIN network only in the 2.3 version and not in the 2.2 version? So, if I understood you correctly, the difference between 2.2 and 2.3 is, can you repeat the question again? We have here in the documentation, we have here a 2.3 version and then this 2.3 version, we have a tutorial for the session today, one in chain code in DEF mode and this tutorial is not in the 2.2 version. You can find this only in this 2.3 version. So, the question is why? That's a good question and a lot of the people who were helping do this have left the group recently, so I would have to go back and investigate that and get back with you. There are some features available in 2.3 that are not available in less than 2.3, like the OSN admin channel join for joining the channel for the new process and so that would not be available in any of the other branches. In some cases, it was written and not backported to the prior versions, that's usually the number one reason why it doesn't make it in there. So, it's usually pushed to the latest branch. But this is working also in the 2.2 version, so I used 2.2 version and this is also working here. Under the documentation, you will not find this. So, most of the users use this 2.2 version because it's the long time support version and it's not so clear why this chain code DEF mode is only on this 2.3 version here listed. Yes, I will have to go back and look at that and to answer that question. I don't know the answer right now, but I will look at it. Okay, yeah. Is there any question from the group? So, if not, thanks for the attention. And in the next session, we will move forward with our way in the Node.js development and then we will use the test network. And with this test network, we can start then favorite CA and then we will see how we can use Node.js and interact with the favorite CA and can make some maybe asset paste the chain code examples where we can query some different properties from the user and then we can make a little bit more about the permissioning from the chain code site here. And that's the, yeah, I think that's the plan for the next session. And then maybe a short announcement. My colleague from Hyperledge of Budapest has announced also a session about favorite CA and that will be in April, I think. And maybe I will post about that in the next session, the link. And this could also be interesting for everyone here to see a little bit more about, or to hear a little bit more about the favorite CA. But this will be more from the administrator side. And my part here is a little bit more from the developer side from the chain code site. And maybe this is a good fit that Daniel will show you more from the administrator side of the favorite CA. And I will show you a little bit about the chain code side from this. Okay, so thanks for your attention. And I hope we have a great session today and we will see you next time. Thanks everyone. Bye. Do we just stay on here or do we have to leave and come back in? No, we can stay on. Hello.