<p dir="auto">Since autumn 2017 <a href="https://tokenika.io" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Tokenika has been putting in extensive efforts towards creating a Python-based EOS smart contract development platform, allowing for easy creation, testing, and deployment of smart contracts. As EOS was evolving, we got used to sudden changes of its underlying code and practiced to curse less as we went along ;)
<p dir="auto">Today, the day has finally come and we are very excited to hand over our work to the EOS community. Our newborn baby is going under the name of <strong><a href="http://eosfactory.io/sphinx/build/html/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">EOS Factory and is intended as a full-fledged, fully documented, cross platform IDE in which, using a simple command-line interface you'll be able to:
<ul>
<li>Launch a private EOS testnet
<li>Compile an EOS smart contract
<li>Run it through unit-tests
<li>Tweak it until you feel it’s ready
<li>Deploy it on EOS
<h3>Why it’s needed?
<p dir="auto">Undoubtedly, everything that EOSFactory offers can be done with the official EOSIO toolset, i.e. <code>cleos and <code>eosiocpp. Does it make EOSFactory just a simple alternative to those tools? Not really.
<p dir="auto">Try to go through <a href="https://github.com/EOSIO/eos/wiki/Tutorial-eosio-token-Contract" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">EOS tutorials based on <code>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!
<p dir="auto">Code development and unit-testing involve tasks that need to be executed hundreds of times, and each time in exactly the same way and context. Therefore those tasks need to be fully automated, or 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.
<p dir="auto">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 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.
<h3>Cross-platform compatibility
<p dir="auto">One of our major goals was to make EOSFactory compatible with all major operating systems, allowing developers to run and interact with an EOS node on everything from Linux through OSX to Windows 10. We’re pleased to report that this has been successful. As far as we know, no other EOS development solution is able to offer that. EOSFactory works nicely with <a href="https://code.visualstudio.com" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Visual Studio Code. This will allow you to write EOS smart-contracts, play and unit-test them, all within one robust IDE. Also, this release is compatible with the newest release of <strong>EOS Dawn 4.0.
<h3>Architecture
<p dir="auto">In EOSFactory we use Python to interact with smart-contracts. However, under the hood, our toolset is powered by C++.
<p dir="auto">Thus EOSFactory is composed of two layers:
<ul>
<li>C++ bridge called <code>teos connected to an EOS node running a private testnet,
<li>Python wrapper called <code>pyteos acting as a convenient human-oriented interface.
<p dir="auto">In other words, we have Python outside, while C++ powers the insides.
<h3>Development cycle
<p dir="auto">This is what a smart-contract development cycle might look like:
<ol>
<li>Write a smart-contract (in EOS's native C++).
<li>Write unit-tests (in Python).
<li>Compile your smart-contract.
<li>Start a fresh single-node testnet.
<li>The testnet is initialized with the <code>bios contract and a couple of test accounts to play with.
<li>Deploy your smart-contract.
<li>Run your unit-tests.
<li>Tear down the testnet.
<li>Modify your smart-contract and/or unit-tests and jump to stage 3.
<p dir="auto">In EOSFactory every step of the above process is fully automated by Python classes and methods - you, as a developer, only supply the creative part, i.e. contents of the smart-contracts and unit-tests. Unit-tests are designed to be written in Python, while of course smart-contracts are written in C++. Visual Studio Code perfectly supports both those languages.
<h3>Object-oriented vs. procedural
<p dir="auto">Thanks to Python, what you are dealing with in EOSFactory are classes and objects. For example, a smart-contract is an object, and you handle it by using its methods, e.g. <code>contract.build(), <code>constract.deploy(), <code>contract.push_action(), and <code>contract.get_table(). This is the opposite of procedural commands used in <code>cleos, the official CLI for EOS.
<h3>Documentation
<p dir="auto">You'll find the source code of EOSFactory in <a href="https://github.com/tokenika/eosfactory" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">this repository, and over here a list of available <a href="http://eosfactory.io/sphinx/build/html/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">documentation.
<h3>Roadmap
<p dir="auto">EOSFactory is still under development, and things are getting ironed out and improved. Right now we are working on the following features:
<ul>
<li>Upgrading to a more advanced mechanism for creating and managing unit-tests. They will be stored as a hierarchy of Python files, in a similar way the process is organized in Ethereum's <a href="http://truffleframework.com/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Truffle Framework - we just use Python instead of JavaScript. Also, we plan to add support for other IDEs, e.g. <a href="https://www.eclipse.org/ide/" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">Eclipse.
<li>Secondly, we are considering the pros and cons of connecting our Python layer directly to <code>cleos, the official EOS CLI. When we started working on EOSFactory, <code>cleos (at that time named <code>eosc) was in a bad shape and thus not suitable for our needs, so we had to build our own C++ interface to an EOS node. As things get smoother, we might reconsider relying on <code>cleos.
<li>And finally, we are thinking about integrating <em>Ricardian Contracts into our unit-testing. This is a very interesting (and probably not widely known at this stage) aspect of EOS smart-contracts. For more information please refer to <a href="https://github.com/EOSIO/eos/wiki/Tutorial-Hello-World-Contract#hello-world-ricardian-contract" target="_blank" rel="noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">EOSIO documentation.
<p dir="auto">We plan to have the next release of EOSFactory in a couple of weeks, ideally before EOS is launched.
<p dir="auto">We hope this is helpful, and any feedback, especially critical, is very welcome. If you find what we do useful, you can express your support by voting for Tokenika in the upcoming EOS Block Producer election - we have more exciting EOS projects in the pipeline. Stay tuned!
Incredible work. This is the best kind of campaigning for block producers IMO
Thank you :) We are in this for the long run, so being useful is the only way really ;)
Nice
Thanks for sharing. I've smashed the upvote button for you and i'll check out the ICO.
Also, if you are looking to get some tokens without investing or mining check out Crowdholding (https://www.crowdholding.com). They are a co-creation platform were you get rewarded for giving feedback to crypto startups on the platform. You can earn Crowdholding's token as well as DeepOnion, ITT, Smartcash and many other ERC-20 tokens.
This is amazing work guys. Is there a way I can contribute to this?
Hi, stay tuned, as we'll soon publish a list of features we intend to work on for the next release.
So if you find in it any area you could contribute, just do it and create a pull request.
So is eosfactory a block producer candidit?
Hello :) Tokenika.io - the creator of EOSFactory is a Block Producer candidate. EOSFactory is a name of the smart contract testing platform.
Cool thanks :). The Project sounds good
Looking forward, I hope to have a good experience.
awesome work!
is it possible for one to keep the c++ layer and replace the python one with a .net core built one?
Thanks :)
<p dir="auto">We intend to move the C++ layer (it's called <code>teos) into a separate repository, with EOSFactory having it as a dependency. So yes, once we do that you could use <code>teos as a foundation for other projects. <p dir="auto">Actually, we'd love to see it being used that way, as it was designed with this purpose in mind - that's why it's a static library, not an executable like <code>cleos. <p dir="auto">However, there is one important thing we need to take into account: <code>teos is dependent on EOSIO source code, which unfortunately is incompatible with Windows - you cannot build EOS with any C++ compiler that's available on Windows. We've tried it for a long time and it looks quite hopeless. The main obstacle is that EOS is heavily dependent on an integer type that's not supported by Windows. <p dir="auto">So I guess any .NET-based solution is out of reach, at least at this moment.thanks for the answer. I said .net core which runs on mac and linux ;-)
Wow~ Good Project & Framework
I cheer for EOS Factory!
Fantastic work and project. It's already sped up my deving ten fold.
Thanks question about the steemit messenger is anyone working on it?
will cleos be ready for regular linux anytime soon?