Build and deploy a Blockchain web-app with Hyperledger Fabric & Hyperledger Composer - Horea Porutiu

Show video

I just want to give a quick intro my, name is Horry uproots you I'm, a developer advocate at IBM and I've, been focusing, on the blockchain platform. For. The last eight. Or nine months here and as. Part of my job and I. Doing. Some, workshops I do some, a sample, coding, I do show. Developers, how, to easily, get started with this technology. And, today, I want to walk you through some, getting. Started, with hypervisor, so, both the. Open source just. Local. Technology. But, also want to show you a little preview of the cloud service, that IBM, provides for. The blockchain. Awesome, so yeah. Let's go, ahead and dive right in. Okay. So if, you need to find my slides again you, can find them on my Twitter page. They should be pinned right at the top and so I'll. Have some links in here to my, my. Code it's all on github and. Then all. The concepts of course you can view later to. See my actual Twitter, handle, is just this, at. Horry roots you it will be on the bottom of every page. Okay. So. The. Agenda today. First. I will just talk a little bit about what. Is hyper ledger and, after. That I want to show you how to download. And get started on your local computer. So. I'll show you where you can download all the hyper ledger fabric, I'll show, you you. There will be some scripts you have to run to actually start the fabric on a computer so, I'll go ahead and do that too and. Then I'll show you this hello, world or just, your first smart. Contract, so. Hopefully. You can at least get, some sort of knowledge, of how to deploy, your first contract. So. After I do that I'll. Show you this proof, of concept I've built using, the blockchain. Cloud, service and kind, of show you why. I built it and, kind, of how it compares, to this hello world application. So. I'm trying to kind of bridge that gap is like this hello world and then take you to the next step of a little, bit of more complex. Application. Okay. So with. The show of hands how many know, about hyper ledger in, this room. Okay. This is good nice. So. How. About blockchain who's familiar with blockchain. Somewhat. Okay. So more, the most most, people okay, so. Hyper. Ledger is this open source. Project. Under the Linux Foundation and, and. What, you see here at the top is we have all the frameworks so, there's fabric. Is the most mature, framework. And they have this way of. Grading. Of how much sure the project is so. There's a hyper ledger borough, there's fabric, indie, Aroha, and sawtooth, so. Today I will focus on fabric so, iBM is one of the main contributors to, fabric so. I'll, focus on that what. You see on this picture, is you see the channel, support for fabric so that's one of the main features of fabric, is this channels. And I'll show you that and, as part of my demo. And. Composer. You see right under. The frameworks you have these tools, and. Today I'll talk about a tool, called composer, and this, composer, is just, simply taking. The, complexities. Away of developing. With hyper, ledger fabric so. It's just trying. To make this development, a bit easier and, they. Have their own modeling. Language and they. Have smart contracts, based on JavaScript, so. I'll show that's what I'll be mostly, focusing on today is this hyper ledger composer. Okay. So. One. Question. I get very frequently, when I do this talk is what, is the difference between hyper, ledger fabric, and hyper ledger composer, so.

