By
Lyubomir Kiprov
February 6, 2020
4 Min Read
If you are not familiar with what EOS is and what capabilities it has, you can check here. EOSIO is a next-generation, open-source blockchain protocol with industry-leading transaction speed and flexible utility. Introduced in May 2017, it has since been widely recognized as the first performant blockchain platform for businesses across the world.
The purpose of this article is to walk you through EOSLIME, a development tool for EOS blockchain protocol and give you a high-level overview of its capabilities.
First of all, I am happy for you to be here!
I assume there are three possible answers to the question above:
If your answer is one of the last two, you are reading the right article.
You are not very attracted by doing your smart contract tests on C++. Are you? You prefer an easier and more intuitive way of doing testing, right? So did I…
Most of the tutorials show you how to compile and deploy a smart contract manually with CLEOS or in the best case with a bash script. I can bet you found it a bit annoying… I had the same feeling…
If we could have our contracts, tests, deployments in one consistent place, we would be more effective and have more time for the fun parts of the blockchain development. If only we could…
EOSLIME is trying to be the framework that gives you an easier and more programmatic way of doing the EOS smart contracts development. With this idea in mind, EOSLIME skips a lot of mess while letting you focus on the logic of the tests.
EOSLIME is a Javascript npm package. It was developed with the idea to be able to write Javascript tests. Eosjs tests are time-consuming due to the lack of documentation. Eosjs also has a way too much flexibility in my view and this makes it non-intuitive.
EOSLIME started as a simple testing library with few helper utilities and became an EOS development tool and unit testing framework. It makes the process of unit testing, deployment, and compilation much simpler and much easier. All of this is possible with the help of the lovely community. Thank you, guys!
EOSLIME could be mentally divided into 2 pieces:
EOSLIME provides awesome features and a flexible way of writing Javascript unit tests. The unit tests part of the framework are based on mocha. Yes, you have all of the mocha power integrated.
EOSLIME provides several ways of creating a new account:
Have you heard about the power that EOS account-model gives? Have you heard about authorities or the Multisignature possibilities? Did you try out these features? If so, I can bet, you had a hard time trying to get these concepts up and running on the first shot.
EOSLIME takes away all that pain and enables full management with just simple functions.
Authorities management
Multisignature account management
Yes, you can instantiate contracts or deploy them directly from the code. You have the flexibility to choose how to instantiate or deploy your contract so it will suit your needs in the best way. You can instantiate an already existing contract from ABI and WASM files or you can do it directly with the contract name.
Do you have an existing account to deploy on your contract? Nooo … You should create your account manually and hard code it in the tests. But what happens if you need this contract to be empty for your second test suit, the logic won’t work in this case. So, let’s use EOSLIME to create a fresh account for you and let it deploy contracts any time you need it. A new contract per test suit for testing the logic in a flexible way. I personally found this approach as a solution to write independent unit tests and keep the best practices.
How would you call contract functions? Just like that:
Enough easy, right?
Have you ever needed to get the raw transaction of contract action or the signed one without broadcasting it to the network? You could do it in an easy way just like that:
Alright… I can instantiate contracts and call their actions.
How to broadcast action from another account?
How to force a transaction to be unique like cleos -f option?
I have an action which should be paid for
Now, when you have the full power of contract actions in your hands you are able to … WAIT!
I can write, but how to read?
Do you really think EOSLIME will leave you with this annoying and long syntax 😉
There is a Query Chain Style. Yes, you can construct your queries almost the same way you will with SQL. However, SELECT(contract table) and FROM(contract account) clauses are preset
The utils are there for your facilitation.
Do you want a random name for your account? Let EOSLIME generate one for you
You have a private key but don’t have a name for your account yet? Let EOSLIME generate one based on your private key
Do you need a private/public keys pair? Let EOSLIME generate this for you
At the moment there are 4 CLI commands supported and you may find them very useful
Init ( eoslime init )
This command sets up for you a ready to use files structure. If you are new to EOSLIME, there is always a possibility to init an exampled template.
Compile ( eoslime compile )
Use this command to compile your contracts
Deploy ( eoslime deploy )
Write some deployment scripts and let EOSLIME execute them on the blockchain.
Test ( eoslime test )
Write some Javascript unit tests and let EOSLIME run them.
Have you ever wondered how much resources your contract actions use on the chain? If so, I can bet that you are running action by action and search in the transaction receipt the resource usage. Give a chance to EOSLIME do it for you from now on
First of all, thank you very much for being here and reading my work. I am so thankful because YOU and the community are the reason why EOSLIME exists.
If you find EOSLIME an interesting EOS development tool and unit testing framework, but you still need a reason to give it a try, that means I should have probably written this article a way better. Please tell me if I failed to convince you.
But in the end, I am just a developer. Give a chance to the voice of the community to impress you. Read the comparison of the current EOS development tools here
EOSLIME aims to help EOS developers. That is why we are always open for ideas and feedback on the framework and how we can make it even better:
I would like to invite you to become part of the EOSLIME community and help us improve the framework:
Telegram https://t.me/eoslime
NPM package – https://www.npmjs.com/package/eoslime
Documentation – https://docs.eoslime.limechain.tech
Github – https://github.com/LimeChain/eoslime
Hello my dear reader, I am Lyubo. Thank you again for being here and reading my article. Here are some details about my personality.
How I am related to EOSLIME – I am the main developer behind the framework.
What experience I have in the blockchain world – I am a blockchain developer for 2.5 years. The first year I was working with Ethereum blockchain. After that, I moved to EOS one.
Where I am working – I am working at LimeChain as a blockchain developer. The company provides DLT and blockchain solutions to clients worldwide, with a focus on public and private blockchain development, as well as smart contract development. We help startups and corporate clients build secure, trusted and decentralized environments and products using Blockchain and DLT. Learn more on LimeChain’s Twitter and on our website limechain.tech