 Again, good morning, good afternoon, good evening everyone, and welcome to the session, which is a demo on Hyperledger Transact. So I'm Maroon, I work as a staff software engineer at Walmart Global Tech in India, and as well I sit on the Hyperledger TSC committee. So let's see, so in today's session we are going to understand what is Hyperledger Transact. So this is one of the projects which many people have questions on. So if you see Hyperledger Greenhouse structured, you will see that Hyperledger Transact is listed as a library project. And then many people do have questions on, hey, what exactly does this project do? And people want to know how to use this library project in their projects, or how to just start getting involved in the Transact. So I know there are some questions like these, which you maybe keep asking to others, and there are very less answers out there. So I'll try to answer some of those questions in this session, as well we will see a working demo at the end, and we will also try to understand what's happening within Transact space, and what are the new things that are getting built over there. And we'll also see how you can get involved into Hyperledger Transact. So this is one of the cool technology or cool way in which you can get involved or see what's happening within Hyperledger space. So what exactly is Hyperledger Transact? So of course Hyperledger Transact was a 14 project to be incubated within Hyperledger, and it's a library project. And when we say it is a library project, you might know that things such as having a library built and then stitching together into an executable file. So all those things should come to your mind. So for example, when you compile a simple C program, you generate a library and then that assembly code or the library code that you generate, you will then link it at runtime with some other executables. So you have your final program. So Transact is a library using which we can develop distributed ledger protocol itself. Let's say we have so many protocols within Hyperledger ecosystem. So we have Fabric, Sawtooth, Indie and Iroha. So if you don't feel like, okay, I think it is time for me to come up with my own protocol, blockchain protocol. So that's when you would go with Hyperledger Transact as a library project. So it's not just that. In fact, Hyperledger Transact, if you have your own protocol already and if you can adapt that to Hyperledger Transact, it provides you a unique way or a uniform way of interfacing your smart contract engines with your rest of the system. We'll see how that really connects when we see the architecture diagram. So what are the key points that we need to consider? It's of course return in Rust. So as long as you have your own protocol, return in Rust or a language that is compatible with Rust, you can straight away start using import the create and implement your own protocol. And transact provides plug-and-play model where you will see from the architecture how exactly it works. You can switch from let's say you start with Sawtooth-based transaction processor engine and then you feel like, no, I need for my transaction, I need a chain code processor engine. So if you write an engine that can process your chain code smart contracts and attach it to transact, that's all you need. So on one side you have any protocol working, submitting and it has interfaces to accept transactions. On the other side, you can process those transactions. Let's see what are core capabilities. So transact at its core provides these capabilities. It provides a way in which you can schedule your transaction. You can dispatch them for execution. And you also have a context manager and why context management is important. Let's say in blockchain technologies or distributed ledger technologies, you may want to run your transaction once and see the results. And only when everybody agrees to that transaction, then move on to formalizing that as a block or putting that into a block, right? So that you can finally form a blockchain. So this is the context manager. It helps you in maintaining that context information. It knows that you are at this stage. This is the data point that you want. This is your current state. And similarly, when we talk about state, of course, there needs to be a state and that needs to be backed up by a database and transact provides all that flexibility through its library plug and play model. And of course, there are multiple smart contract engine supported through transact right away. And you can implement your own engine as well. You can consider this to be like a SDK for writing your own transaction processor or smart contract engine module. And it also provides transaction receipts where you ask, I mean, you send transactions to this transact. It will process through the engine which you have. It has its own scheduler. You can choose which scheduler you want. Once it's all done, you get back the transaction receipt from it. So that's how cool it is. That's the library part. All this is taken care by the transact. So if you look at architecture of how exactly transact is built, you consider the gray parts which is on like far extreme corners of the screen to be your protocol specific components, right? Like for example, on the left side, you can consider that is your fabric peer node or you can consider that has your sawtooth node. And on the right side, you have smart contracts which are again written for specific engines. So you write engines, you integrate them with transact. Transact has these modules of scheduler execution adapters. It has database backends and a way to manage state, which is both providing key value based and mercury based key management, I mean, state management. So your distributed ledgers will be accepting transaction. It will have its own implementation of how to connect with another node in the network. It will have implementation of how to achieve consensus. And once it receives the transaction, you don't really need to write your protocol for the implementation in your node. You can send that to transact. Transact will handle all that. And on the other side, you have the smart contract engines. So if your smart contract is written in one of those language with these engines can understand, that's all you need. So you created your own protocol. Let's see what components are, what is it involved for you to implement a new DLT using transact. So if you have to write your own new DLT, all that you would need is make use of transaction receipts. And oftentimes, if you are implementing a blockchain protocol itself, you would be storing those transaction receipts into block. You'll either form a blockchain or you will store hash of those transaction receipts and form a network, something which is like done by in Corda kind of protocol, right? And of course, you will rely on these transaction receipts to know if you have achieved consensus. You will, of course, need to design your own networking layer. So these are the building blocks that you can do and rest of the things you can rely on transact to do everything for you. So that's how transact is helping you in writing your own DLT software. And transact can also, in fact, be used for interoperability purpose because of its multiple smart contract engines supported. So let's see a demo of how exactly is transact works and how to see it in reality, right? So this is a demo which is from transact. I hope you all can see my screen. So in this demo, you will see like it's a sample transaction that it keeps sending on to this network. So this transact library is used to build a sample application, right? And this sample application is written to handle transactions. So what this particular command does is, in this case, keep sending transactions to that sample DLT which is built. And let's see how it works, right? So for the sake of time, I have already compiled the source code. And what I'll be doing is just executing them in here. So what I'm trying to do is there is a sample DLT that is built, which is returned to handle Saber smart contract, which is running WebAssembly smart contract, the smart contract engine. And then I'm trying to execute by sending random transactions to that particular smart contract. And we'll see how it executes and the output which we see over here. I'm sorry for this. I think I spoiled my, wait, so I have another terminal with other example. I guess I spoiled my terminal on that window. So this is another example which is written using transact. So it's a simple program. It has its own scheduler service, which is using the transact's library. It has its own way to, I mean, execute those transactions using, again, transact smart contract engine. Over here, I am again using a sawtooth compatible smart contract engine which processes sawtooth's transaction families. And what I, when I execute, I have written a loop, like infinite loop within this program and accepting inputs from the terminal. So this would be your, in real world, you would have this node. You will have multiple such nodes implemented, which is making use of transact and having networking layer among them and also providing a consensus ability among them so that you can rely on the transaction reset. So when, in this case, when I execute a transaction, this is whatever I'm typing right now. Let's say I'm saying produce quantities of Apple, right? So this is a transaction that I'm sending to my own DLT, which I have built using transact. So when I send this transaction, the code is, it processed it. So ignore the last send error part. This is coming because of, I'm using single DLT. I'm trying to push it to the modules, which is supposed to not, which I should not be pushing it. So otherwise you can see that when payload was received, it registered a callback for that. And it scheduled that transaction, right? For execution, in this case, I'm using serial scheduler. And when it received the transaction, the transact engine actually scheduled it and executed this transaction. And it also gave the result. It execute after handling that. It wrote that onto ledger. So when I again entered, let's say, no, I'm trying to consume. I produced 10 quantities of Apple. Now I'm trying to consume five of them. You could see in the output that it read the value 10 from the ledger. It tried to consume five, right? And let's say I again try to consume. This time I'm trying to consume six. So this time the transaction ideally failed, right? And you can see that when transaction handler was executing it, it failed. It said transaction executor, it failed to execute this particular transaction. It says it read five quantities of Apple in the ledger, but it tried to fetch more than that. Tried to consume more than that. So execution failed. So this, I mean, the output which you see is directly done from transaction receipt. But you get the idea from how we can build our own ledger using hyperledger transact. I hope this was helpful. Please ask if you have any questions. Happy to answer them. So thank me for the link of this repository. I'm happy to share that. And first example, which I in fact showed is present in like this repository, transact repository. You can go to hyperledger transact link and get this example code. Let me again reexecute that transaction which earlier failed. Because I guess I executed it from long directory, which I missed. So what you see right now is the transaction which I was trying out earlier, executing by sending 10 random transactions onto a ledger which was built. So you can go to examples directory and you can see a stable command executor, which is making use of transact library. So I sent 10 sample commands. It started executing them. And some of them are set and some of them are get request on the state. You could find the output over here. And of course, when you implement your own DLT, if you would like to make use of these kind of structures, you will then go ahead and implement your own way of permissioning things, your own way of handling the keys and making sure like the right person is able to execute the transaction in addition to what smart contract already does. You could implement your DLT such that it's the governance is on chain for the way the saber does in this case. So that's all I had from this session. I see a question in the Q&A tab. Any samples available in GitHub? So the example which I just showed, both of these are available on GitHub. Go to www.github.com slash transact. The examples folder have the saber command executor, which I just showed. And you could also go to my personal repository where you find PCI front transact example, which I showed on the other terminal a while ago. So I see another question. Any live projects using transact? Transact as a library is currently being used in Sawtooth. And there is another project called Splinter that is making use of transact. In fact, Grid Project Hyperledger Grid makes use of transact in it.