Again. This main, thing I want you to understand, is that fabric. Is always. Necessary. But composure, just, accesses. Fabric in a easy-to-use, manner so, composure. Is optional, but, I think, it's a really good way to get started developing. And. Under, the hood, composers. Really just calling. The fabric api's and. It's it's it's. It's really just building, on top of fabric. So. Some of the key. Concepts. That we will learn, about is. Participants. Transactions. And assets so. These are the key words that I'll mostly be focusing, on today and that's, the key words that composer uses. Okay. So. Here's, the link for actually, downloading, the fabric. Environment, for your local computer. Of, course I don't recommend doing this now because it will take some time to, actually download but, I'm after, if you want to go home and try this out I leave this link here for you. So. Once. You actually download the. Fabric on your local computer you'll have some scripts, that you'll need to run or. The first one is download fabric so I've already done that on my computer and, that was just taking. The actual fabric and putting it on your computer the. Start fabric, script, is what I will show you later today in. My demo and that's, gonna create some containers, and. The, four containers that will create one will be a database, I want to be order one, will be appear and, one will be a certificate, authority so. I'll kind of go a little bit more about. That when I actually run the script and. The, last thing we have to do is actually create these, pure, admin card this. Is the credentials, that will give us these. Are the credentials that is basically. Admin, access to the network so we have to prove with. Our public/private, key pair that we are the admins of the network and, that's what this script. Is doing is creating these credentials. For us. So. I. Talked. A little bit about this, modeling. Language so. This is. Composer uses, this unique modeling, language and, their. File, is called, this model file so that's just really the data schema of your, actual, application. So. The four things, we really have to worry about is. The, namespace, the. Participants, the. Assets. And the transactions, so. We have to define these four core features, the, events are optional I will not show that for the sake of time but know that there is events, as well. So. This. Is basically what you will need to define and I think this is really the. Most. Critical part of building your application, is this, model file so, if, if. You spend most of your time actually coming, up with a very good model I think that, is really the key to a successful blockchain. Application, so. Really, take the time I think really to understand, who are your participants, in your blockchain, network and. What. Transactions, and assets, do you have but, really the participants, is at the core right. We, want to ensure that. You. Know we, are we, we have some value being traded on the blockchain so. Again. This this first part of defining the model is is I think the key and the most important part. So. Here, I have a very, simple, kind. Of like a hello world model. File so this, model. File I will show you. Deploying. This with composer and as part of the demo, so. First. Thing we have our namespace at the top in. That after, that everything. We, want to reference in the blockchain will be coming from this main space and. So. Once. We have defined, our main namespace. We can define our asset, so. We see here we just have a very generic asset.

Called, Commodity, and we. Have a five, different fields, for, this asset, so. You see we have three strings, we. Have the trading symbol the description, and the main exchange and we, have a double and then. The really, key part is this arrow notation you, see and that's, simply just a. To, a, different, part of the, bought chain so, referencing, a trader here, so, right, under our asset we have defined our trader so. What, that arrow is saying is that every, commodity has to have a trader. So. Again. We have our asset under, that we define our participant. So. We have this trader and you. See here we have this identified. By so. A lot of times when you're working. With blockchain, you'll want to query a particular. Participant. Or an asset and see, exactly, what has happened to this asset as it has moved along the blockchain so. To, do that you. Have this unique identifier this. Trade ID and you, can query. By this trade ID and then see kind of what has happened to this asset, as. It goes across the blockchain and I can show, you that in a little bit here, the. Last part is the actual transaction, and this. Is something we actually have to implement, so. This is a, very. Simple, changing. Of ownership so. You see this transaction, takes a commodity, and it takes a trader and you see. Here that for, trader we have this, new owner so. All we're doing is we're, taking a reference to the asset and we're taking a reference to the trader and we're just updating that, owner. So. I've, shown you the data schema here next. I'll show you the implementation, of this, transaction. Called, trade. So. Here, is the, implementation. So this is the actual smart. Contract, may. Be referred, as chain code and hyper ledger, terms. Hydra, fabric terms, so. You. See here this is written in JavaScript you, see we have some promises, and so that, is something. You'll have to be familiar with to, develop, this smart. Contract. So. The first thing we do is just, assign our actual, new, owner to the commodity. And. What's. Important, from this slide, is this get, asset registry, so. This is the composer. A. P I so that's, basically, taking this namespace, the, or Ahmed, my network commodity, and it's, going into the blockchain and getting, that actual, asset. And then. Once we actually get it we, have this update API, right, and it's just going to simply. Update. What, data we have given it so, all we're doing here is taking. This new owner and updating, the owner field of the commodity. So. This. Is kind of your hello world just, changing, changing, the owner. So. As. We talked about earlier there's. Some kind, of this conflict, with these public. Blockchain, networks and this private, network, so kind of like we the MC is talking, earlier this etherium, has. This kind of conflict so. The. Access control rules is really what makes this network private, or permissioned, so these, these. Rules here. Is where you can specify who. In your network has access to what so, by. Default we. Have a very simple, like everyone. Has access to everything. So. In, a more complex, scenario. You want to have. Referenced. Certain participants, and say, they only have read access maybe.

