 So, this is the second part, first we have already last month we have discussed, okay. So this is the 10 part series, blockchain introduction and architecture we have discussed in last meetup, okay and how many have attended last session, no, okay never mind. I will cover some of the slides today and then today we will discuss on fabric architecture which is one of the framework of blockchain hyper ledger fabric and installation on Azure, okay and in next meetup we are going to cover on the blockchain on deployment on Azure workbench and then there will be a different framework CODA which is one of the different framework for blockchain, okay and then we are going to cover on Ethereum and Quorum which is also a blockchain framework, okay and then how to handle the data and documents on the blockchain and then security and then IoT and so on, okay. So this is today's agenda, first we will go through the recap and then we will see one of the use cases of blockchain on international trade and then we will see how the architecture works in single VM and multi VM architecture on hyper ledger fabric and then we will go for the demo how to install. So how many have any work on the blockchain before, no, okay. So which blockchain framework you are working? The machines for shipping. Oh shipping, yeah I am actually going to cover one of the use case on shipping industry today, okay. So in the real world basically how the blockchain works, suppose you want to send a money from one person to another person from Singapore to some other region, okay. So A wants to send a money to B. So the transaction will be represented online on a block, okay and then it will broadcast to the network. What do you mean by network means blockchain is suitable for the distributed applications like wherever the multiple parties are involved and they do a business with each other, okay. So all the parties will have their own nodes in the network, okay. So the block will be broadcast in the party of the network and then all the parties will verify and once they verify then they will approve their transactions, okay. So then it will be added to the block and the money will move, okay. So in last sessions we have discussed that how the blockchain maintains a copy on each node means there will be in all the organizations will maintain a node. One organization can have a one node or multiple nodes. It depends on the like in our bank organizations we were doing blockchain application for trade and finance. So we were a corporate node and we had also a bank node. So there were two nodes we were maintaining that, okay. So blockchain basically works on the four principle like shared ledger, okay and security, consensus and shared contract. Shared ledger is means all the data will be shared between all the organization nodes and they can verify the data, they can do the transaction, they can verify and security. Blockchain is basically in terms of security they are doing hashing. All the blockchain nodes are hashed and referenced with the previous blocks. So if you are trying to maliciously trying to you know do any kind of attack or something because the hash will change. So you cannot do that, okay. And the consensus, consensus is basically different in the blockchain networks. Like suppose if you are talking about the open blockchain network or permissioned blockchain network. There are two different networks. Open blockchain network basically is like a Bitcoin, okay. But when it comes to the permissioned blockchain network, so basically it's for multiple organizations form their own network and they do the transaction of business with each other, okay. So consensus or algorithms in both the networks will be different. For open blockchain there will be proof of stake and proof of this work. There are two different algorithms for that and for permissioned blockchain it's not, they do the endorsement with each other. So in one of the framework we are going to discuss high pleasure fabric. So I will later I will show you, okay. So why it is secure? Because blockchain network is basically whatever the documents like D1, D2, D3, D4 documents are there, okay. So all the documents will be hashed by left node and right node. So it will be L2 and L2 hash, okay. Then again it will be hashed to each other, left and right and then there will be root. So if you are trying to modify any of the node, so the root node will change. So number of combinations it will be a lot if it is a very long chain. So it will be very difficult to modify the data in the middle, okay. So basically as I told before there are permissioned and permissionless blockchain network, okay. In permissionless basically you can read or write the database, okay. And in permission, in permissionless blockchain network there are consensus algorithm I told before, like proof of stake and proof of work. But in permissioned blockchain network it will be by endorsement policy, okay. So what are the components used in blockchain? Basically is a ledger, ledger which maintains all your data, okay. Smart contract means like how you are deploying your code. Smart contract means nothing but your code, okay. And the peer network. Peer network is like your organization. So organization will maintain their peer nodes and all your code and everything will be deployed there, okay. And membership services. To maintain their authenticity means like whoever the nodes are there or who is going to do the transactions they will be a certificate authority, which is a membership services basically. They will verify and they will give you a certificate. So certificate will be basically in hyper ledger fabric it will be two types like a public and private keys, okay. Public will be like it will be open for all means like you can do the transaction based on your public key. But private will be when you are doing some kind of authorization like signature. So private will be used. And events will be same like a notification and system management, yes one. So this is a block. Blockchain basically in blockchain is all the transactions are keeping the block, okay. And the data is saved in terms of a state, okay. But we can also store the data in external storage like a course DB and level DB, okay. So in this blockchain transition if you see all the blocks are means a difference with the previous block hash. So it is made up of series of the blockchain always added at the end. And so it to achieve the immutability obviously because if you are trying to change one block, the all blockchain will be changed, okay. So it is exactly similar to our applications, how we use in our normal days. If you see there is application client application and the smart contract like you are going to deploy your code, okay. And this transitions will be maintaining the block and the word state is nothing but your database, okay. So this is a Hyperlogy Fabric Network. Actually there are three frameworks basically Hyperlogy Fabric, Corda, Ethereum, Quorum which are the permission blockchain networks. So it is one of them. In this if you see there is CA, CA is certificate authority which gives you identity like suppose you are trying to join the network. So it will provide you a certificate, okay. PIERS is nothing but means for all the organizations there will be PIERS nodes and it will be endorsing PIERS, committing PIERS and order. Later I will explain. Leisure will maintain your all the data, okay. And channels will be basically the channels will be in when you are talking about the single VM architecture. So there will be a one channel only means all the parties will be in single channel. But suppose I want to do business with some different banks and I don't want to expose to some other party. So we'll create our own private channel and then we can do a business. In open blockchain network this is not possible. Nowadays I think it's an Ethereum they are coming when they came with the Quorum which was a, Ethereum was a previously open blockchain but in 2017 they came with permission blockchain for the corporates. So that's called Quorum, okay. So we have developed one of the application called Comgo which is a trade finance blockchain and that is in Quorum, okay. So smart contracts is nothing but your code, okay. So how it is means used in the real world. Basically we have developed blockchain for the two process basically one is the for shipping and one is for KYC process. In our banks basically to know about the customer it's a there are a lot of validation checks data they need to verify and they need to contact with multiple parties. It's a very tedious process and there's anti multi-learning like there are a lot of things. So to avoid such things some banks formed organization consortium and then they are working on the blockchain to do a business by using the KYC process to know, okay. So like information gathering verification and risk assessment these all are for can be done by blockchain. So what is the pain points like redundancy more large means you are getting a lot of data from different parties and sometimes it is a duplicated data means you don't know what exactly is and client is trying to forge you. He goes what the problem we face means suppose he is going to send some money or something some goods from one place to another place. He went to a bank and he kept the papers there okay and he went to the same bank and kept the 10 different papers okay. So means like trying to forge the same documents by doing a different processes. So that kind of process can be reduced if it is on blockchain because blockchain once your identity is created it is replicated on all the nodes. Whoever the banks in Singapore you are going to validate so they will track all your information by that okay. Inefficiency so this is like suppose the blockchain network in the customer banks and the government service providers all are on the same platform and they are doing the business. So blockchain is nothing but like whenever the multiple parties don't trust each other and they want to do a business. So what is the best platform so that's the blockchain nothing but okay. So in international trade as I think most of because Singapore is a hub for this okay because international trade if you go for if you want to send some goods from Singapore to some other region there is a lot of process there is a letter of credit bill of landing multiple documents you want to find a container you want to means different parties are involved and you want to do so if all the parties come on the same platform and they are doing a business so it will be more efficient than because this process takes a lot of time lot of documents means like if you see there are 12 parties involved in just sending a goods from one part to another part okay 27 documents so it's and is still now there is a very less automation in the shipping industry yeah so it's true. So the risk is a currency fluctuation and non-replication suppose if you are sending a means like small traders if they want to send a something they want to sell exporter importer and they are sending a goods the other region and maybe he at the time they have done the advance payment or they have not done the advance payment and the guy refused I will not take so and he didn't come to the board to take those all things so such kind of things are avoid can be avoided by blockchain network if you are having a contract because digital contract with them suppose it will be in terms of stages suppose you have done this process so after that it will be delivered so it will be so this will be means like all the parties come on a same platform and doing business document process letter of credit bill of landing yeah so in organizations if you see there are will be peers users admin and MSP MSP will be basically you are providing for the authenticity means like if it is giving you identity certificate okay peers will maintain your all your ledgered data means like how you are going to install your chain code and all those things will be on the ledger means peers and order will be for if you're executing multiple transitions so how it's going to be executed in a sequential manner so that will be done by ordering service basically in the network okay so nodes will be multiple like committer committer will be only they can see the data like we have a corporate node so corporate node we only can see the data but when we had a bank node so bank node we can commit the transactions we can register a transition we can choose some endorsement bank or any other organizations to do a verification so that was a endorsing peer ordering peer is nothing but your for all your transitions it is going to be in order single order okay so ordering service is basically which arrange your ex all the transition in sequential manner channels I explained before if multi two different parties want to do a business only in private okay so they can create their own channel and can they can do business like suppose that 28 banks are there okay or 28 organizations are there and few of them four or five just want to do a business with few of them so they can create their own channel in the network and they can do a business okay so this is single channel network I explained before it was in that there'll be only one ordering service there'll be multiple peers like multiple organizations okay and they will do a transactions on a single channel okay miss there is no different channel means all organizations are working on a single channel multi time multi channel there'll be a miss like in a consortium people are working on different channels okay no it's a multi channel yes because multiple banks are involved okay it actually it can be a single channel also or multiple channels it depends like suppose there are only few banks like initially we started with three banks so that was a single channel but when the other organization like a insurance because we had a doc we had a requirement to means like a for vessel for vessel they want to do insurance also so though they have taken means insurance company also they have tie up and for documentation process they have tie up with the Bolero so there are different parties was involved so for that it was a multi channel because few banks later on when they came into the picture so they don't want to do a business with each other yeah yes yeah correct suppose if you want to do a only a blockchain apply a blockchain in your only organizations okay which is on different region like suppose the one is in Singapore one is in Hong Kong one is in Shanghai okay and you want to do a some documentation process okay so then you can create your single VM network but then different organizations are also involved in that then it will be better to go for a multi channel no no no it depends it depends on the requirement actually because obviously all the ten organizations will not do will not do a business with each other okay miss they will only do a business with two or three so it depends how many are you doing the business okay so this is a consortium network which I will show you also in the demo later okay so in that there are two organizations okay three organizations basically two organizations are having their own peer and the network and one is the one organizations only having ordering service means which is a monitoring real transactions and execution okay so let's go for the demo so in the today demo we I'm going to show how you will deploy your network on the Azure blockchain actually there are two ways for that one is on Azure workbench means you can deploy your code chain code okay and the second is like you can create your own VM Azure VM and you can deploy your network so as of now we have done on the VM but it is also possible to deploy on the Azure blockchain but it is still in the preview mode so there are a lot of research going on that okay so let me show you how you will do that basically so first of all we are going to set up a network which having multiple peers and there will be a one ordering service okay on the blockchain networks on the Azure VM so we'll do on the Azure VM on will select will create one resource okay suppose demo okay the virtual machine name demo work region you can select based on your like I will select select the Southeast Asia okay and it depends on the usage you can it's recommended for using this at least 8 GB damn okay but you can choose a 16 based on your requirement okay I'll choose a password actually I have already created and miss the VM you need to choose a port for 22 for this for doing the asset connection okay and so let me just jump directly to this okay so basically we are what we are going to do we are going to do we are going to download a hyperledger composer on the VM okay and then we are going to install because hyperledger fabric framework supports Golang and Node.js and Java so I'm going to do on the Golang okay so we'll install all the boundaries for the Golang and then we'll choose the location and then we'll install the chain code on that okay so this is a simple process this we are giving the formations this is a prerequisite 1.2 is basically is a script for hyperledger composer to install so until it is downloaded I will explain you how it's works basically I have already the code downloaded let me show you so basically this is a fabric sample which I have in this I'm going to install the chain code okay this will be chain code sample 2 so how exactly it works is if you see first I'm going to install the network okay which means for the this is the first I'm going to configure all the network okay and set up the pure nodes so basically if you see the CD first network so it is going to generate the Genesis block Genesis block is nothing but your first block which will be having zero transactions okay so whenever you are going to set up the blockchain network so the first block will be the Genesis block okay and in that there will be means then it will install all your certificates which will be used by a crypto gen tool actually in this all your certificates are but for this you can also involve some external certificate authority it depends on you but fabric like hyperledger fabric provides your own CS certificate authority okay by default then we are going to install all their pure nodes like there will be a as I showed in my example previously there will be a this will be pure one and it will be pure two organization one organization two and this will be ordering service so if you see here so this will be pure one organization one and pure zero for organization two and there'll be one order and there'll be a miss actually two peers pure zero and pure one and there'll be one order which will maintain their transactions okay so let me see here it's installed then we are going to install the go lang after installing the go lang library we'll install the first means network okay and second there'll be a be wine be why an FSH for all the chain code there will be one assisted and there'll be one library called be why like EYFN or there'll be SH library okay which will basically yeah yes it's working no actually I have already my cheat sheet so I'm just going to install the framework and show you okay here we are going to set up the go lang path for the root directory okay and okay let me show you first I think it'll be better go version let me quickly just go through all this simple steps okay this is I'm copying all the chain code from one gate repository okay and it's provided by hyperlager fabric which is IBM okay until then it's going to miss download all the libraries I will just explain you first in BYN FS miss basically after downloading all the libraries or there'll be a search file for all the chain code and all the networks so that you need to create okay so in that you can you need to write a code for setting up your own network okay and how you are going to install the chain code everything will be in that so suppose let's see show you quickly so first will be this will be a network up in this network BYN FSH when I will execute this command okay BYN FS that M generate which will basically generate your all your root certificates okay and then it will bring your networks up okay they'll be great sure sure sure so it is installed okay so this is already exist let me go to this fabric samples let me I'll connect one extra path and show you new session we'll go and demo demo 3 and this is VM so if you see here this prerequisite on Brutal dot SHS is came here okay and in this sorry yeah I think let me show you okay so basically what I have done so far is sure let me is it okay I need to able to see so let me show you so basically this is I have installed the goal and package okay so this is I have installed first fabric like hyper ledger fabric basically it was from this my github repository I have created a bus Ubuntu VM okay then I have gone through for choose a size then I have choose a port okay then we have installed the hyper ledger fabric okay then in this we have provided the permissions for this and then there will be a you need to install all your pretty quick libraries for this because hyper ledger fabric frameworks supports goal and so we need to install the go okay and then we need to set up the route path for this okay basically then we need to copy the chain code or means like from if you have a chain code in your local so you just can give by the github command okay then you need to download all their prerequisites library for running this code okay chain code and by doing the first means setting the first network you need to go for the fabric samples dot first network which is already chain code installed here okay it be a by n dot sh will generate your all certificates and authority okay and this will bring up your network let me show you how to go to the first basically this is a network by and at fsh and this I have already written for the network up okay it will call the three methods for generating the certificates replacing the private key and for generating the channel artifacts channel will be means like first of all you have to create your peers okay then install the chain code and then you need to set up the channel and then you need to join the channel for doing the means like a business or transitions and then you can do all business show you so means like after creating the and joining the channel it will be something like this okay means you can create a channel and then you will be joining the channel and then you will instantiate your chain code in that okay then there'll be a means like for querying the data from different chain code you need to have an endorsement policy endorsement policies are nothing but like how you're writing your query basically like from how you bring how you want to bring your data from course TV or word state so you need to have a means like endorsement policy you can query the data from arg1 and can apply and policy or policy like that any questions in that