Nowadays, when Tezos ecosystem is growing rapidly there are a number of development tools with strong support and further upgrade that are intended to make developer’s life easier. Choosing the right development kit is essential for success. In this article, we consider the most popular solutions such as:
- Ligo IDE
- Truffle + Ganache + pascaligo-vscode Plugin
- Baking Bad IDE
Ligo IDE provides the way to dive into smart contract development seamlessly without installing any tools or plugins locally. The IDE offers you to write, deploy and test your contracts manually in your Browser. It is one of the most convenient environments for beginners.
If you open the IDE you will see something like this:
The mock contract is pretty useful to start playing around with the IDE and explore its features. However, if it is one of the standard’s implementations (e.g, FA2) it would be more efficient.
- Code highlighting.
- Ability to compile and deploy smart contracts, estimate the transactions.
- Ability to generate deployment script.
- Support of all Ligo dialects.
- Changes made in IDE aren’t stored. Reloading the page reset the code to the default counter contract.
- No code analysis.
- No web wallet integration. Deployment can only be done with their key or via Tezbridge.
- Contracts can’t be imported.
- No automated testing tools.
Truffle + Ganache + pascaligo-vscode Plugin
Those who are familiar with Ethereum development are likely to hear about Truffle Suit. The experience is almost the same but with some limitations.
Disclaimer: if you are good at Solidity development you may be interested in the interactive Solidity to Ligo course.
Ganache is a sandbox blockchain for rapid development. Install the Tezos-specific version:
npm install -g ganache-cli@tezos
The Ganache-cli utilizes the flextesa docker image so the Docker should be installed beforehand. To launch the blockchain run:
ganache-cli --flavor tezos --seed alice
If the node is successfully started you will see:
Ethereum node is run by default so the
—flavor is required to run the Tezos one.
--seed is helpful to generate the same initial accounts every launch. Delphinet protocol is chosen by default if you are willing to work with the newest Edonet the
--hardfork option can be set:
ganache-cli --flavor tezos --seed alice --hardfork edo
However, using Edonet node with the Truffle framework is discouraged as it’s not supported yet.
Truffle is a featured tool and environment for compiling, deploying and testing your contracts.
Truffle uses the latest dockerized Ligo version so the documentation for Ligo:next should be considered as the most relevant.
Install the tool globally:
npm install -g truffle@tezos
Then to set up the environment for the specific project run:
mkdir tezos-env && cd tezos-envtruffle unbox tezos-example-box
truffle init isn't recommended because the default unboxed project relays on the old ganache version and is broken now.
The project contains the code for a couple of contracts. You can easily compile, deploy, and test them.
To compile the contracts run:
The successful result looks like this:
It will use dockerized ligo compiler to compile your contracts and store artifacts to
If the local network is still up the migrations scripts that are stored in the
./migrations directory can be executed to deploy the contracts to the network. Run:
The output of migrations is quite big and displays all the information about origination operations.
./test folder contains some automated tests and if you are interested in auto checks run:
And the cherry on top is a vscode plugin. It serves the only purpose which is code highlight for Ligo contracts. Without it smart contract development is unbearable.
- Create as many environments as you need.
- Ability to compile and deploy smart contracts, evaluate the transactions.
- Migrations and automated tests can be implemented and run both in the sandbox and real chains.
- The sandbox node doesn’t require any extra configurations. The protocol is automatically activated.
- Contracts are stored locally and the code won’t be lost.
- No support for Edonet protocol in Truffle.
- Code analysis isn’t supported in vscode plugin.
Baking Bad IDE
Bbbox is another IDE. It is designed for Michelson and SmartPy smart contract development so to compile your Ligo contracts the other tools should be used. But the key feature of the IDE is the ability to run the explorer for your sandbox blockchain, it allows you to explore all the network, contract code, and interactions, and many other things.
To get the code and start the node and explorer run:
git clone <https://github.com/baking-bad/bbbox.git> && cd bbboxmake bbbox
It will load a dozen of docker images and run the appropriate containers. It takes some time. Be patient. Then all the useful information related to the local blockchain can be explored at http://127.0.0.1:8000/ :
There is not much information at the start but if you go back to the tezos-example-box project and run migrations there will be something interesting:
It is better to use bbbox along with Truffle as an alternative for ganache-cli or in the context of pure SmartPy or Michelson smart contract development.
- Powerful UI to explore the blockchain events.
- Ability to store chain snapshots.
- Variety of configurations.
- No support for Ligo smart contracts.
To sum up, we have explored the most vivid tools for smart contract development on Ligo. They have their own pros and cons and we hope you have found something the fits your goals the most. In the next post, we will write the first contract and deploy it to the sandbox network.
Stay in touch!
Helpful resources and docs:
- https://www.trufflesuite.com/docs/tezos/truffle/quickstart — Truffle docs
- https://tezostaquito.io/ — Taquito docs (aka. web3 for Tezos)
- https://thanoswallet.com/ — Tezos web wallet
- https://ligolang.org/docs/intro/introduction — Ligo docs
- https://join.slack.com/t/tezos-dev/shared_invite/zt-in60mgbm-E1Os9pdhiODnNui85w1_jA — dev channel
- https://gitlab.com/tzip/tzip — proposals, standards (similar to EIPs)
- https://tezosacademy.io/, https://tezos-monsters.com/ — games for Ligo learning
- https://learn.tqtezos.com/ — Tezos high-level docs
- https://tezos.gitlab.io/whitedoc/michelson.html — Michelson docs
- https://better-call.dev/ — advanced explorer