Some Different participants have write access so. This is where you will do that and this is kind of this private. Or permissioned. Architecture. So. What. I've shown you so far is this data schema I've shown, you the actual JavaScript, implementation. The chain code and then, I've shown you this security. Access control rules so. These are the three main files, that, composer. Works with to create your business network. So. Once we create this business network we will have a REST API that, we can deploy. And we. Will be able to access the blockchain, with our API so. Our. API will have exactly. What is defined in the data. Schema. So. It will have our asset. It will have our trader and it will have our trade. Transaction, and we'll be able to post, we'll be able to get we'll be able to put, so, that's. What. What this goal, for deploying. This network is coming up with this API and after. You do that you can simply, hook. Up this API with your front-end code and. And basically, update the network that way just, with using this, this. API. Okay. So. Um. This. Is where composer comes in so once you finish developing, these three files and you. Have this command, called composer, archive, create and this, basically, zips, up your three files into one and. File. Nothing. Complex here and. This file is called, the Business Network archive, as, some referred, to as a banana file DNA. Banana. So. And. That's. That's really what composer is doing it's taking these three files that we have defined and creating, this one Business, Network archive this one zipped file and. To. Actually deploy the network we have to have some credentials so, that's where these network. Admin card comes in and we, have a script, for creating these credentials. So. Once we have, our. Banana. File we have our credentials, and we, can actually deploy. Our. REST. API then, we'll have a nice. Swagger. Has this nice documentation. For the REST API which I'll show you in a minute here. Okay. So for, the sake of time I'll leave this for, later but this is an, online playground. Where you can go ahead and test your code, so, without installing, any dev tools on your laptop you can go ahead and take the C, code I've shown you here and deploy it there and do. Some transactions, and see the owners being updated so, this is I think a nice tool just to test quickly your, smart. Contracts. Okay. So, time. For the demo here. Okay. So. Basically. What I have done so. What. You see here is this github, and so, this is called. The code pattern so, part of my job at IBM is creating these open-source code patterns to help developers, on, board, with the technology, so, this is one. My coworker, created but, I think this is a really good, way. To get started and this is kind of the code, that is in this repo is what, I have just shown on the slides so it's the exact same code. And. Here, you'll have all the scripts that I talked about the start fabric, the download fabric the create Pier admin card you have all the scripts in this nice, repository. So. I'll go through some of these steps and at the end we'll we'll, create this REST API. Okay. So. What's. Nice about this github, it gives you a nice diagram of what, exactly, will be doing so. First. We install the dev tools I'm, going to skip that step just, for time, then. We're actually, generating. The fabric. Network and we're starting. The fabric and then. We are. Basically just generating. This banana file and we're, deploying. It and we're creating this local API. Local, server. So. That's that. Deployment. Is step, five, there. So. We have a few prerequisites, here and, just. I'm, not going to go through those here but, the, main tool. You'll need to install is this. Composer. CLI, so. That's what I'll be using to, package, this three. Main files into our DNA. Or banana file. And. Then the last tool and this composer. Rest server and this, just. Has some some, code to create. This nice-looking. Rest. API documentation so. This composer rest server. Package. Is basically just creating. This nice REST API for, us. Okay. So. The. First thing we should do is actually start. Our earth so first we just clone the directory, I've done that for now and now, let's. Go ahead and go into. Okay. So. You see here the same code I've shown you earlier so. We're in our actual, directory. Here so, first thing we want to do I'll. I'll. Just delete. These cards, from the floor clear. And then we'll start the fabric, so.

