Ethereum Alarm Clock EAC.js tutorial


Welcome to the short tutorial on executing and scheduling transactions on ethereum alarm clock using js client that we released yesterday More information on the client you can find on our GitHub repository as well as on our documentation page The recommended way of installing js client is by using npm repository Name of the package is eac.js Since I already installed the client we can proceed with the tutorial The important thing is that the client requires a local node local ethereum node currently we have deployed our contracts on Ropsten and Kovan test networks In this first part of the tutorial I will show you how to schedule transactions using our js client So, in order to do that you start eac.js – s –block which means “s” means a scheduling and block means that the unit of time will be used by the scheduler will be blocks The first thing you need to enter is a recipient address this could be a regular ethereum account or smart contract address For the purpose of this tutorial I will use the default values that are coded into our client so I will just keep hitting enter Call data is a data that will be transferred and used by smart contract in case that a recipient address is a smart contract Call gas is the amount of gas that will be used while sending the transactions to the recipient Call value is a number of wei that will be sent with a transaction Window size is the number of blocks when a transaction will be executed The Window start is a block number where the windows size will start Gas price is a price of the gas in Gwei that you want your transaction will be executed with Donation amount is the amount in gwei that will be sent to the creators of the ethereum alarm clock and Payment amount is the amount of wei that you want to incentivize the executors You also can specify whether your transaction requires a certain deposit More on claiming and deposits on our documentation page Ok, after entering all the information we go to the summary page you’ll see that we are now going to schedule the transaction with default values that are in js client Enter or press Yes we are going to send our schedule transaction to the ethereum Kovan network After successful schedule we can check the transaction on… for example one of the ethereum network scanners like Etherscan Make sure that you are on the network that you are using that the client is using In our case, it’s a Kovan test network So, here we can see that we have sent the transaction to the ethereum alarm clock and we actually created a new smart contract under this address In this second part of this tutorial I will show you how to setup the executor nodes so you can become an executor and start collecting rewards for a scheduled transactions So, in order to do that we are going to start our js client with -c parameter Now, you see that we are going to use our unlocked account from the local node and currently the balance on the test network is 4.15 ETH There is a bunch of comments that you can use with our client so you can just type . (dot) for instance getstats It shows you how many transactions your executors has executed Ok, In order to start the client we explicitly need to type .start method Ok, so our executor is now started In order to read the logs we can use the tail command and see that what’s our client is actually doing You can see that our executor found transactions that we scheduled in the first part of our tutorial that was found on this address So, we can go to Etherscan and refresh the page We see that 1 minute ago the executor executed this transaction When you go to the details of the transaction you will see that both the donation and the payment has been transferred accordingly Now we can go back to our client check the statistics So, we type .getStats and here we see that we executed 1 transaction and our earning is 0.15 ether

One thought on “Ethereum Alarm Clock EAC.js tutorial”

Leave a Reply

Your email address will not be published. Required fields are marked *