Using EOSFactory

Finding our EOS Dev Toolset

In our previous two articles we discussed setting up an EOS smart contract to help out with school admission lotteries. The first article focused on getting the EOS chain up and running and how to use some of the CLI tools available for it. The second article delved into the creation, deployment, and interaction with the lottery smart contract itself.

In this article we will explore a tool developed by a block producer, Tokenika, that is meant to be the EOS equivalent to Truffle. We will put it through its paces and see if we want to use it for our continued development on the lottery dApp. The tool is called EOSFactory and has the following promise from its website:

Undoubtedly, everything that EOSFactory offers can be done with the official EOSIO toolset, i.e. cleos and eosiocpp . Does it make EOSFactory just a simple alternative to those tools? Not really.

Try to go through EOS tutorials based on cleos and you'll see how much concentration is required to follow those simple examples without making a single mistake. And now imagine doing it 10 or 100 times. Surely, it's a daunting task!

Code development and unit-testing involve tasks that need to be executed hundreds of times, and each time in exactly the same way and exactly the same context. Therefore those tasks need to be fully automated, as otherwise a lot of time is being wasted and, what’s even worse, a lot of additional uncertainty is introduced. Manually performed actions are prone to errors.

And this is what EOSFactory actually brings to the table: an easy & intuitive way to automate the process of dealing with smart-contracts. Write down, in the form of a Python script, what needs to be done multiple times in exactly the same way and exactly the same context, and then just run the script. EOSFactory will take care of everything else: it will compile your smart-contract, create a new testnet, deploy the contract, invoke its methods and verify the response, then tear down the testnet, and finally report the results. And all of this done in a couple of seconds.

For those of you that went through the first and second article of this series, you know that the cleos CLI is not ideal for repeatable and iterative development and something like EOSFactory is definitely needed.

One caveat from Truffle is that EOSFactory uses Python3 as its language of choice rather than javascript. This may be a formidable obstacle to some, but I have found Python easy enough to pickup.