This Will take a little bit of time here but. What you see at the bottom is these containers. Being stopped and, and, then they will be restarted, again and they'll be running so the fourth things that I've mentioned before is the the. Database. The CouchDB, the. Order. That'll, take all the transactions, and actually place, them in some sort of order the. Peer the, peer will be running the smart contract on. It and generating. Some sort of output and then. The actual. Certificate. Authority, that will give out the public private key pairs to the participants, so. We see here that we have started our network everything. Looks good so far so the demo gods. Are with me right now so, next, we, want to actually create our admin, credentials, so, we have this create. Peer admin card. So. This in a second, we'll, create these. Credentials. For us, so. You see here we have this peer, admin, at hyper, letter fabric version 1 that's, our actual, card, here. So. Now we. Have created. Our credentials now we actually need to use this composer. Archive, create to. Package, our three files into something, we can deploy, so. The. Nice thing about this, repo is it automates, all of that for us so if we go into our package, JSON. We. Can see this. Composer, archive create, here. And. All. It's doing is it, taking our all the three files in our directory. And it's, taking that data, schema it's taking the lot of the JavaScript, code the logic and it's taking, the permission, files. And we. Give it a directory. To put those files in and we say, dist. Slash. My network DNA, that's where you will output, this file. So. Again just to show you these separate. Files I have the JavaScript. Implementation. Or what, I've shown earlier I have, the actual, data. Schema and then. The actual. Permissions. File same exact thing so if I run npm, install now it should create this, actual. Banana, file in my current, in, this district, tree, so. All run npm, install. So. Hopefully. In a couple seconds here we should get this nice, output so, we see again we, have this output, file dist, slash, my network DNA, so, we'll need to give, that file to composer to compose a rest server to, actually, deploy our API. Okay. And so, after that. There. Are some additional things we can do I'm not gonna test for the sake of time but we have some tests in here and then. We, can actually install, the network so, this, is the key, part and it's, taking, in my actual, admin card and it's taking my banana file and it's installing. The network here on the pier. Okay. So. I'll go ahead and run this we. See that the command succeeded, so now we've installed the network and the next thing we have to do is actually instantiate, the network so. We have to start the network and if there's any sort of constructor, any, sort of data that we build and the at the start of the network this is when that will happen, so. Let's. Go ahead and start, the network here. Okay. So, should, take a couple seconds, here we give our admin. Card we. Give our, like. Our. Net. Yeah our admin card and then basically we'll start the network for us it, will we. Should.

See Yeah perfect. Okay. So we start the network we can actually ping the network to see if it's working I'll, not do that right now so the next, thing we can do is actually, create. Our API. So. Let's go ahead and run this compose a rest server. So. This will ask. Okay. Clear. So. This will ask us for, our actual. Business, network, card so, that will be the, admin. Card we have made, earlier, so. Admin at my, network, and here. Asks for namespaces, if you say yes, it will have the org Acme, dot commodity. I'm, gonna say no for, making, it look a little nicer so we'll just say commodity, instead, of or acne dot my network duh commodity so, I'll say never and. I'm. Not gonna secure it for now just for the sake of time. So. Ask do you want to enable authentication. And. Okay. So I'm just gonna say. No for now. So. It's. Going to go. Into the types of our, network, and now we've generated, our REST API if. We click this we. Should see our REST. API here, so. Again, we have the commodity, if. We we. Don't have any commodities, created yet because, our, constructor, didn't create any and but if we this, is where we can go ahead and do like a get call and then we would see all the commodities in our network, as. This, system is like the entire. History of the blockchain so for the system now we should just see something like a, install. We. See the network is instantiated and, I, believe, just the the, basically just the first installation. So let's check that right now. Yes. You see here we have the start, of the network, and. Then we have added the actual admin here. So. What. I can do I can actually add a couple. Traders. Here I'm. Not going to go through the full a. Flow. For time but, I can add a couple traders and all of this JSON, that we need is in the repo. So, here is the data schema for the trader I'll just create once quickly. Post. It here and. If we try it it should give us hopefully. 200. Awesome. So, we see here the date. And if we go into our system, we should have this as well. Ok. Perfect so we have this add participant, we say we see that we add min invoked it. So. That's. What. We have with the system record so. This. Is how you, get. Your first hello world application, running, once, you have this API. Running you can go ahead and connect to your front end and. Then you can have this whole, history of transactions, you, can have more, complex queries, I haven't shown that but I'll show this in the next demo, so. You have more complex queries but, this is kind of the basics, of getting started just, getting to this point, so. Now I want to switch gears a little bit so. You, can kind of see this shirt I'm wearing is this, blockchain. IBM. Blockchain in collaboration, with Brooklyn roasting, so, this is a proof-of-concept I've, worked on using the blockchain. Cloud service, so, I want to kind of demo, and show you that now, so, I want to show this hello. World and then go into a little bit more complex, architecture. And schema.

