 person up is Jan Shea. He is going to speak on Ethereum on Ruby. Welcome Jan. Thank you. So thank you for coming to this talk and it's time for some simple stuff I think. I believe the organizer arranged me after Vlad for some reason. So yeah. Okay in the next 15 minutes I'll introduce you to Ethereum on Ruby which is the intersection of Ethereum community and Ruby community. Before that a little bit about myself. My name is Xie Hanjian and I'm an Ethereum developer. In last year I created the Ruby Serum project which is a full implementation of Ethereum in Ruby and I'm also working on PyEserum and I'm running a blockchain technology startup named Cryptape and we are building underlying permission ledger and we also providing some consultancies to our customers and during our daily job we build some tools to help we develop dApps. Okay so a little bit about Ruby. Ruby is a language created by a Japanese named Yukihiro Matsumoto whose nickname is Mads and the core principle of Ruby language I think you can get from this guy's face right. That's happiness. So Ruby is a language designed for human. It's very focused on readability so in one of his talk in one of Mads talk the presentation title is optimized for programmer happiness so if you make a spectrum of languages in the one side maybe West, ASM and in the other side is Ruby I believe. So it's all optimized for human and the source code written in Ruby will read very naturally and we will see that later. And the other good point of Ruby is flexibility so a lot of people is using Ruby to define internal DSL the main specific language so the most famous one is Rails. So Rails is DSL for web development and I believe we can also use Ruby to define some DSL for smart contract. So we created TAS, testing and deployment framework for smart contract. After you install TAS you can open your console and type some command line like this like test new big thing big things the name of your next big project okay and this command will generate you a lot of files and directories and among the directories the most important one are contracts and tests. Contracts will include the generated contract template and tests will include the generated test template and then you can do test generate token. Token is the name of your smart contract so you can name it whatever but we use token for example and here's the generated file on your left side you can see that's a solidity contract it's empty and on your right hand is the generated test for the left side smart contract and the generated test is very simple it includes an example test so it just says assert a search equation of assert that the contract address is not nil assert that the contract has been deployed okay so this is just generated out from the tool okay before we jump into a real smart contract test you need to know some tools at your hand you can use this keywords in your test so we have some we have some tools related to context you can you have access to state state is a collection of accounts and you have access to head head is the the the most recent block of the chain the current block and you have access to contract contract is the ruby object the test framework built for you it's compiled from the solidity contract it it extracts the ABI interface from the contract and it the test framework will build a contract object for you so you can use the object to do everything to do all kinds of things on the contract and you can take some actions so you can transfer balance you can transfer user between accounts you can deploy contracts to the state deploy is not implemented yet so it's in gray and you can call all kinds of functions on the contract object and they are there are some pre-generated randomly generated accounts you can reference to them by using private keys pop keys addresses and as a tester yourself you can reference to your own private key using private key pop key and address and we also define aliases to these randomly generated accounts so you can use the well-known names like Alice Bob Carol to reference to those generated accounts so here's a real test in the left it's a standard token contract the token contract has issue function transfer function and get balance and on your right hand it's the test for the corresponding contract and you can say at the first line we use contract issue Bob 100 and that means we invoke the issue function to issue Bob 100 tokens and then we transfer Carol 90 tokens from Bob and then we make sure that the Carols account has 19 token tokens in it and then we do the transfer again we we we want to make sure that it can be done if there is some exceptions so in in the contract test you can you can find one thing is that it's really the test is really compact right you you don't there's no asynchronous in this test there's no callbacks there's no mining you don't need to do that you just write the test and you run the test just just like you do in Java or C++ it will run instantly and give you feedback so we find this will speed up your development cycle largely because now you can tweak with the contract on the left side and then you just run your test and you boom get get the result from your from your code you just return instantly and when there's something wrong you can go back to your code and do something this feedback circle is much shorter than if you deploy contract to testnet or if you use other things and there's better stuff what if what if you forget to write the first line you forget to issue Bob 100 tokens at first but you just transfer Carol now you will you will get a failure in test then then what you do how do you debugger how do you debug this problem in in traditional programming context we may find we may open some debugger right but someone said logger is the ultimate debugger I don't remember whom and we find that in in solidity we have log although the log is some is some kind different than the logger's log in traditional programming world but there's logger right so we can add a log we can write a log in contracts and the test framework when when you run in the the test the test framework will print the log in your council so you can know what's happening in your contract you can know you can know immediately if the address to is correct past in right you can do it do all kinds of things to inspect your contract and this is very important important for for debugging I believe and in test by default logs will be print to console but events won't although events are also some kinds of logs but you can trick those options to enable events printing so if you set print events to true then if you if there's an event in your contract you will see the below lines like this in your council and here you can see the issue from account and amount and better test is a language agnostic framework so it also supports serpent and I don't know how many serpent developers here but whoa metallic okay but serpent is also very good smart contract language yeah so the test is possible because we created the Ruby Serum which is a full implementation of the Serum protocol it it includes a lot of things so what behind test is test will compile the contracts and run the bytecode on Ruby Serum virtual machine and it doesn't involve any mining and block creation it just run the code on VM that's very simple right so so you can get the instantaneous feedback and at this time Ruby Serum has evolved into many has inspired many projects so inside inside Ruby Serum we have we have modules in charge of data like block transaction etc and EVM it's a full implementation of EVM so there's people using the code inside Ruby Serum to extract ABI from contract and there are also utilities like address public key private key they are very convenient tools to help you convert data between address public key and private key and Ruby Serum also has many dependencies like RLP, ESH, Serpent and SCCP and based on Ruby Serum we are now building REST, REST is a full Ruby client so it's some kind like GoE Serum so besides Ruby Serum we also need Ruby Dev P2P the network layer combined the network layer with Ruby Serum we we can build REST and then we have test the testing framework and we have Ruby ETH Ruby ETH is a small tool extracted from not extracted but build based on Ruby Serum to help you create and sign transactions and we have ETH JSON RPC which is a JSON RPC client talked to a Serum server, a Serum node and there are some projects extracted from Ruby Serum so thank you