Welcome, everyone, to Ethereum Development with Web3J and Java Hands-On Workshop, brought to you by Web3 Labs and the Hyperledger Foundation. We'd like to thank everybody for joining us today. We're very excited for this workshop. One thing to note this meeting, as with all Linux Foundation meetings, is held under the Linux Foundation Antitrust Policy. A link to the Linux Foundation Antitrust Policy is included in the links I'll be sharing in chat. As well as the Linux Foundation Code of Conduct. Through the course of the workshop, feel free to ask questions and chat. Unfortunately, in a format like this, it's incredibly difficult to do voice questions, so we're going to keep all the questions in chat. It also gives us the ability to capture the questions. I'm now going to turn it over to our three fantastic presenters, Connor, George, and Nishal. I'd like to thank everybody for joining us and take it away. Thanks so much, Sean. I'll just turn on my video so at least you can see me in the corner there while I'm speaking. Hi, everyone. I'm Connor Spencer, joined by George and Nishal, as well. George and Nishal certainly will be your guides for much of the workshop. I'm here just to give some historical context, as I originally wrote the Web3J library many years ago. Can we just go on to the first slide, please? Here's the overall agenda for the session today. As I said, I'm going to just kick things off with a bit of background context. And then Nishal and George, the maintainers, will be talking about really the roadmap, getting involved in the project, the architectural overview, and they'll be doing the actual the demo and the workshop and fielding many questions as well there. Shall we go on to the next slide? To give you some context on me, I guess my original background was in institutional financial technology, so it was really working on these large applications for various different banks over the years, covering lots of different asset classes and supporting different types of businesses in those banks. But I think the best way to think about it is some parts of it were writing very high performance code. Some of it was more about implementing complex business logic in code and with less of a focus on performance. But I think the point was it was quite a good amount of experience building these large sort of systems to serve institutions. However, back in 2016, I got interested in blockchain. I, in my research, really found Ethereum. Ethereum reminded me of Linux back in the late 90s and early 2000s and that there was this technology with this amazing community around it. And as a result of it, I wanted to find ways to contribute to the ecosystem. I'd spent all of these years working in large corporates who are building on the JVM, going back to the early 2000s in the sort of subsequent 20 years. They built large parts of their platform infrastructures on this platform. And with all of the discussions about this transformative potential of blockchain technology, I thought there was a fairly obvious problem that needed to be solved here. And this was to enable all of these organizations to work with what I believe to be the most relevant and important blockchain technology Ethereum. So I wrote the Web3J library back in 2016. That was when I sort of put out the first release and then one year later founded Web3 Labs. And in the years that followed, I'll talk a little bit more about what Web3 Labs does in a minute. But I was very involved as well with standards creation. I was the chair of the technical specification working group at the Enterprise Ethereum Alliance, which is a role I did for three years, where we produced the world's first Enterprise Ethereum client spec. I also wrote a book, the Blockchain Innovators Handbook, which is really a guide for organizations wishing to implement blockchain technology there. And also there's podcasts as well, the Web3 Innovators podcast. We go on to the next slide. I believe the guys are going to do a quick intro about themselves as well. So, George, over to you. Yeah, thank you. Thank you, Vanar. Hi, I'm George. I'm a senior software engineer. I started my career more than 70 years ago, mainly worked with Java in different kind of industries, such as FinTech, Pharma, and Life Science and also Automotive. For the past two years, I've been here with Web3 Labs, helping enterprise customers getting the most out of interacting with Web3 Space. And also I'm the maintainer of Web3J and an active contributor of Hyperledger Besso project. Nisha, if you'd like to step in. Yeah, hey, thanks. Thanks, George. So, hi, everyone. So, I am a backend developer and been developing Ethereum ecosystem from past three years. And also I'm working with George as a maintainer on Web3J and been with Web3 Labs from past one year. And yeah, nice to meet you all. Thank you. Okay, so to give you a little bit of context about what Web3 Labs do, we are a decentralized infrastructure solutions provider. We're based out of the UK, but we have staff in a number of different countries, such as George and Nishal here. But really there's three things that we do. One of them, which we'll obviously be talking a lot about today, is the Web3J integration library, continuing to maintain and support it, because we believe it's a very important piece of infrastructure for the entire Ethereum and enterprise ecosystem. Without it, as I'm sure you'll see, there's an awful lot of code that would need to be written every time someone wanted to talk to Ethereum. So, we believe it's a fundamental public good that really is needed to serve the community there. We also provide support for Hyperledger Besso. So, George and Nishal also work on the Hyperledger Besso project, and there's a nice reciprocal relationship between the two projects in that Web3J uses parts of Hyperledger Besso inside, and Hyperledger Besso uses parts of Web3J as well. So, both are on the JVM platform, and there's some nice crossover there as well. Then we also have our Chainlens blockchain explorer. So, Chainlens, we've got a little screenshot of it there, but it's a very fast, modern and efficient block explorer. So, I'm sure many people are familiar with that, but what they are. So, when you run up a blockchain network or AppChain or Layer2 or Layer3, or whichever sort of flavor, an explorer is a key piece of infrastructure for network operators to see the activity that's happening on the network, but also for users to actually have proof of activities taking place when they undertake a transaction. So, that's something else that, if you want to learn more about, you can learn about on our website or chainlens.com. Customers, we're fortunate to have worked with a number of different, both, I guess, native Web3 companies as well as traditional enterprises as well. So, scanning Microsoft, JPMorgan and Vodafone, some of the more traditionally well known names, but also our three consensus and had a number of grants from the Ethereum Foundation as well for Web3J. Let's move on to the next slide. Okay. So, I'm just going to give a quick overview of Web3J, and just to check, George, you'll be jumping in after this, yeah? Cool. So, in terms of Web3J, it's, as I said, the Java integration library for Ethereum, but what does that actually mean? When you have a Java application, if you want to talk to the Ethereum network in any way, when I say talk to, it can mean read data from the Ethereum network such as, you know, what's happening with these blocks that are being created on the blockchain or the transactions within them, where it could be sending ether the cryptocurrency from one address to another or some other token, it could be deploying a smart contract, or it could be transacting with an existing smart contract. All of these sorts of activities, if you're on the Java platform, could be done using Web3J. It's basically that, and you can see it in the picture here, you have this sort of integration layer where it talks, this JSON RPC protocol, which is the standard way in which we communicate with Ethereum network nodes, but what Web3J does is that it takes care of all of the heavy lifting there as well. So, it enables Java developers to work with Java types, even though the underlying platform that they're dealing with is the Ethereum virtual machine, which has its own virtual machine in the same way that Java has its own virtual machine. So, it takes care of all of that type mapping behind the scenes, but also does things like the cryptographic key creation and signing, the encoding and decoding of data. Ethereum uses a number of different types of encoding and decoding services. You have what's called RLP decoding, which is like a wire protocol decoding that gets used in transactions. You have ABI decoding encoding, which is used for smart contracts and all this sort of stuff that happens behind the scenes. Web3J takes care of it also. Java developers can keep working with Java and do everything they need from within their Java development environment with the one caveat that the smart contracts themselves are written in Solidity, but when it comes to deploying and talking to those people can work within the well-known Java there. So, that's kind of, I guess, a very high-level overview of Web3J is, and I'm going to pass over to George and Nishal now, and they're really going to take over from here and really get into the details and get everyone's hands dirty as well during this workshop. So, over to you guys. Great. Thank you, Ghanar. Thank you so much for the great intro. And now just to go further, I will add only a few points over the intro related to Web3J that Ghanar just mentioned. And why exactly do we need this Web3J, this Java library that allows us to communicate with Ethereum? And one of the main reasons is that we know that there are big enterprise systems that are running since more than 20 years on Java on the GBM. And it's really hard to figure another way in order to change the infrastructure or the software that are already used in there. And for that, Web3J comes just in hand and really helps with wiring the existing enterprise GBM system with the Ethereum network. And also, like when we are thinking to enterprise, we are thinking that, okay, maybe we need in their library that was heavily tested and we know exactly what it can offer. And there is already a community, preferably we would like to go with something that is open source and updated day by day. And we can assure that for the past seven years Web3J has been intensively tested by the Ethereum community. And we can say that it's probably even more that now it's part of the Hyperledger foundation. Also, Web3J in terms of functionalities inside the software, it's suitable for certain types of mapping from the EVM types to the GBM. And like this, allow for an easier map and interaction with the Ethereum ecosystem. And also related to the next point, it has some really nice testing capabilities that are used in even if the development of the VESO Hyperledger system. And that testing capability is that it offers an impeded EVM node in order to run unit tests or integration tests. And also, this great functionality we'll see later in this workshop. Also, the architecture, it's modular and you can use only what you need and we'll go in details in the next slides. And the last thing is that it offers great privacy transaction support for the private networks, especially when one example in here we can measure. As an example here, we can mention VESO Hyperledger. So, going next, a roadmap. Obviously, like even if it has like seven years almost since it's intensively used, we are still trying to make it better day by day and add some new functionalities that are asked by the community. And as a roadmap for this year we'd like to have a version of the Web 3J Android updated because the one that the existing one was updated now two years ago and some functionalities are missing. And also a really nice thing that we'd like to have is to update and enhance the IntelliJ Web 3J's validity debugger for those of you that are not aware of it. There is a debugger that implemented which is using Web 3J and can be added as a plugin to IntelliJ and allows you to see the stack trace and everything that a transaction would offer as an example you could see it in the remix debugger. Also one thing that is missing in Web 3J and we'd like to add is generic struct functionality and also there we are collaborating with some contributors and we are trying to add this as app and of course after we'll add all of these we are aiming to release a new major version of Web 3J and initially we'd like to give some details about getting involved. Yeah thank you thank you George. So everyone like whoever you know who has never did coding wants to get started or who is already in the Ethereum field and wants to contribute they all are welcome to you know get involved with the Web 3J and file bugs or solve bugs and respr even if it's a small pr. First thing is if you find a bug so ensure the bug was not already reported by searching in the GitHub under the issue page if it is already reported then you can give it a plus one and add some additional comments and information whatever you have so we will look into that and then if you are unable to find the bug you can open a new bug and ensure like all the title and description is clear and you can provide as much information about that and even the code sample and how to reproduce the error you can you know just give it about that so we can you know reproduce in a local machine and we can fix that as soon as possible and if you have written a patch or a fix for the bug so make sure to open a pr a four car Web 3J repo then raise a pr and describe what the solution you are providing and which bugs you are solving which issues you are solving and make sure the your pr you have like executed the spotless apply so the build won't fail and you can you know add me and George for getting in reviewed so once we review the pr we can merge it and if you are want to add a new feature or want to change existing one you can directly contact us on discord or even like mail us and we will look into it and if you have any other questions or discussion you can surely or like contact us over discord so this is the discord link or there's a qr code you can scan it and if you are not able to find the web 3j channel then join the hyper ledger server once you are joined the hyper ledger server you can or like contact us over the web 3j channel and the other thing is GitHub link which you can scan it and you can look into our code the next slide okay so recently we have we have the hyper ledger web 3j wiki page so you can go over that and the community space you can join the mailing list you can get all the information new information and announcement new web 3j releases over there and you can also so we will be having our first community call on 3rd april so you all are welcome to join there or to listen and to contribute whatever you have in the community call and we are going to have it every or two weeks or after like every two weeks or like twice in a month so you all are welcome and you can like scan this to our code and get an invite for that over to you george great thank you nisha and also just to finish with the introduction here are our details related to wait for labs also another place where we can find the main initial and corner in order to help you with the way 3j were with any related blockchain stuffs okay so with this slide we are officially starting our workshop from today and we have some as some of you may see in the description we have several topics picks that we'd like to cover with practical exams and also like with the theory and we'll start with the architecture as i was mentioning in the previous slides it has a modular architecture and by this what is and what is really cool about this is that we can import it in your project or add it as dependency the only what you need and for example here are added the modules available in the web 3j and here is a short description of every of it and we can take a crypto module and we can see that okay it offers support for the wallets for the key management also lately i added a new functionality which is the json key file format that can be used also in generating for for example identity a decentralized identities and also as other modules we have the code generation we have the console here the code generation is used in generating the code contract wrappers we also have the tuples we have the utils modules and the utils it's used what it really offers is are the hashing functions that are used in order to generate the right data hex data that should can be sent further to the ethereum network and also i should have a project open here one second because i would like to navigate with you a bit throughout the project so i change my screen i hope i change the presentation screen i hope that now the intelligent is visible yeah okay great so as we were mentioning before we are looking for some new contributors and just to give you like a spoiler this is the web 3j project the way it looks like here here are the projects flitted out in modules and as i was mentioning in the beginning we have the crypto and here in the crypto we have the specific classes and for example also in crypto we have the cryptography classes but also we have with cryptography automatically comes the signing and here we can see the signing class and also we have this module that is support interactions we get and also in here we have in order to support this interaction we have also some rpc method and also related to the rpcs we have we support the full i mean we provide support to the entire api rpc which is available now and used by the evm clients okay and obviously you can find more like during your contributions or tests or whatever and we are looking forward to find your feedback and as was initially mentioning your contributions on the github report story okay so now going back to the presentation the next thing that is also that cannot be also involved in the architecture and it's part of the web 3j are these two projects which are web 3j unit and web 3j evm and the web 3j unit what is mainly it's a g unique extension that is used by the web 3j in order to execute it test and by this extension what i want to say is just to give an example just let me when the repo to show you a practical example of the unit second i finally don't share it right now so and also just as parenthesis we have example projects for most of the projects that are used by the web 3j in order to be easier to understand okay so in here we have an example of the unit and by this what i wanted to say is that this web 3j unit acts as an extension of the g unit and by this is that it mainly provides this annotation which is a evm test and by this when you are specifying in here we can see in here the test annotation specifically from the from the g unit it what it will do it will create in behind a node evm node and depending by the type that node will be beso node imbedded node or get node and when this takes place and runs all these arguments in here are coming by default and then you can execute when having all these three here you can execute the contract the way you want in order to test it but also for this we'll have a practical exam when we'll get to the year c20 in token practical use okay and as i was mentioning on the web 3j unit this this one can run the evm nodes like beso or get nodes those can be run in a container or also we have the possibility to run it as a java process and by this we have created the web 2j evm project that gives this support but i think it will be just to go back i think it will be more understanding and more easier to understand when we'll get to uh to do the practice okay and now we'll switch to the hands-on demo and for the beginning we'll start with the year c20 to contract smart contract that we'll try to execute okay so i will take out this web 3j okay so also another uh another thing that i wanted to say we'll do the demo step by step in order for you also to be easier to do it in the same time with me or if you come later and check the recording on youtube youtube to be able to do it as a tutorial okay so first let's generate the year c20 token smart contract and for that we'll use the terminal okay so first we will need to have installed web 3j cli on your computer and to install it we shown in i don't know how many of you have been there in the presentation that we kept a few weeks ago but i will do it again although i have it already installed on my environment but i will just show you the output and the comment so this is the comment to install web 3j cli this one is also available in our documentation things that were shared here in the chat okay so it shows here that i have already the latest versions and okay next thing that i'm looking to do is to generate my new year c20 contract so for that i will need to run this comment this comment will create by default year c20 project which will contain a wrapper of the year c20 smart contract and also the solidity rc20 smart contract but i would like also to customize this a bit and for that i would just mention a different package name and for that i will use con.org shop and also let's specify name for it and it would be okay so now the cli is taking care of creating this project but in order to go further i will need to specify the token name and let's find the token name and let's say it will be orton from or shop and token let's try that okay and also a symbol let's go with w tn and also in here we should specify a supply in order for this token and it will go with a lot of lines okay so it seems that my project was successfully created and now i open it in wgj to show you how it looks like okay so there we have the new generated year c20 project which as i was mentioning it contains the year c20 token wrapper also in here we have the solidity version of the smart smart contract and if we in here we have a start of class that has in the main as the first action the deploy of the contract but we'll update it a bit in order to make more sense i mean to be easier to be understood and use okay so we'll do some actions with it and we are looking to deploy it on a network and also transfer some tokens to a new address and further allow that address to transfer further that those tokens so so for that what i will need first is a test network and most of the time i prefer to use vessel uh hyperlager vessel network and i'll just say and start to train now i have already run the restart command but what i can do is to run it again maybe some of you don't know about it and when we'll execute again the tutorial will get lost so first i will need to remove this folder which was created okay and now let me find the method that starts up the big start vessel network oh okay so this is the method that helped me spin up like which helped you create the local folders with all the configurations that you need in order to run vessel and for and in order to and you in here we have some options that we need to select in order to give go further we can this one offers you also the support for the private transactions and also some options for the block explorers and some of and one of those uh is uh chain less okay cool so it seems that the folder was created and now in order to start the start we we need to go here and run the run script okay since that i didn't uh didn't start my developer engine so we train now and in here we can see that i have already some test containers that i run before let's remove this okay dog reads clean so now we're running the network okay cool so it seems that the network started this is the rpc endpoint and also we have we have in here the explorer and also at other metrics that we can use for the network but now let's get back to our your c20 contract so whatever need in order to deploy my your c20 smart contract is the json in rpc htpa service endpoint and also a private key for the for an account that will be able to run and execute the deployment of the smart contract so let me take this and add it here okay so this is the node url and this one is used in here in order to create the web2j actually this web2j is the entry point to communicate with the ethereum and for that as i will use this later i will add it here and also created as a private static from here i will clean this up a bit in order to make more sense and in terms of credentials as i as i was mentioning i will use a credential object using the uncreated or created based on the private key and for that i won't i will remove this as i won't use the wallet option okay so and one second to paste here also the product key okay cool so we have the web2j we have the this one is the web2j service that allows me to connect and also to interact with the network here we have the credential and in here we have the deploy method the deploy method that will help us deploy the smart contract okay so there is not and just to talk about to be the deploy method here it takes as arguments the web2j service the credentials also like you if you run run transactions still knowing you know that we we need to place in there some gas gas limit and gas price in order to have our transaction executed and further it takes as an argument the name of the token the symbol and the initial supply okay so now let's execute this also this runs in debug mode so we can see most of the actions that are happening in behind and it seems that our transaction was executed and in here we can see the trace of the transaction and one second in here as this airc20 gives the support to use this command in order to get a address to which the contract the smart contract is deployed and it seems that the address is this one so we'll copy this and add it here okay and we'll save it as the contract address and also from now on we'll test we'll send some test actions to the this address in order to make sure that okay our contract is in there and for that we'll clean this main class and actually i will extract this to a new method and let's call this deploy and comment it out as our contact was already deployed oh also George this question that this java references built-in or not in ERC in the digital library so you can show that also like how we can how we can if it's not okay sure sure so anyway like everything in here was saved we'll run that so we have the solidity smart contract in here and the way that this project was mainly generated is by using the web2j greater plugin and like for example if you create a project from scratch and you just add the web2j greater plugin and would like also to add in it a solidity smart contract and generate using only this project a wrapper for it what you can do is that you will need to add as i was mentioning the web2j plugin mentioning here here are some actions in order to here is a web2j task that needs to be added in order to have the contract generator task available and for that you will need to add this and mention the package name of the new wrapper that you want to create and also what exactly what smart contract would you like to include from this solidity folder and for example if i'm going here and i will just remove this ERC20 wrapper what we'll notice is that okay already i'm getting a compilation error because it's not able to find the plus and it's something that we expected but i can regenerate that by going here to gradle web2j and generate contract wrappers and if i'm going back here i can see that contra this wrapper was generated again and already the main class it's able to find it and to solve the compilation error uh hope initial this will answer the question yeah thank you thank you George okay great so yeah just okay back to our our interaction with the ERC20 next thing that we are planning to do is to see okay if our contract is really in there and it has the simple dimension supply and for that what i would like to do is allow the function sorry to interrupt again so users are asking about how a bi and those bin files are generated how the bi bin files okay there is as i was mentioning there is this generate contract wrapper and in here mainly in behind this run web2j takes care of everything like it takes the wrapper it takes the text of the solidity smart contract and based on that text mainly is doing a parsing and based on that as i was mentioning in the slides at the beginning we have support for most of the types that i mean most sorry all the types that are in solidity and based on that we are running some generation code and that generation is just parsing the solidity smart contract and creating the wrapper needed based on that and we can go in here like to show some more details in here the way that we choose to generate the wrapper is to create to create a class that has static fields and methods and also most of all of them are public in order to be easier to interact to and as you can see in here most of them are returning where it was uh are returning some type references of addresses or others are returning some other specific responses well all these specific types are implemented in web2j and acts as a wrappers as wrapper for the solidity types and also these wrappers are further and in terms of wrapper i'm i'm referring to the wrapper type are for further map to the java types and this is how the wrapper is generated and also based on that we are using in behind there is another library which is the web2j socket and that web2j socket it's using the solidity compiler in order to generate the bean file and the abi file so mainly we are rely for those we're relying on the solidity compiler uh hope this answers your question yeah yeah thanks okay okay great okay now getting back here uh just let's read this loading the method load your c20 great method and what we'd like to do is the following so this time will also will interact with the wrapper in order to load or contract and for that there is already a method on it which is load and this one receives also almost the same credentials except that we don't need this time to create to send the name the symbol and the supply because the contract was smart contract was already deployed the only thing that we need to send is this to add in here is the smart contract address okay and uh most of you will notice that by interacting with the wrappers uh it's not enough only to hold the deploy method or for example any other function that we'll see later on we also need to add the send method uh at the beginning because this is really what triggers our method to be sent up or our execution to be sent up to the evm's but in the case of the loader there is already a send on it and that's why we don't call it uh this time too okay so in here we have the rc20 and we are loading it from this address and other thing that we are planning to do is just to do us just we'd like to print the supply of this rc20 token smart contract and for that we'll just go with this approach okay and let's see what method we have to get the supply okay there is in here the total supply and i go with send okay this will throw it's possible to throw an exception for example if the web2j that was sent to the contract in here the web2j service if it was a wrongly configured or anything else we could expect any exception okay but uh just to be easier to read i will do it write it like this should be a big integer the supply okay and now if we are executing this okay so the transaction executed we successfully loaded the smart contract from the address to which was previously deployed and we can see in here in the log that is the right supply on it okay so going next what what else we can do is that like okay we have the this here's the token that has already sent some supply on it uh we what we can do is to call a transfer function because i mean this is what the supply should be for like to transfer from one account to another okay so i'll comment this out and i would create the new server okay so every time like if you like just interact with the smart contract and then obviously the application stopped you need to reload it in uh or after you start up again your app and for that i will add it again here and again try to do and try to reload the smart contract also let's bring the success message okay and now what we can do okay if we're transferring this to an address is that we can create a we can we should add a new address here server let me find the address that should be in here to this one also we can do a check on it to make sure that it doesn't have any and also i mean check to see what is the current balance and what will be the balance after we transfer the tokens so for that what we need to do is to again to print here a message to be able to see the balance that we and in order to get the balance your c20 has already a method on it and we'll use that and that will be your c20 dot should be something with the balance of exactly this one balance of receiver and also not yet about the send okay and now we'll do another log here with start transfer and now we'll just do our transfer and we'll call the transfer method that is already on the smart contract and we'll put in here the receiver string and also the value and let's go for a big and the value has to be big decimal i'm sorry big integer i used to say big decimal because like when you work in fintech you use that most of the time and let's use big decimal that's sent to 20k i guess okay and send okay for most of the methods in here even if we like might might look that sent or was for most of the time are the returning different types and in order to like figure out what type it's exactly returning in here you can rely on the compiler and the suggestions because we can mention it here like we saw and as we can see the automatically suggested the transaction receipt as a type okay cool so now we'll print another log with the transfers finished let's say transfers successful successfully executed and now what we can do is that we can also print the transaction receipt and also now we can check again the balance of the receiver balance after this time okay and let's see what we get keeps executing okay so the execution took place let's see if we got our logs let's look for first for the balance before okay so it seems that for this address the balance before it was zero and after we can see that the transfer started and let's see where it successfully executed okay so it execute it finished to be executed right here and also this is the transaction receipt and the receipt mainly is this the result of the execution and now if we are looking to for the next log we can see that okay the new balance of this receiver is 20k so our transfer was successfully created but taking consideration that we send it our token like from the address with which we deployed the smart token and also the smart token the smart contract token and now if it will be to transfer again the amount from the receiver from this world receiver to a new receiver we'll need to call the allow a method on the smart contract in order to okay to ask the smart contract the owner to allow us to send further the tokens and for that we'll just create a new method and let's say let's call this transfer from address one actually let's call it a transfer from receiver to maybe you'll find some better names okay let's call this receiver one okay create this method and pretty much the steps will be the same like again we'll load the contract and we'll call this ERC 20 token original actually now we'll keep this as it is and now as I was mentioning we need to call that approved function and all the allow function in order to be able to send from this receiver money further to a new receiver and for that we need to create a new instance of this smart contract actually to load it and we'll say this ERC token let's call it sender so this will load from the same address except that we could use the credentials of this receiver and for that we'll create some different credentials for this sender and let me find the private key of this okay so update and use this in here in the credential sender oh great and now what I would like to do is that first I will check the sender balance and for that I'll just copy this line here add it here balance before transfer and it will be the balance of the sender so then let me rename device sender sender credentials and call it is also this address because this will be the new sender okay again for the exception good so what we are doing is that we are checking the balance of the sender then we are creating a new instantiation of this actually we can move this here to make more sense okay and so what what we did so far is that we instantiated two tokens one based on the regional address original credentials and the second one is based on the credentials of the sender and now what we are doing is that we are checking the balance before the transfer and now what we need to do is that in order to be allowed to transfer we need to ask for that and we'll use the ERC to any token sender in order to allow the ERC rule and it will be the spender address which is the sender one and the value let's say that it will be able to figure out let's say that it will allow to transfer only 500 and now if now I should be able to transfer from this sender to a new receiver and I will add in here a new receiver okay and now we'll all we'll use the original ERC to any token instance and we'll use the sender receiver and the value will be a big integer of let's say four because it's below the amount of the mention here okay and also let me print the balance sender and here it will be receiver balance okay these are two are before the transfer and now what we'll do is after transfer or George there's a question like why are we using two instances here you are secretly well we are using two instances because we actually I wanted to show the difference between the difference in which if you are using to like try to approve from the original address it won't work and for that we'll need to add the a new ERC to any token instance in order to be a with the sender credentials in order to be able to run the approve because else like if you are if we were supposed to go from this from the original ERC to any token instance and run the approve or even go directly without the approve for the transfer from it it wouldn't have work because this is also specific in the Solidity smart contract interactions for example I can comment this out and like avoid using sender approve and use only the direct I mean use only the ERC to any token original credentials and try to execute this you will not you will see in a few moments that here with it will fail here on the transfer from it will fail and also like we can put in the soft okay and we can keep it like this balance before and balance after sender and here we see okay so we have the sender we have the receiver okay and then in here we have the transfer and also the approve let's run it first without the approve even just run the transfer from to transfer to and I mean this is the way that ERC to any smart contract was designed to run okay and let's also rename this because it's ugly and transfer from sender to receiver oh just keep it transfer from it's pretty intuitive okay and start running it okay this is the sender balance we can see that we run into an issue and one second I will we will go through it okay so just first we investigate the logs we can see that okay this is the sender balance before and let's look also for the sender balance and we don't have the sender balance after unfortunately because the execution failed here and also let's look for the receiver balance also in here the receiver as it is new it has also the value zero good and now if we're going back let's see about this a bit can see that we got an error here you see on the transfer from and the execution was I mean the reason is executionary but because it wasn't able to transfer this from this address to the other address okay and now if we were thinking like okay then maybe I should approve this sender to send further and for that we will run the approve on the sender but here is the instance of the token which is using the original credentials that are used to deploy the contract what I will do I will just run again this method okay so we can spot in here the sender balance also the receiver balance and again it failed because on the same step it didn't succeed to do the transfer but now if you'd like to go and approve this and send the approve request on the instance that has been loaded with the credentials of the of the sender which is this one here hopefully this will run with success so okay so we have the sender like I just want to add so basically if you when you're loading an ERC point you're creating an object so if you see there's a parameter credential so whichever credential we are using on that account we will be calling all the functions on the smart contract so first we are loading using the original account so all the functions will be called on the original account and the so we are creating one more because there's a different address different account right and we want to call or that that's why we are creating two objects yeah it seems that it failed for the same reason let's check again all the parameters that we have placing here because I could have these a little lost on sender credentials so that just to make sure that is the same with the sender also like this we'll find out how to debug it so this should be the sender and the credentials okay what we can check is to see the allowed allowance that was given to this transfer from sender okay here is the sender approved you can check how much was allowed for this to spend so it will be a let's go yes i mean dot allowance owner should be the credentials and the spender should be the sender and adding a message to differentiate it okay let's run this again to see what is to be the output yet it's still executing check the allowance okay this is a remote function call that which is returned as i was mentioning i've got the send here okay i found out what i was missing in here in the approve it's actually it's not the sender address because the request it's made made out from the sender i should have paid attention to your comments initial earlier and in here the proof should be the actually the owner because we are sending for i mean the sender is sending an approval request to the owner and that's why it's sending from this the contract instance that was created with his credentials and one second i will just update this in here okay okay let's see last time the allowance was printed yeah the allowance was given but it wasn't the request wasn't paid properly yeah so it seems that our transfer executed and we can see that the receiver received the balance of 400 and also if we're going further we see the other balance of the sender that right after the transfer the sender balance was 1900 so yep seems that our approved request was accepted and the money successfully transfers from one account to another and just to run another test i will just comment out this approve and also the sender and i will try again to load not this one this and i will try again to send the same value from the sender to the receiver again 400 keep in mind that the last time we just approved only 500 from which 400 already spent so typically rain i mean we expect now as we are running this again uh this to fail because 400 is bigger than 100 that left in there so execute this again let's check the balances in the meantime sender balance before transfer the same as before as we i see oh okay it failed accordingly to our resume and also if you are going to check the receive balance it does 500 though for those 400 that was or earlier transferred and now if we're going to the stack trace on the exception we can see that again it was the executor it was reported as we went over the limit yep so this is what i was mainly looking to show you related to related in interacting with the ERC to any token hope it makes sense nishol are there any questions related to what we demo so far oh and also it was basically around this uprooting and i think i've already explained that okay and then we had and then we had i think some questions related to like one one user is not able to download basically install the web 3c li so i have given that instructions okay yeah i think that's it and whatever we are have in the chats i'm okay and hope everyone is still there i didn't that wasn't boring till now and i don't don't lose your attention forks oh because we're still thank you and because we still have a lot to show you okay great so this was the demo related to ERC to any token but and now what i would like to show you it also how you can you can you are you'll be able to test this smart contracts like you using a unit test or integration test and i don't if you remember from the slides that i presented earlier there is the web 2j unit and that web 2j unit it mainly mainly it is an extensions of the g unit and just to show you how you can easily interact with it and test it i will just show you this test wrapper that was generated and what we have in here are just the methods that were generated by default but if you would like to run this like most of you will notice that most of them will fail because these were added only as like as a draft as a sketch in order for you to be able to generate and to write and that will help you write the methods the test methods that you need so i'll comment the comment out most of the methods that will fail okay and now let me just show you how to rewrite this in order for you to be easier to interact with so what i will do is that i will add this before all i had for most of the instances and i will just run through only a few tests and those will be the name check and also let's check the symbol cool so you can see here that this was generated and okay and in here we have like what it looks like what it looks to a unit test so starting from the top we have in here this annotation this extends the g unit annotation and mainly what it says is that okay when you start this test you will be starting in behind the gvm process that will run an evm note also this can be customized and like uh we can mention in here some other types and those could be for example basso a no type basso or also get and also this can be customized and using the compose and use a local compose file with your own configurations that you'd like to use in order to run your tests but for now i will keep only the evm test okay and let's see what else we should we should update in here good so as most of you already know here is the before all method and this is executing the deploy and we can see in here that again is deploying drc to any smart smart contract with the data needed the token name the symbol and the amount and in order to like i mean in here we can keep it like this where you can update it by your needs and if we are keeping it like this like this with the replace me fields let's see what it will return here so we have only two methods left in here which are not commented out so yeah let's get this started okay so obviously this one pass like we have the assertion which are trying to assert this replace me with the data that we're retrieving from the smart contract but what if we are going here and change this to the token name that we just created with the work done let's write it with log it's important and important and run this again obviously like these two are failing because okay it says that we are expecting to replace me and we are and instead we are getting important so let me update also this here so now before running this will deploy again the smart contract and yep this time will pass because it's getting the expected values and also what i would like to run is to change this to a basu type to see just by curiosity what results results will get back okay and if you remember we are already running a basu environment which are using the well-known ports or the well-known RPC ports so like we should expect to have an error when we'll spin up this again if it will run properly because this will also try to start up to start in the back end a token environment based on basu so let's run this so yeah as i was mentioning most probably we have we have an initialization error and that error should be because we it's not able to allocate the port because it's already the yeah exactly the endpoint because the port is already allocated so now what we need to do is to go back here and stop our environment let's see what scripts we have in here we start to remove let's go with the remove exactly to clean everything so just to okay to look again at it everything's clear so now if we will run this we expect here a basu node to start with the expecting port 80 okay and as executed quickly we might see that it's i mean whatever i need to say is that as it executed quickly also the gvm to care of the our container and the close it and like this you can write whatever unit test you may need in order to make sure that your functionality is in there but we can go in depth in here but then we won't have time to cover the other aspects also you can find as example this test this type of test we can find them in the web3j repository but also for those of you which are familiar with hyperlature basu you can find them in there like and in there also you can find a lot of complex usage of this web3j unit yep okay so this was about ERC20 about the test interaction and now whatever i'm looking to show you is the ERC721 which is the smart contract specific for NFT and i'm looking to create hyperlature NFT with you okay so let me close this project and also we'll we won't use the basu this time as a network we'll go directly on Sepolia and use the metamask wallet in order to be able to see it but also like we could use metamask wallet also with basu but maybe a testnet will be more interesting for you guys okay so now we'll generate again we have the same support for ERC721 and we'll go with web3j with the creation method it's created with the same package okay let's find that open name for this ERC20 let's call it hype token for hyperlature and as a simple let's use the hype okay the creation is taking place project for you guys and there it is our ERC721 token project again we'll we'll try to do the same things that we did with the ERC20 except this thing this time we'll do it on Sepolia network test network and also we'll like we'll interact with it as an NFD cool so in order to get started what we need to do is to change a bit what we have in here and for that I will add the Sepolia URL and also can you tell them like if they want any RPC no Sepolia RPC no they can get it through yeah sure like for example in order to be able to get the Sepolia testnet you can go actually we prefer in Pura it's really intuitive to use and this is the link from our and the endpoint from where I'm taking it and also as wallet in order to be easy to interact I'm using Tamantha mask and I have already some heat some test Ethereum for this network that I generated before this call this is initial what you wanted yeah cool thanks thanks okay great cool so as I was mentioning I added the endpoint in here also I will go again with the credential object not using the wallet let me create that again also private key that I'm using to test the credential and let's see what we may get from it so again we'll run a deploy also let me take the WCJ from here okay cool so now we're run the deployment of our UC721 smart contract okay and we have the contract address that we'll add it again here okay cool and also let me strike this one new method in order to have it in space here so we have our smart contract UC721 deployed in there but what we are looking into is to obviously mind an NFT on and also see it somewhere and for that we'll create a new method and let's call it mind NFT for this we'll load the contract as we did before for their CDB20 and here that's contract address okay so the contract smart contract is loaded and now what we'd like to do is to start sort of the mining and in order to be able to mine this what we'll need to do is to call like I will go on the solid the smart contract to give more context we'll need to call this award item because this is what we really do is that we'll on this address it will mind the new NFT and that NFT it's in the map should be somewhere on the DB uh located by this we are at and for that I'm using the NFT storage and also the NFT app tool which is really easy to use because that is using IPFS and I will show you just in a minute how to do that I mean mine it's already uploaded but I can show you the JSON documented how it looks like but first let's try to make a call and also as you've seen already this one is returning an identifier at this side and the identifier mainly is the token the NFT ID which is unique every time and by this the and this one is mainly the reason for the tool with which the double spending is avoided for the NFTs okay so as I was mentioning I will start calling that award item method and that's minded I will use the same address of the contract and I will show you later why because again we have to go through the same process of allowing the sending of from an address to another another address okay so in here we have the player and the player should be based on this credential and the credential that get address it will return the public address of this private key actually it will be the public public address okay and next we I should send in here an NFT URI and for that what I'm adding here with a new string actually let's call it image URI or metadata URI because then the NFT will be after it it will be mine let's look what you value to give it okay so in here as I was mentioning I generated and uploaded my NFT already to the NFT storage and just to show you let's see if I have yeah in here in here is the link that this one is the link that will be used and added to the NFT URI variable and sent for that for mining and what this link should really return is adjacent with the metadata of the URI and in of the sort of the URI of the image that will be used as an NFT and for example we have a name in here which is Hyperledger we have a description which is Hyperledger or shop and in here is the image how the NFT would look like and if we are taking further this link and paste it here you see this is how the NFT would look like basically it is the Hyperledger logo cool so now getting back to our IntelliJ I will have been here to link okay so this is the metadata that will return that JSON and this will take it further in my award item and send it also this will return a transaction receipt and in that transaction receipt I will find the ID that was generated for this token and for in order to extract that ID I will need to parse it a bit and for that I will use some type variables that are doing that mapping that I was mentioning in one of the slides from like EVM mapping which is the one in here mapping of the type I mean hand sign integer or 256 to a big integer and I'm sure you know how to do that I guess taking here as I was mentioning this one is with a transaction receipt and mainly we need to process this transaction receipt and well in order this one is mainly contains a JSON and for that I will and do that I will find my NFT as a my NFT index as a string and for that I will use the following hold let's say just a second I think it should be in the logs and it should be the second log and this is not really intuitive I know but this is I mean this is the way that we are supporting it right now and we are looking to make this better and mainly the data here is there is the return value of this function so I will print it but if I would like to use it in my Java app I would like to use it more in like in a value that I know and I expect it to be an ID which should be I must probably be a big integer and also other thing is that this one we will see here in the log that it will be 32 bytes padded zero padded so I also wouldn't like that to be in there so I will convert it right now to what type that I know and for that I will use the let's say a big integer I will use the type decoder and use the decode because I know what value it might be it should be one numeric value to numeric and the input is nft and the type is uint 256 because I know that it will be this type from the method which that returns it okay and now what I will go I'll go directly with value and now I can write again things and return here okay cool yeah so I think we have everything we need in here let's see what will be our success rate also one thing just to show you I will go back because I was mentioning that we'll use metamask so this is my wallet and here on the nft is I we can see that right now I have this nft on the simple network and also I have a previously one hyper ledger this one was just a dry run test before the workshop but now whatever and also you can see we need that it has the id4 and also different smart contract address but now after I run the code that I just wrote it you guys hopefully I will get in here my new nft okay so let's run it finger crossed let's see what moment it reach okay started mining the nft okay okay you can see in here that um okay I've got here to add the space but that does matter the nft was generated and it was generated obviously as it was the first from the collection it started from zero as an index and this is the value that I was mentioning that we receive receive it from this from the transaction receipt and but here I use this they called the type decoder in order to get it to a value under a value that I would like to have it which is big integer and you can see in here that it was converted to zero okay now what I should do is that I need to go to the methamask and to see if it shows in there but as we are as a hint just to know just to know if like if your nft is not appearing right away it is because it is a test network and most of the time doesn't it's not loaded immediately and the way you need to do in order to make sure that I mean to load your nft in a while it is the following just take the contract address of the nft go back here on the nft and you have here the import because like you can do the refresh but nothing will appear and also one hint right before like getting into this make sure that in security and privacy you have this auto detect the nft on one because most of the by default it isn't and if it's not then you have troubles in getting your nfts especially on the test networks and okay now what we are looking to is to import our nft and we'll basically here the address of the smart contract as I as I was saying and also in here I would add the id and the id was zero because this is the first one which was created and you see it in the you saw it already in the logs and now if I click on import okay nice my nft was successfully added and I can see in here the hype token that I just created and also the smart contract address the id which is zero the description and the image yeah we have our hyperledger nft okay cool next this like I would like also to do a transferring here to see how it shows like from how it goes from one address to another and also there are a lot of other functions that can be used in order to interact with this nft okay one second to check something the logs actually I'm looking for a hash let's see if it was printed by default not the block hash okay in here from what you can see I have only the this block hashes but also in here I have a transaction hash this mining and I wanted to take it further to the sepholia explorer to see what it's like what it shows okay and in here I have the sepholia iter scan and if I'm adding this here okay here we can see the details of the transactions and we can see in here the method that we just called which is award item okay so we have to prove so far that this was a success great okay getting back to our code I would love I will do one more transfer on this and we can continue with other things and now let me create the transfer method okay so again we're loading the contract and what we need to do is to call the transfer function and for that we'll use the because we will transfer it from the main address we won't need to run any approval so for that we run transfer okay so we'll use the main address credentials get address and let's add in here also if you see more that's where you see we use this address okay and now we need to add in here the token ID which is mainly the NFT ID that we just created and we know that that was zero and send at the end okay also let's add some logs NFT also add another log and let's call my NFT's amount is I just remember that I have already one so but first let me write the call and my address here I am expecting to have two NFTs as I've shown you in the wallet and after I will expect to remain only with one and the that one that was sent I expected to receive it on this address okay that's from this okay so it seems to be running to an issue no worries about that we'll check it right now and in here we have a report three so okay let's see first the logs if we receive these logs okay okay okay now I see the query of balance of it's taking place on this specific instance that is using this smart contract address and for that the result is one when I'm doing the query so it's not two as mentioning before the other NFT that I have is on another smart contract and for that so that's why the balance in here it's returning only one instead of two and in here in sending my NFT I think most probably should be the same reason or that we had the on the other side oh okay now I see in here I was sending the wrong ID because as we're mentioning we have only one NFT on this smart contract and that has the zero as ID okay good actually that we run into this issue because like this we can notice that how easy to mess up with the parameters good so now if I run this again it should work okay cool so it seems that the transfer to place and just to check my NFT amounts in the logs we have in here that okay before send we have one and after we have zero and if I am going to metamask it's here so in here just to do a short refresh so we can see that I no longer have in here the collection the hyper ledger collection I have only previous owned items and if I click on them here is the old one old item which has the ID4 and in here is the new item that was transferred with the ID0 and if I am going to the other account also in here on my previous test I had the same NFT with the ID4 but now I should have in here the new NFT and all and if it's not appearing again we have to try to import it and I will take now the smart contract address and also the token ID which is zero and if I am importing it okay nice the NFT it's was added and it says with ID0 okay so yep this is the thing that I wanted to show you related to the ERC721 how to create your NFT publish it and I mean deploy it and after transmitting it and transfer it from one address to another hope it makes sense Isha or are there any questions on this topic? Not there's no any questions but yeah I will ask like what's been if you have any question you can stop us anywhere we can pause and explain more or dig deeper okay great hope this was intuitive and yeah in terms of tokens this is what I wanted to show you during this workshop and now we'll move on to the EAPs and next I would like to show you the EAP155 and EAP159 how those can be executing using Web2J and as we are already we have oh now I see the time that we have already two hours in we I would for that we don't have I would jump on it and I want to say that we don't have a support to generate the project specific as it was in here for the ERC721 or ERC20 but what I will do is that I will create in here a new class let's call it and add the code needed in order to be able to execute this kind of transaction okay let's create the main function static okay and for the for that we'll use the credentials that are already used in here so we have the node URL we have the credential oh I missed only sorry about that and the main function and one way to create the EAP155 is to deal with the transaction manager class that is in our Web2J and for that I will just as an example I will create a raw transaction with using the transaction manager and specify any the chain ID because this is what mainly makes the difference from like a normal transaction to one to a EAP155 transaction and that is the chain ID which is mentioned in order to make sure that okay this transaction is taking place on a specific network and I think there's a similar question only as you explained like if you can explain briefly or what is EAP155. Okay yeah now I was about to say that DCAP155 what mainly does is that it's specifying the transaction the chain ID and that's because like in the past before this was created there was a confusion like in calling the main chain the ethereum mainnet and the robstan and most of the call were robstan mainnet and most of the calls like were directing to directing to the wrong networks if I could say and there was a mess in there and for that like okay the contributors decided let's add this chain ID in order to make sure that the transaction gets on the right network okay and yeah just let me add in here the chain ID of the septolia because we run again this transaction here it should be long the chain ID the way that which is using it is has a long type okay let me find the septolia chain ID I did somewhere okay only okay so this is the chain ID specific septolia like and also if we we were to use the best so that one would have been one three three self that a simple one okay cool so next also like I will execute the transaction using the transaction manager and for that let's create the instance of it and but also like let's see what we're having here we have the node URL the credentials the way to j service and we need a guest provider and for that we'll use the default one nice and now we'll put to create the transaction manager we'll I mean and also here the transaction manager is the interface and we'll hopefully it's implementation and mentioning here the way to j and also as I was mentioning this is a ep 155 so we'll also need to specify in here the chain ID so what we'd like to do with this is like is that we'd like to send a transaction and in order to do that we'll need to call this send transaction but this in here takes some multiple parameters one is the guest price the guest limit where we would like to transfer it what exactly would like to put on chain and this is the transaction in coded value like it can be a transfer it can be a control deployment and also the value of the transaction and this but this is for transferring from one address to another address so for that I would what I would like to do is to deploy a new smart contract and for that let me paste one in here solidify and space storage okay so here I have a simple storage smart contract which is like said it acts as a getter and setter on a number and for that I will need to generate also the proper and remember that I mentioned that in the beginning in order to be able to generate contract ropers then we need to specify it here okay so storage solidity smart contract is added to this list refresh it but it is okay the what you change generate contract proper okay so roper is generated and now if I'm going back here I will be able to send the data that I need that will use the guest wider guest price yes limit also in here should be the new value because we are deploying it now we are not sending to any contract and as data in here we'll use the binary data as we are doing the deployment of this smart contract and the binary of this the compiled version of this smart contract is already included in the roper and you can access it by this like we would call the storage and you have here the binary and then the value that we'd like to send is zero and this is throwing an exception that may be here the material and send transaction of transaction and also I would like to get the transaction received of it but it will take some time in order for the contract to deploy and in order to make sure that I'm not getting another point or insertion here I would add a thread slip of 10 seconds yeah charge or there is one question like why we are using your transaction and then what are you well we have multiple transaction managers depending by the case and one second I can go in depth to eat for example you can have the road transaction manager fast forward the fast road transaction manager what is actually this can handle multiple transactions and by handling multiple transactions I want to refer that it's able to send multiple transaction and to compute in advance the nodes for those transactions and also other managers that we have and there are in a separate class is the private it's also the private transaction manager but for this as it is only a simple deployment and I want to underline the ap 105 55 with the chain it I'm using this road transaction manager in order to send my transaction and for example if we have here only this doesn't it's not updating anything this can actually only has a getter on the smart contracts hope this explains why I'm using the road transaction manager yeah yeah and there's one more question or like can we do these transactions or synchronously like send or sync yes yes we can do that that synchronously we don't need to wait in here for a response and and also like if you would like to I mean if you would like to use it in a webdj in an asynchronous environment I recommend you to use that transaction manager because we can also create some transaction objects we can also like run the transaction specific on the smart contract wrappers but those are synchronous methods and if you'd like to run it as synchronously I recommend you to go with the transaction manager okay and now I was mentioning about the received and that is called one second there you transaction receipt the transaction of it here and get the hash because this is mainly the way that we are getting the transaction received that jason that we've seen before on the as a result of the rubber execution methods okay and obviously the same function in here and also I would like to load my contract to get one based on this receiver like to get my contract address if you go with debug we'll understand why how exactly this ethereum get transaction receipt is built and why I made here these calls in order to get all the way to the contract address and also let's print it what else I would like to do I would like to load it in a specific object and to store a value and to get that value to make sure that okay my EP 155 transaction so transaction was successfully executed and for that I will go with storage go with the contract instance that's why I'm going to use a storage of okay and here I'm getting back the value that I'm storing let's check what we'll get okay so in here I can see that okay the based on this last log I can see that my contract was successfully deployed using the road transaction manager and the value that was stored on it it was successfully retrieved so mainly this is like one way to execute the transaction with the EP 155 transaction okay and the last thing that I wanted to show you related to this to the EIPs and after initially stepping with some more complex things I wanted to show you the EP 1559 but there is a bit to write on it so I prepared already a class and we'll go through it and explain it I hope this will make sense and this will make sense and also like want to lose like 10 minutes in order to write it again and for that just let me create the new class which is 1559 we'll add in there like the code okay great so let's see maybe it doesn't like something I think the name is web app in there and classes okay okay okay let me see yeah thanks thanks I start I'm getting a bit tired okay great thank you so as you some of some of you might know already this 1559 is used to the guess in advance and in order to like help the transaction to be mind ahead of other transactions but by adding in there some certain values and in here that just take a step by step so in here again well I am creating the credentials with the private key also I'm in here I'm checking the planned version but this is only to check and after what I'm doing in here I'm trying to compute the nodes for the transaction that I am about to send because this time I won't use the transaction manager that will take care of that I will use the transaction object so in order to get the nodes I'm here I compute I'm pulling these get a transaction count on the on the latest block and this is the web2j code that can help you to get that okay and also next what I'm looking at is to get the base fee and this is sorry we tested several something before okay so this is the base fee that I'm getting based on the block and printing out here and after what I'm looking to do is to compute this base fee like I am multiplying with one by one one dot one in order to make sure that will that my transaction will pass through second to check something here it has a conflict with this base fee let's rename it to fine okay and after like I'm getting I'm computing the base fee for the transaction I'm creating the EAP 1559 row transaction and in here we you can see that I'm using this row transaction object I'm calling this method on it and if we are taking taking a look closer to it in here we can see that there is the arguments that is taking are the following is the chain ID the nodes the guest limit the where to send this transaction the value the max priority fee how we can how we would like to like to use this EAP 1559 in order to get our transaction through like paying some more guests to the miners and also in here it is the max fee per guest that should be mentioned in order okay I am allowing this much for my transaction in order to get through okay and now if I'm getting back here and this is a smart contract where I'm sending my this and this is an address where I'm sending the value because in here you I don't know if you notice based on the position but this one it's transfer like it is the chain 90 the nodes in here is the guest if you are going back here the guest limit where I would like to send the value that I would like to send and those two feel specific to EAP 1559 okay and also like I need to give some credits to initial for creating this method in here okay now if I run it and in in here again it's waiting in order to be able for the like to process the initial transaction that was sent here and to get the receipt and this should have been removed from here because it didn't work as you can see it's already okay but in the meantime we can check what logs have been printed and if for example if we're going to the base fee we can see that the base fee for the node that we queried which was the latest I mean for the node for the block that was queried which was the latest one was this amount and obviously like when we went further we multiplied this with 1.1 in order to make sure that okay we'll allow this much gas in order for the transaction to go through and that was specified in here integrate transaction and also other thing is that we added a tip for minor and the value of the tip was this much which is 5578 but if we're going all the way down we can see that the transaction was executed we received the hash for the transaction and also we can find in here the block number the cumulative the gas used and the transfer that was taking place for this address to the other address and also as it was executed on Sepolia we'll go now and check it here in the scanner so it was a 123 way transfer from this address to the the other address with this value and if we're going to check the details we can see the priority gas fee that we put in there and the other parameters and also just to go back here to show you here is the priority gas we added and also the value that we transferred value transfer and the priority we added and also the base fee that we placed earlier on by multiplying that gas that we received I mean the gas that we queried here because multiplying these by one to one which will return the value of yeah and this is mainly how you can execute the AP 50 59 transaction using web 3j and also another way to execute the 3j transactions by using the row transaction class and you can in here we can find some other also some other type of transactions that you can execute okay this is what I prepared for the workshop today hope it was useful that you like it you enjoy it and from now I hand it over to you initially if there aren't any questions thank you thank you George I think we had a few questions but we were able to resolve the chat and you can also go through it okay sure I from now on I will stop sharing and also try to help with the chat okay so I'll stop sharing screen and would you like need to step in to show the 4844 new VIP yeah sure okay great oh thank you so much George for all the yeah for the presentation demo okay oh so I think as you all will be knowing that 4844 was recently upgraded with cancun upgrade in ethereum on 13th of March and there's a lot of hype how it can decrease the cost of transactions in layer 2s basically there will be a temporary storage of temporary storage in the form of blob which the layer 2 transaction can send over the layer 1 network so when we started with this development of EIP 4844 so that all the users can no get benefit of this EIP and they can transact the blob transactions over the network so I already have is this visible or do I need to make it you can make it a bit you can zoom in because I mean the screen is really wide and it's hard to read yeah is it final yeah way better much better thank you okay so what happens in blob transaction that we can send a blob to basically 1 to 6 to 6 blocks in a transaction and this goes to the consensus layer and then or to the execution layer so in execution layer it is not stored it stays in the consensus layer or about like 30 days where you know we can like check okay so this is the where we can you know retrieve the basically blobs so to make a blob transaction using Web 3j so I already have some code here so here we are using going to use the Sepolia network testnet only and we have the private key basically this is my private key I'm using and then also don't worry there's just a testnet so you won't be able to steal my cryptos okay and then I'll just create a credential and then we have the address and this is the stp service is in the node URL the RPC endpoint we got from the infura and then what we are going to check the balance of our of our account and once we have the balance of our account as the George said we can get the transaction count this is basically the nonce for our account which we are going to provide so we are going to print the nonce then to make a blob transaction we need to give the blob base fee and we have already the formula in the spec sheet of a IP 4844 how to calculate a blob base fee based on the excessive excess blob gas and the current blob gas used so based on those two values we can create we can basically get the blob base fee so it is already implemented in web 3j we can directly get those value or using this web 3j dot eith get base fee but blob gas so once we have that so in eith block there are two more parameters which were introduced in the IP 4844 so as I said one was eith blob gas used and then the excess blob gas so we can get those two values here and we can show what's the current blob gas used okay and after that we need to you know make a transaction we need to give a value of gloss blob fee basically somewhat bigger than the current blob fee so even if it increases our transaction doesn't fail so that's what I'm just multiplying it with 1 by 1.1 value so we have the enough blob fee and to create a raw transaction what I'm going to do is so we are going to create a list of blobs so we can add up to six blobs in here so let's add so currently here we have only one blob let's add three blobs okay so it so basically what this function is doing it is randomly creating a blob using this code so this is just randomly creates a blob of the expected size and then we are going to get this random blob added to a list and then create a transaction so in here we have the list of blobs then the chain ID the nonce what we get from the transaction count so from here that's the same nonce we are inputting and then this is the base fee gas basically gas limit and the gas price those things max those things and then this is the two address where we want to send this blob and then if we want to send any ether along with it so we are not going to send any ether so value is zero and node data we are going to send in here and lastly the blob fee so this is the blob fee which we calculated in here so using this we are going to create a raw transaction and then we are going to sign this transaction with our credentials and then send it or to the net network so we are going to send it to the Sepulia network and once we send the network you are going to get the hash and we can check the response what was the response and get the transaction this and if there was any error we can get those things also so I will just quickly run this so this is the account address I'm using the account address then the WebTJ client so basically this Infura RPC node is using this client get 1.13.14 and then if you see this is my balance in the account and the nonce is currently seven so this is the seventh transaction from my account and the current blob base fee is this much and the current or the last blob gas used in the network was this much and then the access blob gas was this much so these are two values which we can retrieve from the ETH block so after that you can see the transaction hash so we have already sent the transaction and we get the transaction hash for that so currently transaction response is null so it is not like returning any anything so its response is null so after we get the transaction hash we are just waiting for it to get mined so I have implemented a sleep of like 60 seconds so once that is complete we will hold the receipt so we will get this transaction hash and send it so if you see we got the transaction receipt so let's see here so in this you can see the transaction index then the block hash so in which block it was mined and this is the my address from address and if you see here we will have effective yeah so what was the blob gas price so this is the blob gas price and the blob gas used was this much so we can get all these things and send a blob transaction so I'm just go to my home and show you this transaction so let me just copy this transaction hash okay so first I will check the sepolia pether scan again just put my transaction hash so if you see there are 10 block confirmations so transaction was successful and this was the transaction fee so the gas price and all the base fee and then the gas limit and there were three blobs or if you see I added three blobs yeah so I added or if you check we added three blobs so these are the three blobs which we have so if I click on here so these are the blob version hashes and this is the commitment so these are the kzc commitment hash and the version hash basically and the blob size was this much and the blob base fee blob gas price or blob gas used all the things we can check it out here also there's one more website which is which is blob scan where we can check the blobs so I just do that and put my transaction hash so if you see it was three minutes ago this in this block it was mined and if you see these were the blobs three blobs and if I try to open this so this is the total this is the total blob which was sent so if you see we have all the blob was stored and also we can see the version hash the commitment and the proof here so using this or basically it will be very easy for all the developers to you know test the new eip 4844 and you can send these transactions to layer 2 network and you can basically create your own web 3j app and you can you know basically and I think this is the first library or web 3 library which implemented this eip 4844 support so yeah please go on and create blob transactions and try this and let us know if you face any bug or anything we'll try to fix that or is there any um questions in the chat yes like we got one question what exactly do you mean by three blocks uh or I think you wanted to say three blobs that were added well but exactly okay want to mean by this okay so in eip 4844 basically you can add blobs so blob is can be any data so basically what happens when a layer 2 or when you do a transaction on layer 2 the proof of these transactions are then sent in compressed form to a layer 1 network and it used to be done in the call data value but it was very expensive so with eip 4844 what layer 2 can do they can create a blob this blob is just a data from the layer 2 network which uh which is a proof of the transactions in layer 2 and they are sending this proof and storing it on the layer 1 so it is secured by the layer 1 network also so a blob uh when we say we are adding three blobs so basically uh there are three um storage blobs uh which contains the data of the uh layer 2 network which we are um basically storing it and storing it on the layer 1 and currently um the ethereum network supports blobs up to six so and maybe in future they will increase it if we want to or decrease the basically the prices or more and we can store more on the earlier one networks i hope this explains yeah i think that may sense but we have have another question and that is if you can give other example then and nothing including layer 2 about this blobs usage oh so basically uh okay so i think it's a proof like for example i have also used that edit if this is a proof of transactions yeah so basically uh what is happening um the storing on layer 1 on ethereum network is very costly right because it's a permanent storage and every appear in that network needs to you know store the same value but right now with the blobs what is happening it's the temporary storage so every network just need to store this blob for some days and do not need to you know uh store it permanently on the network so basically you can use it as a storage but uh basically as a temporary storage on layer 1 so um so there was some use cases where people were you know um converting a image or nft into a blob and storing it on the layer 1 so there can be many use cases so basically it um it basically makes it easy for users and make it or like less costly for users to store the data on layer 1 we can say blob basically makes it easy and less costly for a user to store data on layer 1 because it's a temporary storage yep i think that address that's really well yeah it may sense we got the answer from the user i'll just stop sharing and uh yeah and also there's one more so just last thing uh there were some questions from uh user when we're doing web 3g introduction how we can you know get the um how we can get the event filters and we can get the events or parallelly so i have created one project for that too so basically what it does or this is the hello world uh contract let me show that so what it does it stores a greeting message and when we change this greeting message it creates an event um yeah so it's it basically emits a modified event which we can check and we can basically log this event in our web 3j app so this is what we are going to show in our web 3 app so basically it will deploy the smart contract and then it will try to change the greeting address from two different basically two different greetings and here we are running a parallel execution thread where we will go into you know a log the old greeting and the new greeting so using this you can basically get these events and you can make sure like what were the changes done on the smart contract and if there was any function which was which basically emits an event you can get that i'll just run this for this i need to start my network i think george has already explained this and if you have any questions on the chat regarding filters so if you see we have created our filter and it is from the earliest block to the latest block and this is the contact address we are giving for the deployed contract and if you see all the events where you know there's a modified reading we are going to give or give this filter as a parameter and we are going to get the events for that and we are going to subscribe to that event and log those events so i think my network should be up i'll just check once yep it is up heli i will also check the docker if is running time so this is the beso qbft network and we can check the loss if the network has started it's starting up wait a few more seconds initial could you please zoom in again a bit because it's hard to read it to see a screen like this on a smaller screen okay okay so i'll just make it up so if you see or the blockchain has started has started mining the nodes or is it visible now yeah it's visible but it's really small this is what i was referring to but i don't think we can do as we are in this docker interface i don't think we can zoom in yeah so basically what i want to show is we have started the blockchain network and it started mining so now we can make the calls just run this it is deployed we should see the contract address not yet deployed okay it's deployed we got the contact address after we got the contact us we are going to create a filter and we're going to subscribe to all the events so let's take the greeting method result first this should be hello world example yeah it's hello blockchain world after this we are going to change it to nischal and then george so let's see if we get those events i'm going to search this okay so if you see the old greeting was hello blockchain then there was an event emitted and it changed to nischal then we can search again okay so again there was a event where the nischal was changed to george so we can continuously get you know pull these events and we can make sure what are the changes in the contact basically smart contract is in these events so i hope it makes sense and let me know if there's any question yet well we got the question related if the latest block it's finalized but i didn't really get that so maybe if you want yeah please nischal so maybe uh so he wants to know the if the basically the block is finalized so basically what happens in private network where we're using to be after ibft network all the blocks that is mined is a final so in public there are chance there are chances the block mined now is not final so we rely on block confirmations but in a private network which we started here all these all blocks are final oh yeah george please i hope yeah he answered that i'll just terminate this and i'll just stop sharing them okay latest attribute is basically the last block last block that is mine yeah over to you okay thank you nischal thank you so much uh for all the great stuff she did for with the ap 4844 and also with the log events and yep we seems that we got to the end of this workshop and it took us nearly three i mean exactly three hours so we made it and in here we have like the i think this is the last slide with the summary that we did so if you remember in the beginning we talked about the web gj architecture the modules also we went through the erc 20 rc 721 contract proppers and also how to generate projects based on that and how to deploy them on the evm networks we interacted with local best network we interacted also with the sepola network where we deployed smart contracts also like transfer tokens transfer nft is we seen how to create an nft uh what exactly it's it's sorry metadata uh how to specify it what methods to calls we also took a look in the web gj unit uh and we've seen how that can be extended and used based on our case on to create proper integration tests using in behind the node that we want the imbedded evm node a docker compose one or base or cat node and in the end we finished with executing the ap is the most used ap is in this evm space which are the 155 1559 and 4844 which we assume would bring a revolution to to the networks having the possibility to bring these chunks of data and yep thank you so much for staying with us for so long and hope everything was clear and make sense and yeah we are looking for your contributions as well and now I'll move again to this because it's really important like if you'd like to join and to subscribe to our hyperledger community it would be really helpful you'll find the latest news related to web 2j and also we are inviting all of you in our hyperledger web 2j community cause as initial was mentioning we'll start we'll have the first one next week so we are looking for you to be there and to debate more on web 3j and help us develop it sorry I need to grab some water no worries I would like to on behalf of hyperledger thank George and Nishal for doing such a great job please nobody leave yet I got a couple things to say I'd like to thank George and Nishal for doing such a fantastic job on this workshop it was really informative and the questions were fantastic so thank you to both of you I would like to thank everyone who attended even those who had to leave early who are going to check back in on on YouTube open source works because of you using the software contributing to the software becoming maintainers sharing this workshop with folks is how open source grows and works and I cannot thank all of you enough for joining us and asking such fantastic questions as I mentioned a couple times in chat the links the deck and this video will be shared in a thank you email to all the registered users those links and deck will be shared in the YouTube description in case you want to come back and check it out and as well as on the hyperledger wiki we live stream this so it'll be on YouTube like in the next it's on YouTube right now but the the final end code will happen like probably the next half hour and please by all means check out the web 3j community calls check out the discord check out the the the the github pages for web 3j we cannot thank you enough for joining us today and please share this with your colleagues or or or friends who are interested in this topic but again thank you George thank you Nishal please tell Connor we said thank you as well I know he had to leave a little bit early and thank you everybody we're going to post the links again in chat and it'll all be in YouTube and on the wiki today so thanks everyone thank you see you thank you thank you everyone