Now. Okay. So close this up from now okay. Okay. So this is the main page for the. For. The activation. So. Really. The goal of this project. Was to show this transparency. For, all the key, suppliers, in the supply chain so, if the goal of Brooklyn, roasting company so this is the partner we worked with their. Goal is to show this, ethically. And. Sustainably, produced coffee, so, part of that mission. Is showing, this, fair. Fair. Price. That is paid for the coffee so. What, we should what we have here in this project is we have their actual, industry. Compliant. Documentation, that shows, that they gave a, fair, wage, to the coffee, growers that they paid and we. Have shipping, details such as like a packing list, we, have import, details, and. Then we have actual. Roast. Details so, before. The the coffee is actually brewed, and created, into a cup of coffee the. Brooklyn. Roasting company goes ahead and taste tests it critiques, it says oh it's maybe, not so good or it's really, good, so. Those. Are the main kind of components, so again I think what's. Important, to understand, with block chain is that, really. 99%, of the work and investment, comes as you're. Creating the network once, the network is deployed and out there there's not really much to be done right but, it's a huge massive, investment, to actually get it started I you, have to get all the different. Parties all the different suppliers agreed, on the same exact, terms you, have to actually you know build, the network like we have done it here you. It, takes a lot of time and investment right once, you actually. Launch. And deploy it's not not. That much work so, I think that's the key part is do, we need a bot chain and then, actually, taking the time to work with all the participants, and suppliers. Involved, and say hey are you ok with these, exact rules that we have. Gone by in this smart contract and at. The end of the day someone, needs to approve all these transactions. Right so there has to be someone either an external, organization or, someone that you give permission. To actually approve these transactions, so there's something called, like an endorsement policy, which, you can set up in your hyper ledger and saying, which member, is actually going to approve the transaction how do we know it's actually you.

Know A correct, or incorrect. Transaction. Okay. So. For. The next, ten. Ten, eleven, minutes I, want. To focus on the different participants. In different parties involved. So. The first party, I'll talk about is the actual grower, so. The grower is this Ethiopia. Co-op. And, we, see here, on. July 21st, 2017. We, buy a hundred, fifty bags of this coffee. So. At. This point a brooklyn roasting, has a. Document. That says look when we bought these bags of coffee we. Have given, this tax. To actually, invest in the local community, and this, is their way of proving this Fairtrade. Premium. So. If I click on view the blockchain and, it, should actually query my blockchain, and it, will show me exactly, what. Has. Been invested. So. We see that they have invested in road infrastructure, let me a little. Bit, we. See they've invested in road infrastructure. They've. Invested, in school classrooms, and, food. Security. Also, you can see that the total premium. They have invested, is 182,000, so. You may be thinking right now like okay this is just random data, where are you getting. This data from right it's like you're. Just showing these data, so. Now we can click on the view original, document, so. Brooklyn, roasting, was nice enough to actually. Let us publicize. These documents, so. What. You can see here is this a premium, invested. 182,000. Exactly, what I've shown you earlier, you, have the, school. Classroom, edition the funds invested. 30,000. You have the road infrastructure, and the food security, so. These, are some, of the fields we thought were important, and Brooklyn. Roasting thought were important to show to the, all. The customers. The different suppliers so, this is the war way of showing this fair trade and ethically. Produced. And, sustainable. Coffee. So. We have talked about the first part of our journey which, is the grower so, next we will have to actually ship this big, very. Huge batch of coffee I'm not, sure it may be a thousand. Kilos or a very big amount we ship this from Ethiopia, to the United States so. Now we need some sort of proof from the shipper that you, know we, have packaged all your coffee on this date shipped, it in this container. You'll. It'll, arrive on this date we have we have to have some documents, here so, that's the next part of the story here so, we. Can go back and. And. Just, to show you kind of my actual, API. That's running. So. This is the API that I have available for this this. Coffee bean demo so this is the same HelloWorld. API. But, just with a little bit more complex data schema so. Instead, of only one participant, I have four. Four, or five participants, so we have the grower, we have the shipper, we have the retailer right so. It's really that same pretty, much that same thing just added, a little more complexity, to the schema. So. If, I actually, go. In to, submit. Fairtrade. Data so. You, can think of this as we. Have a different, interface for this grower we, have they have their own application they. Sign in they authenticate, and they, have access to this rest. Endpoint, and they're. Able to submit or. Brooklyn, it will actually submit this, Fairtrade data through this endpoint and only, they can submit this data. So. We get we we, actually do a get here to see what's, actually has. Been submitted already. So. Again. It's that same. That data, that, was showing. In the front end right it's, really just doing a simple get call to this. So. You can see again the road infrastructure, here the food security. Classroom. Addition we have the some. More data that was not shown in the UI like the actual batch ID so. You can imagine if there's 100. Or 200 different, huge, batches of coffee we each one will have this unique ID so. You can actually, see, the process for. Each bag. Ok. So. Yeah when you click on this view the blockchain it's just making a call to my API, that's running in the cloud right now so. Second. Step here, is we have to show these packing, details so again I should I tell you you know we have to have some data for actually shipping so, this is the next step here. So. We click on view the blockchain and now. We should, see some more details, about the packing list so.

