 Okay, so hello and welcome to this hyperledger Sweden meetup to this tech study circle. And in this meetup, we will make a journey to the internal versus external chain code. So what does it mean? In the last session, we saw a little bit about the new chain code government and we saw how we can install chain code and how the process has changed from version one to version two. And in this session, I would like to show you a new way. And this is a new feature which comes also in the version two and is called an external chain code service. I think one participant has asked for this feature or for this thing and that would I would like to point out that if you have any questions or you would like to see a particular topic, then you can drop me an email or write it in the Slack channel or whatever. And I can see I can bring it in to this series and we can discuss about this and I can show you how you can do this. So the whole series is from the community to the community and it lives also from the community. So I like your feedback and you can say what you want and then we can look how we can make this possible. And on the other side, you can also try to make a session. And then we can arrange one session, I think. So there's one question to the slides. To find the slides in the chat a little bit below your comment. And I think I have done a test for the voice. So maybe it depends on you. So as some of you know me, my name is Roland. I'm happy to be your host for today. And I can tell you something about the new external chain code feature today. And as to start, I will give you a short overview, one short theoretical part how we can do this, what is the difference between this external chain code service. And this is a little bit of an advanced feature. And we have to do some specific tasks to get this running. But on the other side, we can see also how the traditional way is working. And this is a very good part to understand or a very good way to understand how Fabric works with Docker and how a chain code container is built and so on. And there are some steps to do and I will guide you through the steps. One important part in this new service is something which is called buildbacks. So maybe some of you have heard of this or used this technique. So this is a technique which is related to container technology and I think a really handy way to build your containers. And this example shows that Hyperledger Fabric is a technology which uses a lot of technologies around a lot of cloud-native technologies. And you can use these technologies as well, not only in the Hyperledger Fabric world. So you can only use it for your own development. So if you are familiar with Node.js, you can use Node.js. And yes, yes, yes, recording, recording, was there any chance of recording this call? Yes, it's recorded and will be published on the Hyperledger YouTube channel later. And yes, buildbacks is one way to do this dockerization or containerization. And I will show you in the end how we can do this if you have time enough. But buildbacks are part of this scenario and that's the reason why I have given over a few of buildbacks and then we can see how we can use buildbacks with the Google Cloud Builder, for example, to build our Node application, for example, or our Go application or whatever. And yeah, then in the hands-on part, so we are going to set up the new test network for this scenario. And we will look a little bit more, we will learn more about the test network. So we will look in the script folder so we can use the script to change between the organizations. So and I will show you how you can do this and what is important in this step. We will also look into the docker-compose file for the first time in this series. So that's a good point where we can look in this docker-compose file because we have to make some changes in this file and then we can, I can explain what is this docker-compose file for and what are the relevant parts of this. And yeah, and we have to look into the so-called config or core yaml file because we have also, I have to make some changes in this file. And then we are going to use the external chain code service, but we will make it twice. So we are going to make an example with an external chain code and then we will compare it with an internal chain code so then you can see we can have one ledger, one channel and on this channel we can install a chain code with the traditional way I call it internal and an external chain code which is used with an external chain code server. And yeah, the agenda you can find here as well for this meetup and for the upcoming meetups. Here are the links, the support link as well, all the sources are on this GitHub. So I have posted this link as well in the chat and here we have the documentation which you should read or study. And then here's the link to the buildbacks which is this, it's called, you can say it's a standard and with this standard you can, you can, you find some learning resources and you can study it and you can see how you can use it for your own purpose. And this is the short overview of what we are doing today and that's our test network and you see here the same scenario as we have seen in the last session and we have two, the test network is an organization with two peer organizations and each peer organization has one peer and we have one order organization with a single rest ordering system. And then we have a lecture which connects these organizations together. And then we have a channel, this is the my channel or channel one here. And then we will install two chain codes here, both chain codes we are now already. So the AB store, we will use the AB store to install it in a traditional way. And then we use the asset transfer basic chain code and see what is needed to use this external chain code feature. And in the end, we will have this scenario in, in our network. So okay, internal chain code versus external chain code service. So, and I think the first sentence here keeps it to the point, instead of building and launching the chain code on each peer, chain code can now run as a service whose life cycle is managed outside of fabric. So this sentence is copied from the official documentation and I think that keeps it really to the point. Then the chain code is run in a single container. So when the peer, the chain, when the chain code is installed on one peer, then the chain code will execute it and when the chain code is executed, it will execute it in a, in a, in a, in a different chain code container. And in version one, this, this was a fixed process. This is hard coded in the, in the system and you can't change it. And this is a requirement, which came in and in version two, they have launched this feature and they use decoded external pillar and launcher. And one of this feature is this external chain code server. And what does, what does it mean is that the chain code is, is not longer started directly from the peer, you have to start it by your own. So you can control the life cycle in the, you can control the life cycle of this chain code container and, but this is an, as I've mentioned, an advanced feature. And for this, you need also, I think for me, a specific use case. So maybe you can use it, you find the use case for this. So, but I think that's not the normal use case. So you, you must have a use case where you can use this scenario. So because it is a little bit and overhead to do this. And yeah, so in the documentation, there is a point when you use a fabric in a Kubernetes cluster, then it's a, maybe that's a good choice to use this for, for the chain code and, but in theory, it's like we have one chain code container running now and both peers can use this chain code container and execute the chain code. And in a traditional way, you have every peer has its own chain code container. And as we have seen in the last session, that the chain code container is started and when the same chain code container is started, we can see, we can see the container and we can, we know when this container is started and build it. And in, when we have a chain code server, and that's also an important part. So you have, you have to know that when you use this new service, then you have to adopt your chain code as well, because we need a chain code server. And that's maybe a little bit of a restriction. So I think that it's only possible with go chain code at the moment. And the shim API has this capacity that you can have a chain code server. And with this chain code server, this will work. So when you, when you would like to use the service, you have to change a little bit your chain, your chain code. And you have to use go as the language for this. But we will see what we have to do with what we have to, to, to use. And what are the steps which we have to do? So the process is basically the same as we have seen in the last session. We have to, first, we have to package the chain code. But here we have a different, different. So that's without the chain code. As we have seen in the last session, in this package, there are some files. That's entire GZ file and there we will have a meta file. We have, we will have a connection chasing file and we will have the chain code as well. And in this, when we package this, we don't need the chain code because the chain code will, will be built in a separate container and will be started in a separate process. So that's the difference in the packaging process. So we don't need the chain code in the package, in the first step. Then we have to make some configurations. And we have to modify, modify this core.yaml file. And we have to include this file. So we have to override the default yaml file with these settings. And for this, we have to look into the core yaml file. And there is a file which will come with the favorite samples. And we can use this. And then we have to paint, bind this in the Docker Compose file as local volume so that we can use it in the, in the peer container. So that's the reason why we can dive into the Docker Compose file. So we have to modify two things, the core yaml file. And then we have to adjust the Docker Compose file so in a way that this is working. And then we can, we have to look a little bit, but we, we don't have to change anything. So we can use the default example for this. And we have to look into these launcher scripts. So this external builder and launcher are basically some scripts. And these scripts detect what is, what is your source code for. And then in the end, it will build for you a container. But in the, in the, for fabric, this is a little bit adopted. And so we don't need to change so much in this. So we can only look into this and see what it is, what it is for. And then we have to change the chain code as well. So the differences is in the main function. We will see it a little bit later. So it's not really difficult, but we have to do it. And then we can deploy the chain code. And that's the same way, that's, that we will, that we will be doing the same way as we have done in the last session. So we have to install it, we have to improve it. And then when the, when the, when the majority of the organization have improved the chain code, then we can commit it. And then the chain code should be ready for the invoke and query commands. And of course, we have to start this external service with, yeah, and we have to read by hand in our case. And yeah, we can test it also. When we stop this container, the system will not work. And when we start this container, the system will work again. So you can start and stop this container. And yeah, so these are basically the steps which we are going to do. And these are the chain code comparisons. So the normal chain code is in the main function we have here in the first line, you can see the important source code snippet. So we have here the new chain code command. And we have, we have it also here. So, and the only difference in this, that we have to use this chain code from the shim package, the chain code server object here. And then we have to deliver some properties to this, to this object. So the chain code ID, this is also something we have seen in the last session. This is the package ID or the chain code ID, which we will receive when we install the chain code. And then the address, this address came also from the package process. We will see it a little bit later. And then the name of the chain code itself. And then this is the part where we have, when you use, when you would like to use TLS, then you have to set here the TLS properties according to your network. And here's in the first line here, this is the server config object with the environment variables chain code ID and chain code server address. And this information will come from the chain code environment file, which we will see later. So, and with this, you have a bridge. So we have an environment file. And then this environment file, we will define these two environment variables. And in the chain code, we will read this environment files here in this config object. And then it will deliver it here to the chain code server. And that's it. So these are the points. These are the points we have to modify when we would like to use our chain code as an external chain code service. So, and the main thing is here that you cannot use your standard chain code. So you have to modify it and you have to do some things more when you would like to use the TLS here for the chain code server here. And we will see it later also in the chain code. But here, this is the main thing here, what you have to change in the chain code. So this is a short side note on what are buildbacks. I think, I mean, that's about it's not so related to fabric, I think. But I think that's an important part that you understand and that you see that fabric is a technology which consumes a lot of standard technologies and built a new thing that is called fabric. And the buildbacks, I think that's a good way when it comes to build when you work with containers. And then you have to create these containers. And you have to find a way how this container you can create this container in efficient way, how you can create secure container in efficient way. And the buildbacks can do this for you. And for me, the most exciting part of this is the possibility to rebase an image. So that means that when you have a container image, then you have an underlying operating system. So you need an Ubuntu, you need an Alpine Linux, you need the Debian Linux or whatever. And then you can, on this container, you will have your Node application running, your Go application running, your PHP application or whatever your database or whatever. So in every case, you need an operating system or parts of the operating system in this container. And in some times, you have to update this. And with the rebase, you can do this. So you can update the container, only the base image and not your application. So I think that this is a good way to do this. And yeah, so this is also from a bullet points from the documentation. So the only reason for buildbacks is to create run-able application images directly from your source code. And that's also an interesting part. So when you use, for example, a Node.js application, in this Node.js application, you will have an Express web server. Then you have to install with MPM some packages, Express and other packages. And the buildbacks do that for you. So they do this, do all the stuff, they do the MPM install and installs the requirements for this application and build your app. And that's a good way to do this. So, and yeah, the result is an open container image and OCI image. And this is a run-able image for any container platform. So in my example, I will use the Google Cloud Builder and for this, and you will see that's really easy to do this in this way. And so they say the main focus is on writing code, not the containerize it. So that's basically a point for developers. So when you write some code and then you need the container for this, then, and you need the secure container for this, then you can use this buildback technology. Yes, and here in buildback, as I've mentioned, the buildback model has been a little adopted to the chain code packages. And, but you don't have to install anything for this. So everything comes with the favorite examples. Only when you use it for your own, for your own examples, for your own purpose, then you have to install these pack packages. And, but I will show you later how you can find this and what you have to install. But for, in the case of fabric, you don't have to install anything to use this. Everything is done with the favorite samples. And the rebase, that's, I think that's for me, the interesting part that we can update the underlying operating system, a Debian or Ubuntu system. And yeah, so I think that's a cool process. Yeah, and then here, short teaser. So when we have time enough, then I can show you how we can build a Node.js application with the Google Cloud Buildpacks, for example. So because they are called the new. So I think the last week or two weeks ago, they have announced this feature. And I think so we can have a look and how this works with that. And yeah, here we will have a short slide, how this Buildpacks concept works. Here for a general application. So when we have, we have a Node.js application. So that's the point of view from a developer. So the developer develops a Node.js application, for example, and the aim is that this application should run in a container environment. And then he has to create a Docker container, for example. And with this Buildpacks, you can do this in a very easy way. And this Buildpacks, yeah, in the first step, could, is need a build image. So the build image is something like an Ubuntu, for example, or an LBN or an Alpine Linux or whatever. And then they have these Buildpacks. And this is called the first step, the first step, the build image. And this Buildpacks is, as I've mentioned earlier, a set of scripts, which is available. And it tries to analyze, inspect your source code. And from this information, it tries to formulate a plan to build and run your application. So when it comes to the Node.js, what does this mean? So that's a nice sentence, but what does this mean? So that means that when we have a Node.js application, this inspect, in the first step, he is looking maybe for a package.js file. And when they find the package.js file, they say, okay, that's a Node.js application. And then install this MPM, this package. This package.js file. And then the builder, means that is a Node.js application and builds this application. And then in the end, we have an application image, which can be used as any other Docker image. And then we have this one image here and we have this application. And the one image here is our build image when we say build image here and the build image is also in the new image. Then, and then on top of this build image, there is the application and that leads to the final one. So, and the rebasing is a process that we can change the build image here. And, but we will not change the application code here. So, we only change the underlying image here. And this is maybe a newer version of a Ubuntu or a newer version of a Debian and so on. And when it comes to this Google Cloud example, I think they use this for their Cloud Run platform and with this, you can, and they use an Ubuntu image, for example, and then they fix all the security vulnerabilities which come from time to time. And with this rebasing, we can make it sure that we have a secure underlying operating system and we can automate this for the container. And this leads to a new version of the Ubuntu and this leads to a new one image in the end. So, but the application itself will not be affected from this process and it's also a fast process here. So, I think that's an interesting concept and many, and this is used in many larger applications. So, it's definitely, it is worth to have a look in this and see how you can use it for your own purpose. Okay, so I think these are my slides here. And now we come to the demonstration. So, okay, as I've mentioned, we use the same test network as we have used last time. So, and this test network contains two organizations, two B organizations and one order organization. And we can start this with the test networks, with the network script as we have seen in the last session, in both session, in both last session. So, from this point here, everything is the same. So, we can use this network, network script and boot our network. But before we can do this, we have to do some small modifications. And the perfect samples has a small, has an example and this example we are going to use now. And for this, this example we'll find in the asset transfer basic folder and there's a folder chain code, chain code external. And we're going to look into this. And there's an folder which is called chain code external. So, okay, we can delete here. So, this is from a test that everything is running. And this is the folder from the favorite samples. And the first step is that we, one important part is this connection JSON file. So, this connection JSON file will be part in the package process. So, and we can look into this connection file. So, the only thing what is here interesting is the address. So, and the address for this is this one. And here's a timeout. So, for example, we can leave this as it is and we don't have to modify this file. And the second thing is the chain code environment file which I have mentioned before. And here we will have two environment variables. One is the chain code server address. And you'll see this is the chain code server address. So, when we change this server address in the connection JSON file, then we have to change it as well here. So, and because we use, so we can use this standard, this standard example for our purpose. And the second thing is that we have here the chain code ID. So, and this is the chain code ID which we will receive when we install the chain code as we have seen in the last time. So, the first part here is the chain code name. And the second here is the hash value of the installed chain code. And these environments, wherever we have to modify and to see that this is the right chain code ID. Because we need this environment file later when we start the chain code server. So, and the metadata JSON file is the next file we can look into. And here, the only thing what we have the type here is external. So, that is the marker that Frederick knows that's an external chain code. And the label here is the name of the chain code. So, our chain code is called basic. And that's the reason why here, the label has the value basic. And these files are important for us. And the first step is that we package this. And the result of the package process is this file. This is a transfer basic external tar reset file. And, but we don't need the chain code now. So, the chain code is here. So, this is the asset transfer code chain code here. But we don't need it in the first step. So, we need it later when we create the Docker image with this Docker file. And then in this chain code container in this Docker container, the chain code will be installed and also all dependencies. And because the chain code should run as an external service and should not part of the fabric in this scenario. So, okay, so that we can use this tar command to create the same structure as we have seen in the last session. But now we do it by hand. And the result is these asset transfer basic file. And this is the, and this is the package chain code which we are going to install on the peers later. And yeah, so I have copied the chain code environment file in the test network directory. So, I don't have to switch between this directories every time. So, okay. And then we are ready with the package, with the packaging. The next thing is we have to modify this config file. And this config file will be delivered from the fabric samples. And for this, I will switch to another. Visual Studio terminal. And in the fabric samples here, we have a folder that's called config. And there is a folder, there is a YAML file. It's called core YAML. And then this core YAML file, as it is packed here, is the original one. And online file 549, there's the part which we are interested in. So this external field does. And here we have to do the modification. But let me point to this brackets here. So I think this brackets are wrong in this file. And because it's a YAML file, and I have to remove it, and I have changed this to this. So in my scenario, it doesn't work. With this brackets here. So maybe that's wrong here, because this file is copied only for this fabric samples. And you will not find this config directory on the official GitHub. So when you look at the official GitHub, where you can download the fabric samples, then you will not find this config directory. So this will come through the installation process. And also with this config.exe YAML files and the order YAML file, for example. But I think we have to make these corrections here. So 549 file, so, okay. And yeah, and this is the part, the external field does. And we have to do two things here. We have to define the path where the external fielders files are located. But be careful here. This is not the path on your local machine. So this is the path in the container. So in the peer container. So we have to be careful and look when we mount this local fabric samples directory, we have to mount it on this position here. And yeah, but we will see it then later. So this is the first thing we have to do. And the second is we have to give them a name. So, and this, I think that's only for logging, external sample builder. This is, yeah, default name. And these properties here, we are not needed now. So because we don't need, in our scenario, we don't use the TLS for the chain code server. And that's an interesting part. So I have to say, I haven't figured out how we can do this now. So if you have time, then you can make your hands or your finger dirty and find out how you can set up the chain code, the chain code server with the TLS configuration. So for that, it was too less time for me to figure it out. And I never find any example in this direction. So maybe you have one or you can give me good link to a direction. But this is a point I didn't find any solution how we can do this here. But yeah. And yeah, so this we have to do here to get this one. And yeah, that's this one. So, and then we have to modify the Docker compose file. And that's the first time we are looking into this. And so that's an important part. And that's also a basic part that every fabric user should understand how these Docker compose files are organized. And as you can see here, we have a typical composer file structure. So we have here in the first line here some volumes. So we have a volume for the order for the peers and for the peers for peers zero from organization one and organization two. Then we have this test network name and then we have three services. And that's a big difference between the version one because we have only one order. We have this order right here. And we have only two, we have only one peer for each organization. And we don't have any NSE like container here because we don't need it anymore in the version two. And when you look into this order configuration, you will see here some important points. So these environment variables here will be overwrite all values in the core YAML file which I have shown you some minutes ago. And this is very important especially for the TLS. So here you can create TLS. And but we have to use TLS here because it's in RAFST Ottawa and RAFST can only work with TLS. So TLS must be enabled here. So when you use version 1.46 or 9 or something like that then you can have as for your test scenarios and for your trainings. You can use the solo order for example and the solo order doesn't need any TLS. And with this you can reduce a little bit the complexity to focus on specific tasks you are going to investigate in this part. So, but here is an important part. So all environments variables here and this environments variable overwrite the values in the core YAML file. And as I've mentioned last time, so the naming here and the art of writing this environment variables is a little bit different to the core YAML values and properties which are in this file. So, but this we have to discover in the other session or in the separate session. Some environment are very, very, for us it could be important. So this is an important one. So this log logging one. So here you can use a debug for example, then you will have more outcome on the console for example. And yeah, then we have a debugging directory. So I think that is pretty standard. You can, we can use this as it is and also the parts here. So be careful with the parts. And then what we have here to look is the volume. So you have to see here that the order needs to be, have to be accessed to the Genesis block. And we have to include as well the membership service provider here. And so that's a really, really important part of what is a membership service provider in the world of fabric. And we will spend one meeting, one meetup especially on this one. So, but that's an important part the membership service provider. And every organization has its own TLS folder and that's also an important part to understand how TLS is enabled and functional and drugs in the world of fabric. So, especially when you have a mutual TLS or do normal TLS. So, and this is also in part where we are, we should make and meet up only on this topic. So, and because it's a little bit difficult to understand for beginners how this TLS works and what is the difference between this mutual TLS and the normal TLS. And then you will see here an important part. So, you hear what you can see here production. So, that means that we will have a persistent network. So, and with this, with this configuration here you can make your network persistent. And that means that when you tear down your network then the data will restart and will not be deleted. But not in this scenario when you use the network networks when these networks script and network down then everything will be deleted. But this is not, it depends not on this volume. It depends on the script which tear down the network here. And in the peer section, it's basically the same. You have also here the environment variables you have the container names and so on. And that's also important when it comes to a point where say, okay, I would like to get rid of this or one example.com. So, I would like to have my own organization name here. Then we have to rewrite this container names the service names and so on. So, and yeah. But be carefully with that. So, when you start with this then you have to know what you are doing. And you have to change a lot of names. So, as you can see here, then you, so it's really, really a lot to change here. When we would like to change this domain names here. It's a good idea to try to write a script which replaces this container names. So, then because there are some many points we have to change here. But yeah. So, here also the debugging. So, here you see the debug route. So, you can say, okay, we want this log level or we want another log level here. And then in documentation, you'll find also other log levels. You have also here the TLS configuration and so on. So, and one important part here is we have to, when we use this external chain code server, I think we have to commit this out here. The chain code address and the chain code listen address. So, in my examples, so it won't work when I have this an average. And that's the reason why I have committed this out for this demonstration. And yeah, and here we have our modification. So, for the external chain code launcher, for this external chain code service, we don't have to change anything here in the order section, in the order service here. We have to change here the volume and add this volume. So, we have to add the favorite samples. And we have to add the, we have to override the core YAML file with our file which we have modified in the configuration directory. So, and these two volumes, we have to modify here. And then we have to commit out the chain code address and the chain code listen address. So, but this I'm not really sure. So, in my case, it works. Okay, so, and the same we have to do here with the organization too. It's basically the same. So, that's here and in this way. And yeah, so, and then all the different is here that we don't have this pace PIA files, this pace PIA YAML files. So, in this, in the Fabric two examples, everything is here in this Docker compose file. And this also a change from the version one to the version two here. Okay, so, and these are the modifications for this Docker compose file. Yeah, so, this is this. And then we should be ready to start this network. And this is an important point. So, I would like to recommend when you try a lot of you use Docker system prune in front of this. And this is a good and easy way. So, when we call this, so we will stop our containers and networks and so on. And yeah, so we have to make sure that we have not some unused volumes and unused image container images and so on. So, it's really important that you start with a clean installation. And to look, if you have Docker volume, for example, volume less, you'll see, oh, we have here Docker volume. So, then we should Docker volume prune. Okay. And then you can also look if you have any network. So, these are the default networks, that's okay. But this is an important part. So, that we take care that every Docker image, every volumes are cleared. So, sometimes you will have a problem when you start the network because of a wrong Docker volume. And make sense to look to clear everything before you start a new try. And then we can start the network with the network script and the up command and with the create channel. And we say in our case, we say it's the my channel as it's like the default channel or we can give it another name, channel one as we have seen in the last session. And with this, our basic network will start. So, as you will see, everything works here. And we can check when we say Docker PS. So, we see now we have one order running and we have organization two and organization one running with peer zero. So, okay. And then, the third examples comes with some helper scripts. And when you start with that, it's very handy to use it. So, there's an environment was script which provides some environment, some shell functions. And one of them is this set globals. And with this set globals function, we can easily switch between the organization one and organization two. And the last session, we have created our own environment file and we have copied some of this environment variables to this file. And then we have executed with the source command. But we can use it, we can use also this environment variables and this file and this scripts. So, to use this, we have to execute this script and then we should have a set globals here. And one thing we have to do is, we have to set the favorite conflict path and this is from our position. We have to, and from this point directly to it and to this conflict path. And with this, we can switch between the organizations now. And when we are going to install the chain code for the organization one, then we have to be the organization one. So, and this is done with these environment variables. So, when we say, okay, set globals and with one, then we are using now organization one. And that means that when we might print and grab core, so, and you see the environment variables, the local membership provider ID, the PR address, the TLS root certificate, membership private conflict directory, and the TLS is end of it. And these environment variables with these paths gave us the right possibility to access an admin in the organization one. And this is a script, which will come with the favorite samples. And that's an easy way to switch between organization one and organization two. And when you use the or try the example where you're going to extend the network with another organization, the organization three, then you can use the script as well for the organization three. And now, yeah, so, and then, so I have to look if I'm on the right position, if this is right. And the first step is now we have to install the chain code, yeah. And now we are going to install the chain code, which we have packed before for the organization one. But notice that this installed process is now without the go chain code. So, and then you'll see that's pretty fast because the chain code container is not pillared in this process now. And when we will use the traditional way later, then we'll see this process will take some seconds because the chain code has to be pillared and it takes some time. And here you can see this identity code identifier. This is that what we are looking for. So for our environment variable and for the environment variable. So the chain code name and the hash value of this. And but we can use it with the, we can get this information later with the query installed parameter as well. So, okay, so organization one is done. So we are going to do this with organization two. And then we have to switch to it. So check it again. So, and you'll see we are now the local service provider from organization two and the paths are also changed to the TLS and to the admin from the membership service provider from the administrator from the organization two. And that's the user which is allowed to install a chain code. So only an admin user is allowed to install the chain code. And this crypto material comes with the first creation step with the create channel step here. And we have to, and so, and because of this, we can use this user and then the MSP folder, you will find the information which are needed to authenticate in the wide range. So, and then we have to install, we do it the same again and we have installed the chain code also on PNL organization two. Then we can switch back to the organization one. And then we have to, we can check on this PM which chain code is installed. And we can do this with the query installed. This is also a part we have seen in the last session and yeah, and you see, that's the package we have installed. And this is the string we are going to copy and replace it here with this. So, and then we have to modify the chain code environment where we have it. So, that's an important part. Don't forget this. So, we have here a conflict. So, we check, this is PE, and there's six, four, okay. So, and that's an important step. So, maybe when you try to modify some things, then you will have here another hash value and when you forget to change this hash value in the chain code environment file, then you will do everything but the chain code container, the chain code service will not start. So, and that's a mistake I have seen in my tests sometimes. So, you have to be aware of this and you have to be carefully with this chain code environment file that this hash value is the right one which is the same with you have installed here on the PS and you say, this chain code query installed command when you set this command. Okay, so, now the next step is that we have to create the Docker image for our external chain code servers. And for this, we switch back to the external chain code, for example. And the only thing what we have to do here is we have to create with the Docker build command, we have to create a new Docker image. So, let me check if I have, so let's, we can delete this one. So, and then it's gone. And to build this, the only thing what we need is the Docker file, but this Docker file, so that's, it's also provided in the, for example. So, you have to, you have to change anything, nothing, you have to change nothing in this. So, the only thing what you have to take care is that these path, this is the same path for your chain code. So, maybe you will try another chain code, when you try to reproduce this example with another chain code, then you have to adopt here the path, that when you say, for example, and then if for example, you have another sub directory with your test chain code, then you have to just this here. And so, but that's all what we have to do here. And then we can build to this Docker image. Yeah, of course, the notepad plus plus is a good one. You can use, but you can use different editors of your choice. So, that depends on you. So, okay. And yeah, successfully. And then you should talk to images. And then we will have a new hyper lecture as a transfer basic chain code image here. Okay. So, and then we go back to the test network directory, because I think we have, yeah, so let's have to check again. Make a mistake here. So, this is the basic chain code number and we need this environment variable to be exported. And yeah, and in chain code environment file, we have also, yeah, so it's the same number. Okay. And then the network is running, but what we need now is the chain code container running. And we have to start it by our own. So, we will run it as a service, as an email in the background here. And here is the environment file. So, that's the important part. So, I started this from the, I will start this from the test network position here. And that's the reason why I have copied the chain code environment file to this position here. So, otherwise we have to, we must change the path to the chain code external example that I've actually, that this will work. So, be careful with that. And now we have another container running. And this is the container where the external chain code server is now running. And with this, we can go further and can say, okay, now we can approve the chain code. So, I'll start with organization two. And yeah, so, all this parameters we have seen in the last session. So, the important parts here are, make sure that you have the right channel name, make sure you have the right chain code name and the right version. And be careful with the sequence number. And here we have the package ID. So, in the last session, we, I think we used CC ID, another name for this, but it doesn't matter what is the name. So, that's an environment variable with this value here. So, it's the only thing which must. So, and then we can try to approve the first one. Okay, so this is going to work. And then we switch to organization one, do the same for organization one. And then the final step is the commit step. So, that when, and when we have been the majority of the network members have approved this, then we can commit this and to check it, we can use the check commit readiness command. And you see here the approvals. We see organization one, okay, and organization two is also okay. And then, and then we can commit this. But these steps are exactly the same as we have seen in the last session. So, and that's it. So, and then it's time to look into the train code. Okay. The train code is this as a transfer goal quote. And I think that's the only thing what is important here for us that we have the train code ID, the train code server address, and that you notice that you have to use the stream chain code server method here and object here. And yeah, so, and that's the difference, the main difference between the normal version and the external service that you know that if you're going to use this, then you will change also your chain code in this, in this, in this way. So, any other functions here from the functionality, we have seen this chain code in the detail last time. So, that's the same. So, there's no change for this here. And then in this, this chain code needs an init function. It's called init ledger. And this is the important and it works. So, chain code invoke successful. And that means that the chain code server is running and accepted our invoke function. And now we can agree with this. And you see, you will have the first result. And if this takes more than one second, then you know something is wrong. So, and then you have to look into the logs to see and to find maybe an error. And to see the logs here, so you can do it very easily when you use docker compose. With this command, docker compose and logs and follow. And this is a, you can say on which position you will see the log files. And with this command, you can see all the outputs from this particular docker compose file. And so, we can see and then we then, I have here prepared a second terminal. So today I don't use the Trimax version, so I used a second terminal because with this we can a little bit easier do the squaring here. And so, let's do this. Global is one. And then config path is missing. So, and to check if the, so the query works. So as we have seen, and then now we can use also one transfer function to invoke something. So, and this is, this changes the owner from asset one to Roland when we query asset one, you will see Roland as well here. So, and when you see docker peers, you see here only this asset transfer basic container. And this is how you can use this external train code service. So, when, as soon as this container is in the docker network, then you can use it. And when we try now to install the normal way, we can do it as well. So, in the next step, we are going to install the app, the AB store chain code, as an normal as an internal chain code. And then you will see here that both for PS0 organization two and one, we will have another container, these typical chain code containers as well. And to install this, we can go back to the chain code app store, go directory. So, in the, in the examples, make sure that you have the dependencies installed. And then we're going back to the test network. And then we do the backing again. And here's the path. So, so, and so let me see. And in this step, the chain code will also packed in this app store target set package here. And then we do the same as we have did for the, make sure that we are in the right organization. And then we're going to install it. And you see this process takes now a little bit longer. And that's the reason because the chain code container will be built now in the background. And this is also the advantage from the version two, because when we commit the chain code, then the chain code container is ready from the first invoke command on. So, and that was the difference between the version one point with the version one, because only on the first invoke command, the chain code container was built. So, it reduces the latency for the first time. And we do it for this, for the second organization. Yes, you have a single point of failure. That's correct. And yeah, this is, I can say, maybe this is an disadvantage to this scenario. But maybe I don't know how this is when you're doing this in the Kubernetes cluster, how you can handle this single point of failure. But this is true. So when you use this, we have a single container and we can try it when this chain code, the second chain code is running, then we can try to stop the container and you will see all queries will fail. And when you start this container, the queries will work. And yes, that's a single point of failure. And when you use this traditionally, then we can have, we have a peer and we have a chain code. And when we have a second peer on this organization, then we have a second chain code container as well. And when the peer goes down, then we can have a for tolerant system in this way. And this is, I think, yeah, a good way. That's I think it's the normal way. And also the gossip protocol and when you use the Node.js, the discovery service, they will know which peer is online and which is ready and will then query peer one or peer zero or peer free from this organization to get the data. And when you have a single chain code container, then you will maybe will have a problem. So, and that's what I have said at the beginning. That's an advanced feature and you must take care on this. You have to handle the situation in different ways. And you, I think you need the use case for this and yeah. So, okay, this is the chain code too. Okay. And then let us check. So that's clear installed. That's only some copy and paste now. So, and that's, here you can see, we have now two chain code installed with the back, the basic, which we have as seen as external one. And then here, the app store in the traditional way. So copy this. Okay. Don't export these environment variable. So, and then we have to improve it. That's the same as we have seen before. So switch to organization two, improve it as well. So, okay. And then we can commit it. So it doesn't matter if an admin of organization, one organization to commit to this because we have the majority. And when the majority of the organization has confirmed this, then you can commit this chain code. Okay. So, and now you have, when we look at Docker peers, and now you see a different situation. You see here, our external chain code container is running. And then you have here the both, the both internal or normal chain code container, which will be created directly from the PR. So now let us check if this chain code is running. Yes, chain code work successful. And then you can see the amount of money from organization, from the account A, I account one, and the amount of money of account two. And then when we move 100 units from eight, from one to two, it should work as well. And you see 110, and 900. Okay. So now you have seen, so, and so we have seen one example for the external chain code service, of course on the same system, and with the internal one. So, but the, we can query the external service as well. So when we do this one, we get asset, asset one, and you'll see this is done. And when you say so, then we have to, so when you say the cost stop. So this external chain code container is not running. And then we try to query this. You will see some errors and the chain code is not running. But we can start this chain code again. Before I start command, this one, so you see it's running. And then you can create again. Okay. So, I think we are done with the, with the example. So, okay. Do you have any questions? Yeah. There are some questions in the, in the chat. I'm trying to point out. Yes. Okay. I think I have covered this question. Can you please share? Is any additional feature using mini fabric instead of fabric? So I don't know. So mini fabric is a good way to start. That's an, so it's a way to, fabric is complicated. And you have to know a lot to, to use it. And I think mini fabric is a good way to start. And, but I don't know how mini fabric can handle this additional features. So, but I think mini fabric is, now where it's going to be in hyperlature or an incubator project, maybe so they will push it. So, this is definitely a good way for the mass. So fabric want mass adoption or to improve the mass adoption. And mini fabric is a good way to start. But let me be honest, I think that's really a good way. But if you're as a programmer or as a system administrator or as a technical, you have to know what is behind the curtain. And I think it's really important to understand what is how fabric works. And that leads to the fact that you have to spend a lot of time and to learn a lot that you can build a system like your business needs. And I haven't spent so much time in the mini fabric project, but I think it's a really, really good project. And you're definitely sure to take time and look into this. But in the end, it will come to the point that you use your fabric network by your own and you have to do it by yourself and you must understand what's going on. So what, Damel here, no, I don't think so. So that's an interesting topic. And I think KC Tem has an awesome article written to this topic and you should go into this and read about this. And, but in the upcoming sessions, I think we don't use this. Maybe KC will make a session for us and then we can ask him to give us a good interaction to this awesome page. In one of the session, can you please share how we can set up a peer to one chain code with Java language instead of Go? Yeah, I think I can do it. So I'm not a Java man. So, but the process is from the installation part. I think the process is basically the same. So, and that's, that is what a fabric says it is plug and play. So when you start with this, you say plug and play, okay, that sounds easy. And then you will recognize that fabric isn't easy and what they mean with plug and play. And that's the part, what they mean. So as a chain code, you can use the Go lang, you can use Java for chain code as a chain code and you can use Node.js. And from the install process, I think there is no difference. And when you look into this network script, then we have a parameter where we can say which language will be installed. And then you can say that this Node.js, this is Java. And when you're unused, when you're not used this parameter, then it's, it will be Go. So I think from the installation process, from the proof process, that's everything the same. But it will be, of course, a different when it comes to how you write the chain code in Java or how you write the chain code in Node.js. So that will be a different, of course, because the implementation is a little bit different because Go, Node.js and Java, doesn't interact with the ledger directly. So they use an API. And in the Go, we use the Shim API or the Contract API. So, and this API gives us some methods which we can use to interact with the ledger. And with this chain code functions, we can do some things. And that's in, that is also in the Node.js world and also in the Java world. And in the future, I think other languages will come. And that was, they say, that's the meaning of plug and play. So they want to use that as much as possible languages and people with different backgrounds can use Ferric. And that's the cool thing on Ferric that you can use so much different techniques. But yes, it's open source. And I think with the Go language, with Go chain code, this is the primary language for chain code development. And that's, I think it's the best maintained. So, and Node.js and Java are also good maintained and but I know not so much about the Java word in this thing. But the installation process and the proof process is the same. Maybe we can do the samples so I can try if I can do it. Please expand spam use cases. Yeah, that's a good question. But I think, yeah. So that's also a new topic, this extensible blockchain object model. So that's definitely an interesting part. And I have to say, I have to mention Casey again. He has also written two, three weeks ago an awesome article about the ex-bomb technique. And, yeah. So that's an interesting part where we can use chain code, I think, over different blockchains, but I have not so much seen. That's also a point where I have to say, maybe I'm not the right person now to explain ex-bomb. So that would be definitely good when we have someone like Casey and then he can explain us what the world is. So, okay. The slides, I have posted here in the chat the slides. Yeah. And, okay. So, yeah. So I think then we are on the end of this meetup. So the last thing, maybe you should do it by your own. Here's an example where you can see how you can use the Google Cloud Buildbacks. And this is also here in the repo. So I think that's a really interesting and good way to build your Docker containers. And as you can see here, when you clone this repo here for the Google Cloud Platform, then you have different examples here. You have Node.js, you have Go, you have Python and so on. So there are a lot of examples here in this. And then the only thing you have to do to one, to create a one-able container is these two commands. So you can use this Google Cloud Builder and use this name, this image name for this. And then you will receive a Docker image and that's it. So I think that's a good way to use, to build Docker images. And that's here the rebase command for this. So I think that's really, really useful when you work with Docker images and when you are a developer and you want to use this, we have to use this container images. And here's an option that's the same when you do it with Heroku, because buildbacks are basically founded by Heroku and these are the, and when you come to my link, to my documentation, this and you will see how you can build this and to run this. So I think that's definitely something which every web developer should look into. And yeah, that's the cool thing. So as I've mentioned, and that should be also my final words here, that FAIRIC is a set of technology from cloud technologies, which works in an awesome way together. And you can use for your own purpose, single pieces from this, like this cloud builds or this buildbacks, Docker as well, Docker compose as well, and so on. And also all the stuff which is going on on cryptography, you can use the certificate authorities and so on. So there are a lot of techniques which you can use in your normal IT life. And when you come with a background from a web developer as a developer or as administrator, then you will, I think you will see that there are a lot of technologies you are used. And, but you have to think it and you bring it in another way. And then in the world of FAIRIC, you can combine this and then we will have a good understanding how the things work together. Go learning. Yeah, go learning. I think there are a lot of good resources. Go is one of the languages. I think like Node.js, for example, which could be really, really good learned over the internet. So you find a lot of useful information on your official Go lang site. And then you can, it depends on you if you can have a lot of, you can buy a lot of books when you like to learn from books. You have a lot of video tutorials. You can have a lot of courses on ethics, for example, of Coursera and so on. So I think it depends a little bit on you, how you can learn. You can make online courses, for example. And yeah, so I think to learn Go, that you will have too much resources to find, but I think you have to find out what is the best fit for you. And but to learn a language like Go, Node.js or whatever, the simple thing is do it. So start with a simple example and then you will do a little bit of screening. So you can make a Google alert or you can make, when you know Flipboard, you can have this topic. Then you can screen the internet every day for good articles. Also on Medium, when you look at Medium, then you will find a lot of good articles about Go, specific Go topics and good auto for books. So I don't know, I don't want to feature one outro or one learning session. So I want to be a little bit more trial on this position. So I think you have to start and to look a little bit around. And I'm sure you will find a lot of information how you can learn Go. And yeah, for the chain code development, there is some Go knowledge important, but not so much, I think, because the Go chain code is really strict. So you have to, there is a schema and when you know the schema, I think you can handle a lot of use cases with Go. And for that, you don't have to be a very experienced Go developer because a chain code should be small. The chain code, because when it comes to performance, how the chain code takes a lot of time or you have to do a lot in the chain code and then the performance of the system will go down. So you have to make sure that the chain code is small and clean. And in the simplest way, in the simplest thinking, the chain code is really simple. So you will store in the blockchain a key and the value. And some techniques are important. So some converting techniques, how you define a variable, how you can convert the string in the byte stream and something like that. But when you look through the examples, for the favorite examples, and I mean, for every use case, for every chain code, there's at least one Go chain code and you can learn a lot from this Go chain codes. And you should go through this basic examples and you should look how this works and then you can try it. And so I think, yeah. So that's Hyperledger from developer on Go lang. Hyper frameworks developed in Go lang, Hyperledger framework developed on Go lang. So what do you mean with this question? Hyperledger frameworks developed on Go lang. Hyperledger itself is developing Go lang, yes. Okay, so thanks for your time. In the next session, we will go back to the basics. And I think that in the next session, this will be a good session because the topic will be channels. And this is a key part. So don't miss it. And because channels are really important in the world of fabric. And that will be very interesting. So, okay then, thank you for your attention. I hope you have seen something new. And if you have any feedback, please send me an email or write it down in the Slack channel or on the MeCup page or you can contact me on different ways. If you would like to see a particular topic, then you can also give me this information. Then I would like to organize this. And the points about the demo and the X-Bomb, this definitely a good one. So maybe I have to speak with my co-motorwriters and maybe we can organize in this way in the later sessions of someone who can talk about this a little bit. So yeah, okay. Then stay safe and take care in these dangerous times. And yeah, I hope we see, we hear us next time and bye.