Getting started with Buidler
Increase your productivity with flexible Ethereum development tools
Buidler is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want. Take a look at our vision post or head over to Github to learn more.
In this guide, we’ll explore how to start using Buidler in your Ethereum project.
What makes Buidler special? What can you achieve with it?
Buidler allows you to streamline your development workflow by making it easy to incorporate other tools into your process, as well as granting you all the flexibility you need to adapt the tools to your exact needs. What dependencies and tools you use is up to you. Buidler will only help you orchestrate them.
Out of the box, you can compile your Solidity code, install plugins and create your own tasks.
Let’s install it to try it out:
npm install @nomiclabs/buidler
To create a Buidler project just run
npx buidler in your project folder:
Let’s create the sample project and go through the steps to try out the sample task, compile, test and deploy the sample contract.
If you take a look at
buidler.config.js, you will find the definition of the task
NOTE: in the Buidler 1.0.0 beta release we’ve disabled the automatic ganache instance feature to keep working on its stability, so you’ll need to run it manually. This feature will be back by the time we ship the stable release. Run
To run it, try
npx buidler accounts:
If you would like to learn how to create your own tasks, take a look at our task creation guide.
Next, if you take a look at
contracts/, you should be able to find
To compile it, simply run:
npx buidler compile
Integration with TruffleContract from Truffle 4.
Integration with TruffleContract from Truffle 5.
Injects the Web3 1.x module and a live instance into the Buidler Runtime Environment.
Injects the Web3 0.20.x module and a live instance into the Buidler Runtime Environment.
Injects ethers.js into the Buidler Runtime Environment.
The sample project comes with a test written using the Ethereum provider, but let’s also install
buidler-truffle5 and test out the Truffle 5 integration:
npm install @nomiclabs/buidler-truffle5 @nomiclabs/buidler-web3 email@example.com
require("@nomiclabs/buidler-truffle5") to the top of your buidler.config.js, and let’s change
npx buidler test
You can then deploy by writing a deployment script with the Truffle 5 plugin:
npx buidler run scripts/deploy.js
Congrats! You have created a project, ran a Buidler task, compiled a smart contract, installed a Truffle integration plugin, wrote and ran a test using the Truffle plugin, and deployed a contract.
These cover the basics to start using Buidler. Head over to Github for more guides that cover the more advanced usage that allow your process and dev toolkit to be amazingly flexible.
For any questions or feedback you may have, you can find us in the Buidler Support Telegram group.