You. Can see the voyage number, the. Invoice number. Something. Interesting is that this has a reference to the grower so. You're. Saying who actually gave, these beams to be shipped you're saying grower 0, 2 0 1 so. You're saying okay who's grower, 0 2 0 1 if. We actually go into our, our. REST. API if we go into grower, do. A get, we. Should see our growers 0 2 0 wand ok, and, you. See here that's just simply the, Ethiopian. Co-op right, so. We see here that's who. Is actually submitting, these beans and. You. See here that who's. Actually going to. Receive. The beans so, this is this traitor oops. There's, trader zero seven nine one so. Ok. If, we go into trader we'll see who the who's actually picking up the beans. Do. It get. And. We'll. See that here. Ok. So I was already loaded so, you see Royal coffee who's actually receiving these Dean's okay. Again. We see the ship, name northern, Magnum Magnum, and we see the build landing, number 961. So. We can view the original document. Same. Same. Thing this is all coming from the. The. Coffee co-op so this is their proof. That we have actually shipped this, data or this this batch on this day so. We see the date is 2017. This. Royal coffee. Bill. Of landing number again you see that nine six one number and. You see the container number is is a, block. Down that's, just part of our agreement with Brooklyn roasting they didn't want to show, that to detail, just. For security, purposes but everything else they have lettuce, demin. So publicly. So. You see here that container. Number is redacted just for security purposes. Okay. So we. Shipped the coffee next. Thing about, how, long does this journey take two. Weeks two, and a half weeks. Two. And a half weeks later we actually receive, the container so now we have, to go into the container and see like did, we actually get the amount of coffee that was shipped or is, there damage is there, did. It spoil over the ocean. Is there insects. You. Know we have to confirm that we, got a good shipment. So. We can view the blockchain here. Again. It's just calling, my REST API and. Here. So. We see you know are there holes in container no was. There any condom stations how many bags do we expect it. Was the insect activity and. That. Again. That document. Is just coming straight from, this importer, and, they're the one that is actually receiving the shipment and you can imagine this big, importer, of coffee has you know thousands. Of shipler i don't know in. A, normal month maybe they have hundreds of these shipments right so they have to have good. Organization. To keep track of all of these. Again. You see on this documentation, the bags expected. You. Know condensation. Holes in container we, have people, that I've actually signed off on this saying look this is what happened on this date, we. Verified it and. That's. Just coming again straight from this. Submit. Inbound. Wait tally here. Okay. Yeah. So same exact info. Here that, you see on the front end. Okay. So the last step which i think is really the coolest. Part is this. Cupping. So once, they the. Retailer, buys this coffee, from this big warehouse, they. Go ahead and critique so you can imagine like I don't know ten, of these coffee. Connoisseurs. Sitting around drink, sipping a little bit Oh aftertaste. Is not so good or oh it's too acidic, Oh the taste is it's good but it's maybe. Not perfect, so, they have their own internal. Critiquing. System, so. This is what you'll see with this part of the blockchain you'll. See who actually. This. Brian. Actually critiqued, it what was his final score and you see above that you know aroma, nine you know this is all out of ten nine out of ten acidity, eight out of ten flavor eight out of ten same, thing we have this original, document, to show this here. Okay. Again. Same. Same, thing you see Brian the, realm of the flavor we, have some more descriptors, like it tastes like blueberry, a little bit lime honey. Okay. So. The last part, that I want to show you is. This. Of this, actual. Your. Cup of coffee so. What we did at this it was this big food festival so, what happened is every cup had this barcode, on and basically. One use when, you buy it or buy a cup or you know go up to get a cup of coffee the. Barista, or the retailer. Will scan this cup and when, they scan the cup there just simply calling my rest day and they're posting to, the blockchain so they're saying look at, this exact time and date I've sold, this cup of coffee to this person and we, say you know I have, you. Know Brian, was, the one that sold it the. Drink was iced, coffee. Served. At this time we, have all this information and maybe. This, is not maybe, necessary, in a real war scenario but we thought this would be a good way to show some of additional, functionality, so. Now let, me show you the cloud service, running, so. This. Is the IBM blockchain, starter, plan so if, right now if you sign up you should get a month free to develop, so. Right now you'll see my channel. Right now I only have one channel if I wanted to create, different, channels, I can do that and basically.

