Private Blockchain | Hyperledger Fabric | Getting Started

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign blockchain which is hyperledger fabric now we have talked about blockchain we have talked about the public blocks in which is ethereum in fact you will find the link of that playlist in the description where we have talked about blockchain we have talked about public blockchain and all the basic concept the thing is blockchain is booming right so in future we are moving towards web 3 that's the Focus right now if we talk about public blockchain it is great the only problem or in fact there are few problems which we have the first problem is the confidentiality because everything on the public blockchain since it is public the data will also be public right so it's okay to have your transactions there because that's how you can verify but then if you talk about companies for them secrecy is very important so how they are going to use blockchain of course they currently they are using their own databases they want to make sure that the data is secure now if we say that blockchain is great which is great in fact they know blockchain technology is great because it provides you something called a decentralization where no one owns the data so if they want to use it of course they will not look towards the public blockchain because they want the data to be secret the second problem we have is the transaction cost everything which you do on the public blockchain basically you have to pay for the transaction does it transaction fee you pay and the problem is if you talk about an Enterprise let's say there are multiple Enterprise and they want to store a data Maybe it can be for supply chain where we have multiple entities and they want to create a ledger or the database which will be shared by everyone and no one should be able to own it so this is an example here so let's say apple manufacturing iPhone and basically or maybe any company it's a matter so a company when they manufacture the mobile phone they don't build all the components by themselves so they take help from other companies right so this display will be built by someone else the the motherboard will be built by someone else the batteries or anything else will be built by someone else what this company do is they design it and then once they get the parts they assemble it now let's say if we have multiple entities here now they want to share the common database of course if you say that the entire database will be there with the one company the other companies will not trust it so what they can do is they can use something called blockchain here where the data is actually not owned by any one company it will be shared between everyone and blockchain does provide that right so we can achieve decentralization on in this network now of course they don't want this data to be shared to the outside world so they can use a private blockchain here where the network will be there and everyone on the network will be able to see the data but not the outside world now since we are talking about companies all these entities all these parts here they are well known so basically maybe they have done the kyc but the thing is in this network all the entities if you talk about five companies here or four companies they know each other in fact they have an identity so not everyone from the outside world can join the network if we talk about public blockchain like ethereum anyone can be a part of it you just have to install a software and you're done you are a part of a network now right but no that's not the case with blockchain now there are multiple implementations for private blockchain one of the implementation is hyperledger fabric which is the biggest private blockchain so let's talk about it now what we do here is in fact we'll see the Practical as well how exactly it looks like and then we'll talk about Theory as well but when you are learning this we have to also understand some key Concepts there are a lot of keywords or terms which you have to be familiar with so let's say we have these companies and they want to communicate so what they will do is they will be a part of a network and this network will be run by hyperledger fabric now when they are connected acted they need to have a common Ledger now what exactly Ledger means the database but then this database will not be having a final value now when I say blockchain we know this concept right we have a concept of transactions example let's say if you talk about any asset let's say if you talk about this pencil here now who owns it I own this pencil but maybe I bought this pencil from someone else or maybe I want to sell this pencil to someone else what if at this point at this given point this pen or this pencil belongs to let's say hush that's the current state so if you ask me hey who owns this pen I will say hush but then there's a history here right so let's say I bought this plan from social social has given to me so we need to have that history as well and that's what you can maintain in the blockchain so basically we need a ledger here now Ledger will have two things here not just one it will have the state the current state which is the world state which they call and also the transaction log where we'll have all the history that's one now the question is if these companies want to connect to the network they also need physical machines right now this physical machines we call them as peers so we got The Ledger and then we got peers as well these are physical nodes basically computers but also we have mentioned one more thing that everyone in the network is well known that means they also need a certificate of course how will you prove yourself that you are that person now in this case this company or this peers needs a certificate now this will be given by a certificate Authority and whenever they do a transaction they have to basically sign the transaction with that certificate so we can prove the transaction has been initiated from that particular machine or person so we got up here we got the ledger so this Ledger will be there with every peer of course right that's how you can share data and all this thing will be synced now basically do we really need a consensus algorithm like pow here we don't need actually because all the entities are known so why to wear so much money and so much of resources to do that now since all the nodes are well known they can use any CFT which is Crash fault tolerance and they can implement this we don't have to implement the byzantine's fault all in there so that's that simple right so we got a network they got certificate So when you say you have a ledger here of course this Ledger will be updated there will be new transactions this the world state will also update but the question is who will do that we need a software as well right now in the world of blockchain we talk about smart contracts so all the transaction you can initiate with the help of smart contracts the same thing is there in the hyperledger fabric as well now this smart contract we call them as chain code so the packaging is called chain code so if you want to say smart contracts that's your choice but then if you want to be specific you can say chain code package or chain code basically so every peer whoever want to do the transaction they will have the chain code as well and this particular chain code will be changing the data in The Ledger now how many organizations we have let's say we have for organization and every organization if they want to be a part of a network they need a peer and every peer if they want to store the data they will have a ledger and if they want to make transactions they will have a smart contract and it's not like you cannot you cannot have multiple chain code or smart contract on one peer you can do that okay and they can have multiple Ledger as well but the idea is the peer will be having a smart contract and a ledger so that's how you can build this network in fact we'll also see a slide where I will try to create a network where you have multiple peers joining but let's try to understand the terms first so let's say you have a identity right but everyone in the world has an identity right example if I can get a certificate can I be a part of this network now just because you have a certificate from your ca that doesn't means that you can join this network so there's a special service here which is called membership service provider who will specify that who can be a part of a network and what are their roles okay so we also need MSP there so we got the PO we got the chain code We Got The Ledger we got the network and then we got organizations we got MSP next let's say you do a transaction so any peer on the network is doing a transaction now question arise who is responsible to add that transaction in a block and who is responsible to add that block in the blockchain now if you say an API can do that then that particular peer can be malicious right so at this point what we need is we need a special service who will be unbiased and who can add the transaction in the Block in a particular sequence and that's where we got order appear so what this order will do is every time there's a transaction which is and those again we'll talk about endorsement every time you have a transaction which is endorsed this order appear will add that transaction in a block so basically we also need a order in the network okay so we got order as well now there is one more problem here let's say we have five companies or five organizations in this network and then if there's a transaction happening between two organization there may be a chance that you don't want the other organization to know about that particular transaction let's talk about Apple Samsung and LG here if apple is buying the displays from LG and also from Samsung and let's say if Apple and Samsung they are dealing for the screen now whatever amount they are dealing with whatever the deal is will be seen by LG as well because they are the same network now what if they want to maintain the secrecy so we can do that so in the network as well if they want to create a sub Network kind of thing where only this company will be connected they can use something called a channel in fact if you want all the companies to connect even then you create a channel if you want only two or three companies to communicate you will create a channel so in the same network we can have multiple channels so this is particular Network right but then we got we talked about chain code we talked about a chain code will be able to change data in The Ledger and that's what we want right we want to maintain the transaction the problem here is who is initiating this change code of course in the network you can't simply go into Network and change something you need to basically you will be outside the network as a normal user if you are working for that company and you say okay I received 15 screens from Samsung if I'm working for Apple if I can just simply say I just save to 15 screens from Samsung now at this point where I'm sitting I'm basically outside the network so we also need applications which is outside the network communicating with the chain code right so we'll also have that now to understand this mode what I will do is I will share that slide with you so we are trying to basically understand the key Concepts here so let's design the network so when I say you have a network there are some terms here we have organizations we have network configuration will not see that network configuration here we have certificate Authority we have order we call it Consortium so let's say if two companies want to do something they want to create a new channel that's one Consortium we got channels we got Channel config because if you are critical Channel which basically allow two companies or three companies to communicate we have to also specify the configuration I mean who can join this channel can anyone can join this Channel or maybe if Apple and Samsung are communicating LG will say Okay I want to be a part of the channel to see the deal so you can specify those things in the channel configuration and also we got peers we got Ledger and then we got smart contract so let's design a network so let's say we have this network here and in this network the first thing you need is a auditor peer now this auditor as I mentioned is responsible to add your transactions in the blockchain right or in the blog basically and that block will be distributed to all the peers now to get an auditor of course even the order needs a certificate now who will give it so we have a certificate Authority let's say we got ca4 and since we have multiple companies here they can get the certificate from the same Authority or they can get from multiple authorities different authorities basically now in this example we are going for different authorities so auditor will also have a ledger which they want to update of course and they might have multiple Ledger for different channels we'll see that later but yeah basically we need a different certificate Authority now let's say we got a channel here and I want in this channel for multiple companies to connect so let's say when we say R3 that's when organization so we have to basically create a channel configuration where we have multiple entities they are coming together and they are saying okay let's create a channel where we'll all communicate now from each company that's that's their choice that they want to have a peer so let's say from R1 we got one peer a physical machine basically and that PR will have a ledger and that will be connected to the channel right so who can access this channel now only P1 so if you want to connect to P1 basically let's say there's application outside the network if they send a request they cannot directly change data in The Ledger they have to basically communicate with the smart contract so let's say we got S5 which is smart contract so A1 will be communicating with S5 to change data in The Ledger so we got one more PF from second organization and you can match the color scheme there so P2 belongs to R2 and P2 even have L1 it is connected to this Channel and who can connect as I mentioned it will be mentioned in the channel configuration and of course P2 will also have a smart contract if they want to change something so that's why basically you can create a channel here so let's say we also have P3 now now P3 says I also want to connect with this Channel and they can do that because if you see the channel configuration for C1 it says there are four organization who can be a part of it right so even P3 wants to be a part of it now P3 can be a part of one channel or it can be a part of multiple channels in fact all the peers can be a part of multiple channels so let's say we got one more channel here which is C2 and P2 and P3 want to communicate through C2 so now P1 cannot see what they're doing right yeah if there's a transaction which is on C1 all the peers can say it but there's a transaction happening on C2 only P2 and P3 will be having access to it right now since P3 is connected with C2 on the second Channel it will have a different Ledger of course right when you say P1 P2 P3 has one channel then P2 P3 has different Channel and we are saying that P1 cannot see that data so The Ledger should also be different right if the Ledger is same P1 can also have the access so P2 and P3 will have a different smart contract to communicate and they will have a different Ledger right so you can see L2 is not there with P1 because P1 can only see L1 which is a part of channel one so this is the configuration for C2 which is the cc2 and two organizations are part of it one is R2 and we also have an order because order should be a part of all the channels in fact you can have multiple autographs and when you have multiple order appear we call them as ordering service so ordering service normally has one auditor or multiple in the Practical scenario we'll be having multiple order appears and we can have different applications communicating with the network and they can do it but now let's say if there's a transaction what if A1 wants to do a transaction here so let's say A1 want to sell this pen or this pencil from Naveen to hush now in this case the transaction request goes from A1 to P1 let's say now P1 says okay you're trying to do this transfer and I allow it so when I say P1 allows it that is called endorsement so P1 basically signed the endorsement by saying okay this looks like a real request I will sign it without checking all the policies so that's one endorsement but the channel can have a configuration where you can say Okay I want all the peers in the in the channel or all the peers on this channel to give the endorsement so even P2 need to sign it so P1 and P2 both will sign the endorsement but at this point this pen is still with me is because we have just done the endorsement but not the exact transaction now when P1 P2 has done the endorsement the response goes to A1 and A1 says okay I got the endorsement I got the license now now they can actually execute the transaction and to do that it will go to o4 which is the orderer and auto level say okay I can see there's an endorsement here so that's a transaction I will allow it and once that transaction goes into the block the transaction has been done now that blog basically goes to the P1 and P2 it basically notifies p1p to that there's a there's a new Block Please add it okay so that's how you add the data in this network so that's how you can build blocks and it looks solid right so everything is properly configured and we don't see any loopholes there so that's how the high pressure fabric is designed but if you want to do the same thing in the Practical how do we do that so let's do that now now if you want to experiment with the hyperledger fabric you have to build the network by yourself you have to build this smart contract by yourself even for learning purpose you have to do a lot of different things right creating a network configuring it creating the peers creating the order creating the smart contract it will take a lot of time and then it will be confusing right if you don't do it right and that's where hibernation fabric gives you a sample to work with so at least you will understand what is happening behind the scene how do we write a smart contract how do we configure something so let's do that and to achieve this they provide you a awesome documentation one of the reason I love high pressure fabric is because they have awesome documentation now if you go to the documentation you have all these steps in fact whatever key concept we have talked about they have everything here example you can go to key Concepts and you can read about it I have tried to summarize things in a short video but if you want something in detail you can go through this documentation and then if you want to run your hyper laser Fabric or if you want to see the sample we have steps here as well the only thing is the steps are explained and then there might be some confusion because when I was doing it I was not exactly sure what to run because they try to explain everything and then different configuration it's not that difficult but then when you're looking at this for the first time you might find it difficult way to see and that's where I have created this document for you a short document where you will find everything all these steps just to copy and paste command okay now if you want this to work there are certain things you need in your system so first of all you need git because you want to get the source code then you need curl because you want to get the samples and the installation file you need to get the docker because that's where you can run this containers so the images which you will get in a sample they will run in this Docker and then you also need JQ okay so in my machine I already have it so if I open my terminal and if I say okay I want to know if I have Kit let's check get version okay get is there next we need call version I do have it next we have docker Docker version I do have it and try to make sure that you have at least the same version because it is working with this versions if you have the older version it might not work so try to upgrade and of course if you're watching this video later you will be having the version after this and then you also need JQ so if I say JQ version okay when JQ is there now once you have everything set up in fact it's easy to download you can just go to Google and search for git search for curl and search for JQ you'll be having that the next thing we'll do is we'll create a directory or a folder where you will have all this thing and basically if you want to work with this Mac works perfectly Linux based distribution also works for Windows you have to do some additional setup you have to enable your WSL which is your Linux subsystem and you have to install all this softwares there okay so let me create a folder I will call this folder as fabric and I will move to that particular folder and then I will see it is empties at this point right now once you have this folder you basically need to get a script a shell script where it will have all these steps for the installation now you can get that script from here you can simply copy this and I will you will find this documentation in the description I will have a link there I will just copy this and paste it here so what it will do is it will download this script which is install hyphen fabric dot sh and it will also give the execution access to it and if I say enter done installation file is done is because it was a small file and if I say LS you can see we got a file now you need to run this file the only thing is to run this file you need a Docker if you don't have a Docker running it will not work so you can see my Docker is always running and if I click on dashboard at this point I have some images here I will just delete it I don't need this images so either you can delete from here because I tried the same thing before making the video so it was there in your machine you might not be having it so I have deleted all the docker containers and I will go back here and now let's run that script which will get all the samples the docker containers you need so to do that I will say dot slash install fabric dot sh enter and you can see it will try to download the samples it will take some time to download so let's skip it there so you can see all these samples are there if you scroll down uh you will get all the samples here so this is the containers we got we got fabric tools we got peers now all the things you know the peers the order it will basically download the execution for that or the containers and you have it here so basically the content is not running it is basically there to use it now if you see if you LS basically here here to get to in fact you've got a folder this file was already there the folder which you got is fabric samples and if I go to fabric samples you will see there are a lot of different folders here now of course there are a lot of folders the important thing is the test Network remember if you want to use it you need a test Network there so that's a test Network and next uh we are also going to see an application which is the asset transfer basic so what I will do is uh let's first start the network and then we'll see what is that transfer means to do that I will just go to the test Network folder here and if I say LS you can see we got all this particular folders and files so you got redmi to read about it so we have monitoring we have here multi docker now this file is important which is network.sh now using this network.sh you can start your network you can up the network once your network is up you can create a channel and then you can deploy your smart contract on the peers and on the channel so we'll do that step so first let's update Network so I will simply say Network dot sh there are two commands basically you have to sit down first is because why you will do down is because maybe you are doing this for the second time now when you already did it the containers will be available in the docker so you have to make sure that you're down the network so it will delete all the docker containers remember we I've deleted those things manually you can do that with the help of this command down now since I know I don't have anything but still let's run this so when you set down it will try to delete all the containers it says it is already deleted so no no problem I will say less same thing and now I will say up let's up the network now when you say up the network it will listen it will take some time and if you see the steps it's important so basically what he's trying to do is it's trying to create these certificates and keys so that you can communicate so you can got cryptogen tool here which is using then it creates two companies in the network we have multiple companies but just for the sample we got two organizations here we got org one we got org2 and in that we'll be having peers as well for each organization so we got one period per organization right so we got po 0 org one which is the first peer for the first organization we got pl0 for octo we've got one PR for the second organization right and then we also need a order up here which we have here and then it tries to run the container you can see the this is running now so containers are running I know it's messed up but if you see your Docker in fact you can see Docker containers from here as well so you'll say Docker PS iPhone iPhone a and you will see the containers running if I say update now I think it will visible you can see we got fabric tools one container then we got fabric Pier we got fabric order now we got two peers for two different organizations you can see we got Peery here as well and it also has a name so you can see we got the we are here and then we got beer here okay so we got the peers running as well you can also check that from Docker if you click on dashboard and if you see we got compose here we got two peers Audra and a CLI to use it which is the fabric tools okay now once you got a network once you got peers it's time to add those peers to the channel how do we do that for that we have to write a command and you can just get the command from here which is in fact we did this we got we got the containers we got we moved to this particular folder and then we have done the up the network we have checked for the containers now it's time to create a channel in fact if you want to create a channel so you can say dot slash network dot sh you can use this command which is create channel and then you can also specify the channel name which is by default my channel if you don't mention so what I will do is I will go back here and say Network SH now say create channel do this only after upping the network so if I say enter you can see it will try to create a channel now and you can see we got the channel here and the channel is getting created so if you can see it will also create certificates for it and yeah creating the channel my channel which is channel name and then everything is good so we got this 201 so who are the part of this channel so it says PR is joining there are two peers who are joining it peer from organization one and PF from organization two also it will also add the order here so if you go down uh Channel done so the order will be also part of this channel so we got the network already we got the peers ready we got the channel ready it's time to deploy the chain code now the Chango is always there if you go to the folder again let me open that folder from my finder or the Explorer so I'm into the fabric folder and if I go to fabric samples you can see we got so many folders here so we got this as a project which we are going to run which is the asset transfer basic this is the project we want to run now in this we have chain code here so if you can see we have this chain code available for the so we have the same logic with different languages so high pressure fabric supports go Java JavaScript and typescript the major support is for Java go and for typescript so let's use that so we can see we got Java code and typescript so what I will do is for this example we'll be using typescript here so we can just deploy this typescript chain code on the channel now I also want to show you the code for this what I will do is I will open my vs code and let's open that folder so you can see we got asset transfer basic and if you go down we got a chain code here let's select typescript we want to see the code for that and if I click on open so this is your smart contract which is your chain code now if you see the package.json you got a lot of different stuff here so we got this dependency which is the fabric contract API we got fabric shim for connecting and then other tools it has a certain script as well when you run this code So when you say start it basically start the chain code so you can see fabric chain code node start it will start the chain code and yeah things are there so if I open the SRC we got an asset here now what is the asset so let's say this particular chain code allows you to transfer the asset it can be a pen it can be this remote any asset which you have so basically every asset will have an ID every asset will have a color every asset will have a size owner and the value So when you say owner who is owning it value then size if you want to have a specific item so if it's the size of this particular pen size of this remote we got color yeah so this is the asset next we have is asset transfer so every time you do a transfer this particular contract will allow you to have a ledger as well right now when you have a ledger by default The Ledger will be empty right what we want is we want some data there so we got this init Ledger function try to remember this function name so we've got init Ledger who is responsible to initialize The Ledger with this particular asset so we got asset we got asset one blue owner is this asset 2 owner is this asset three owners this I said four donor is this and then we got six asset now what if you want to create an asset a new asset so in that case you can call this particular method which is create asset and it will do the asset education for you so every time it runs it basically edit your transaction again it will send a proposal and it will be confirmed by the order then The Ledger will be update it right so you can see it is using put State that's how you add data in fact in initialize also we have put State then what if you want to read in this case again it will use the context for the smart contract and then it will try to read so for the read we have the method which is get state and for update we have again put state but we have to also verify if the item is there if the asset is available there you can also delete your asset with the help of delete state and we can transfer the asset as well so I can transfer this asset from one person to other person right that's what we have here so we are changing from the old owner to the new owner that's what we have done here so this is how basically you can change in fact we also have get all asset if you want to print everything so this is the particular smart contract right this is your chain code and this will be available on the peer okay now how do we install that how do we deploy this particular chain code on the channel now there are multiple steps here which you have to understand first when you say you are installing it you will be doing that from a particular peer right so you will go to a particular peer and say okay from this peer I want to install this now if we have to install on peer one you have to install on PR2 and then you have to also install on the channel now for the channel basically you have to get the endorsement as well see if pr1 is installing it it's for peer one if PR2 is installing it is for peer2 when you say you have to install on the channel both the peers need to agree and of course you even that you have to mention in the channel configuration who is responsible to endorse it right now we don't have to do all these steps we just have to understand the concept there is one script which will do everything for us so if I go back to my documentation you can say this is a particular script which will deploy your chain code to the period and the channel but a lot of things are happening behind the scene which is deploying it on the peers deploying it on the channel endorsing it as well everything everything is there in this particular script the changes we are talking about typescript right so let's install with typescript so you can just change this to typescript in fact I'm changing it so you will be having the updated one because when I tried I tried with go so I will change it to typescript so what we are doing is we are specifying which chain code we want to deploy which is the chain code typescript and you have to also mention the language so which is the typescript language so let's copy this and go back to your terminal so paste what it will do is it will do deployment it will take some time but if you see these steps here it says this is a channel name where you are deploying it and then it tries to so you can see we got for first it will create a package of it so whatever chain code you have it will get a package the package name is basic Dot tar.z and then once it is created the package it will install it so you can see it is installing it here packaging done installing is here so you can say po1 is installing it then PR2 will also install it so you can say peer2 has installed and then even the channel now for channel to do that it will also do some endorsement so you can see we have to basically it's not uh endorsement it is approving so both the peers need to approve so this is where it is approving it so you can say it is approving from peer one now org one is approved octo still not then it will try to approve from orc2 so you can this is the this is from octo and then if both ones both have agreed or approved now the chain code will be committed to the channel now once it is done you have your network ready you got peers ready you got your chain code ready now it's time to run something maybe you want to create the asset maybe you want to get all the asset how do we do that so the chain code is there on the peers and channels so basically we have to call the functions now so basically we need to initialize the ledger so we want to add some asset and then we will also try to read it now to do this we have to go to the individual peers of course you can do that from the application from the outside network if you want to try that you can just open your folder and you can see there are some application gateways so basically we got the fabric Gateway in version 2.4 uh which using which you can actually interact with the network right so you can run this application and you can connect with the network through the application so these are the applications but then the demo which we are going to see now is we'll try to call the chain code directly from the peers so imagine you are using the peer directly in the network so someone physically sitting with the peer and they are passing the commands now how do we do that now first of all how do you get a hold on the peer because if you see if I say LS here peer is not here so if you see where the peers are available you can just go to your folder which is the fabric samples and if you see a bin folder here when you open this this is where you have your peer this is where you have your order so basically if you want to execute them you need to get this path and the way you can do that you can just copy these two things you have to export the path for the bin and also for the config for the configuration so we'll just go back and paste so we have done the paths are done and now we need to go to the peer how do you go to a particular peer so now since we have two peers if you want to go to the po1 or peer of the org one you just need to export this particular environment variables copy this so basically this is where you are specifying who is your local MSP which is org1.msp who is your loot certificate and then MSP configuration and the IP address and the port number for the PO so IP address is in the same machine I will say localhost and the port number is 7051 I can just paste this so by doing this we are acting as a beer of org one now since you are with the peer now what you can do is you can invoke a function call init Ledger now since the Ledger is empty if you want to initialize The Ledger this is a function you have to call now to do this it's not just about reading detail right basically you are trying to save data in The Ledger that's a transaction now when you say transaction you have to make sure that you are signing a transaction you are informing your order that you have created a new transaction so all these steps are here so basically you are invoking a chain code and then you are providing the certificate for signing you are also informing your order about this and then you have to also mention that even the organization 2 need a certificate for that so it will verify from the Octo as well and then once everything is done it will basically try to call this method which is called init Ledger now since you're not pressing any data so arguments are empty I will just go back now and paste this I guess I've not copied so copy this to initialize your Ledger and done now you have your data in The Ledger okay now how do we know that the data is there so we have to find a query so what you can do is you can use this product command now this time it is not this much of length is because you are just reading data now when you're reading it you don't need to sign it you don't need to uh get the endorsement you can simply query from The Ledger now since you're a part of this channel you can query it if you are from outside the channel you can't do this so if I say enter you can see we got all this data here so this is your asset one owner is this a color is blue and then all the values then we have all the asset basically okay now query done what if you want to transfer the asset now which as which asset we are transferring so if you can see asset 6 here which belongs to Michael now we want to change the owner now this the new owner will be Christopher if you want to do that you just have to copy this this is the same thing we did for the initializing Ledger because we are changing something now when you change you have to get the endorsement from the org one from the org2 let's copy this and the function which you're calling is transfer asset and the arguments is this too asset 6 going to Christopher let's do that enter and that is one transaction done if you want to check this you can find the same query for fetching data and now if you can see the asset 6 owner is Christopher so transaction done right okay so we are basically we are verifying this from the PO of org1 how do we know that the update has been done for the Octo as well so what we can do is now we can set the environment variables for org2 and you can see the change here is MSP has been changed and then we also have a change of the port number so the pr1 is running on 7051 PR2 is running will be running on 9051 let's say enter now we are using PR2 now with PR2 let's fire the same query for reading data and you can see for peer2 as well the owner of asset 6 is Christopher that's the part of blockchain the thing is no other entity or no organization is basically owning this data this is decentralized and now once everything is done you can simply down the network so that will remove all the containers it's always a good idea to down the network once you have used it so yeah that's the basic idea or the run through of hyperledger fabric we have seen the theory and the Practical uh let me know in the comments section if this was helpful I will try to make some more videos on some more tools thank you so much for everyone for watching this video make sure you subscribe hit that like button and do comment your thoughts thank you so much bye
Info
Channel: Telusko
Views: 25,147
Rating: undefined out of 5
Keywords: telusko, navin, reddy, tutorial, java, python, blockchain, django
Id: rwKPXHUlmks
Channel Id: undefined
Length: 38min 46sec (2326 seconds)
Published: Tue Mar 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.