I'll Have private. Transactions, within each channel so. It's almost like a blockchain within a block chain kind of this is what fabric, offers, so. Again we, have our blocks, here we, see the last, time is 50 minutes ago so I'll post a new cup and. In. A. Couple, seconds here you should see it posted to the block I so does. Anyone have a random. Number. Three. Digit number. What's. Six. Six okay I'll try that maybe. Not the best thing to do but I'll, put that in so. We. Should see this. New block being added so it should be 721. We, should see that 666. ID into, the blockchain now, and. Once I do this I get once it's successfully in, the blockchain I can query and I can show this relevant, details. So. Again you see this you. Know 15 seconds to the last transaction to 721 blocks in a second, here we should see the details, of this block. And. We. Should see that. 666. Number right here. So. Yeah you, can see it so now we can query the blockchain for, that specific. Number. So. You can imagine I have just gone got, my cup of coffee and say I go home and I say okay I want to see the history of where this cup of coffee came from so. Here I put in my cup, of coffee and a couple seconds we'll get all that detail, so, we'll get the, exact time so, it's today 1208, you, know this is the type of drink this. Is your cup ID and, the. Type of beams you have in the roaster and then. You have the full timeline after that like okay, this is where the cup came from but where did those beams actually, come from right and you have this timeline and. That's, exactly what I showed you previously is this history of exactly where the beam came from so. I'm. Running, out of time here but maybe. I'll show you one, more minutes of the code and. Then. I will be out, of here so. The last thing I'll show you is this, blockchain. Beam code so this is online I will give you the repo name at, the end so, I'll show you the code here. So. Again I think the most important. Part is the model, file so this is what we have here, we. Have are all of our different participants, I showed you we have the we, didn't talk about regulator, but we have grower trader, shipper retailer we. Have our cup of coffee this, is what I show you earlier we have the cup ID we have the drink type barista, this, is the schema for it and. Then you have this big batch of coffee where you have multiples, cups, of coffee coming from so. This is where you actually put the data. For. The, Fairtrade. Premium the packing, list the. Weight. Tally, this. Is where the conditions, come in and then the my favorite part is tasting, the cupping details how good, it tastes all right so. This is the coffee. Asset, the big batch and then. And what, I showed you earlier is this poor cup this transaction poor cup it just takes in a cup ID and it generates this time stamp for us right, and. That's. More or less it and that's, the schema and then the actual logic. Is is. Here. I. Can, show you a simple, one so. Basically all we do is we get, our actual. Coffee from the blockchain so we get this asset. Registry, as I showed you before is this composer, API and then, we just set all the fields, of the coffee so we set the invoice, number we, set the bill of landing number we, set the loader vessel and then after we create an event I didn't show that but at, the end we just update. And. That's pretty. Much it okay. So, I will. Leave you with that so here are all the all the, things I have just shown you the github are all here. If, you want my actual, if you have any questions here, is my contact. Info. And. Basically. What I showed you today is, how, to get, started with this hyper ledger fabric. So there's this local, open, source you. Can install on your computer test, locally but. You will not get this nice UI to, actually inspect, all these you can still do this inspection, but, you know we have this nice UI you can create, different. Channels, so. I've. Shown you the open source version I showed you a little taste of the cloud, version as well so, hopefully you understand, now this, data. Schema is really that, most. Important, part of creating this this network and then.

Basically Implementing, a few transactions, there on the network, so. I've shown you that I've shown you this a proof of concept we are built with Brooklyn roasting which, is taking some of their supply, chain data and for. The purpose of showing. All. Of their suppliers more, efficient, and streamlined process. To, show ok I this. Second I've received this document. We. Have shown exactly what, time we received it we've signed off on it so increasing, this transparency, for both the customers, and the suppliers and, then. Just for fun every, time we actually gave a cup of coffee we added on watching too so. Hopefully, you have learned at least something about typer ledger and thank, you so much for your time.

2018-10-12

Show video