Truffle Deep Dive: Ethereum’s Swiss Army Knife

Rika Goldberg
ConsenSys Media
Published in
8 min readJul 13, 2018

A few weeks ago, we published a list of developer platforms, services, tools, and infrastructure to make Ethereum development less daunting. Although I admit that scouring the web and getting roped into Reddit rabbit holes can be fun (and a good mind mapping exercise), it sucks away precious BUIDL time.

That was precisely our impetus for crowdsourcing a list of the best platforms, services, tools, and infrastructure in the Ethereum ecosystem. We initially leveraged our own teams to create a baseline list, and then opened it up to the broader Ethereum community. We have already received dozens of pull requests — thank you to everyone for contributing! In the spirit of collaboration and to further the community’s mission, please continue submitting pull requests and growing the knowledge base. All of us play a critical role in our shared vision to build a decentralized future.

Deep dive series launch

At ConsenSys, we recognized that there is a need to scratch below the surface and provide a more in-depth explanation of the various platforms, services, tools, and infrastructure captured in the github repository. For that reason, we decided to kick-off a series of posts to do just that.

I am thrilled to be writing the inaugural post on a massively critical component of the Ethereum ecosystem: Truffle. It serves so many different purposes and as the team has accurately dubbed it, Truffle is “your Ethereum swiss army knife.”

First one up to bat: Truffle

ConsenSys functions in many ways like an incubator, now with 50+ decentralized companies. Truffle is one of those companies, and I had the pleasure of interviewing several folks from the Truffle team to talk about topics including Truffle’s mission, strategic goals, and culture. We also discussed ConsenSys’ unorthodox organizational structure — a decentralized, flat meritocracy — and how Truffle has fine tuned this approach to self-organize in a way that works best for them.

Before getting into the interview, however, I’ll provide an overview of the Truffle suite of products, deep diving into some of the features that showcase Truffle’s immense benefits. By the end, you’ll have a full picture of how the Truffle suite really does make developing on Ethereum that much sweeter! So, let’s bite right in.

What is Truffle and is chocolate included?

Truffle is a powerful development framework that makes building on Ethereum way easier. Chocolate is not included, but maybe Truffle can help you develop a DApp to validate the authenticity of a truffle and help us all from getting duped by fake ganaches!

Alright, in all seriousness, Truffle is a must-have for Ethereum developers. Let me start by providing a brief history of the project and what problems Tim Coulter, Truffle’s founder, set out to solve.

Where it all started: a brief history

Tim Coulter was faced with all of the same issues that plagued early Ethereum development: multiple libraries and 20+ steps to interact with smart contracts and deploy them to the Ethereum virtual machine. So, Tim started developing a series of libraries to handle all of the tasks and released the first version of Truffle in 2015. Today, Truffle has become the Ruby on Rails to Ethereum development. It is a mature framework and is on it’s fourth release. The Truffle fam has grown, expanding to a suite of products that includes Ganache and Drizzle. Check out Truffle’s suite usage dashboard. There were 80,000+ downloads of Truffle alone just last month!

Today, Truffle is jam-packed with features to make your life as a developer easy peasy:

  • Built in smart contract compilation: compile solidity code into Ethereum Virtual Machine (EVM) bytecode and create an Application Binary Interface (ABI)
  • Library linking: copy and paste addresses into bytecode
  • Smart contract testing: with mocha and chai, and a solidity testing framework. Javascript is supported as well for testing.
  • Configurable build pipeline: support for custom build processes
  • Network management: deploy to many public or private networks. Can migrate contracts to either a local test net e.g., Ganache (more on this later) or a live network like Ropsten, Rinkeby, or the main Ethereum network
  • Front-end integration: Drizzle (described in more detail below) handles boilerplate front-end tasks required by blockchain applications

Your turn: getting started with Truffle

As I’ve mentioned, Truffle is a mature suite of products. The team has created extensive documentation, including tutorials and even something that they call “Truffle boxes” complete with modules, contracts and libraries, front-end views, and entire dApp examples. If you are so inclined, you can even create your own Truffle box and share it with the community!

I personally benefited from the Pet Shop Tutorial when I was just getting started with Ethereum development. The tutorial provides a great real-world example of how Truffle can be used to create a dApp to identify and track pet adoptions.

Ganache and Drizzle

Truffle is about to get even sweeter. If you haven’t caved yet and found some chocolate to eat, I commend you 😄

Ganache is a personal development blockchain based on Javascript that lives entirely on your local machine. It comes as either a CLI or a GUI, has detailed mining controls (allowing you to set gas limits and block time), has log output, is fully byzantium compatible, and even allows chain forking! (ability to run transactions or deploy contracts against the state of a live network such as mainnet or testnet, without spending any ether).

Drizzle is a collection of front-end libraries that makes writing dApp front-ends easier. It handles crucial tasks like hooking up to the Ethereum blockchain via web3, instantiating contracts, and tracking contract data such as state, transactions, and events.

Now for the sweeter stuff: Truffle team interview

Now that we have covered Truffle’s functionality, let’s get personal and have some fun with the Truffle team. Shout-out to g. nick d'andrea, Engineering Lead, for providing these responses.

How is the Truffle team organized? How are decisions made?

Truffle is a bit more hierarchical than other parts of ConsenSys. Everyone works on multiple projects simultaneously, there is a leadership team (although everyone serves on it), the team has goals and we work within constraints. Something that I found particularly interesting is a management decision list that the Truffle team uses to determine who has the authority to make decisions. There are 5 key pillars:

  1. Decisions you are empowered to make
  2. Decisions you are empowered to make as a team
  3. Decisions you are empowered to make, but must inform me
  4. Decisions you are empowered to make if I approve
  5. Decisions only I can make

The team strives to create a culture in which all decisions fall into the first and second pillar.

ConsenSys encourages flat meritocracy, but since it is also decentralized, spokes are free to make their own choices. Why did you decide to structure yourselves more hierarchically? What other organizational decisions have you made that may differ from the broader mesh?

Truffle seeks to craft great software development tools as a sustainable business. Although the mesh-at-large has the opportunity and the leverage to explore alternative organizational structures, we feel that pursuing this within Truffle would be an experiment, as it lies outside our area of expertise and risks being orthogonal to our goals. That being said, ConsenSys’ holocracy along with our own personal experiences with autonomy, transparency, and flat organizations provide powerful sources of inspiration in helping Truffle continue to refine its conception of organization and leadership.

Can you walk me through a typical day?

Since Truffle is 100% remote, there probably is no good description for a “typical day.” I (Nick) usually wake up around 8 or 9, spend an hour or so getting settled in, and then proceed to spend my mornings catching up on email/GitHub/etc., and getting a sense for what’s ahead. At 1PM, I meet with Chris (the other engineer working on Truffle) for our standup. We discuss issues and work going on, and then proceed to spend the afternoon as heads-down as possible. I try to finish up my work day by 7 or 8pm, with a long lunch somewhere midday.

How do you build rapport and trust on your team?

By encouraging everyone to have a voice, by keeping a “beginner’s mind,” by asking questions, and by recognizing that the craft of engineering software often includes a healthy amount of emotional commitment to our work.

How do you decide to roll out new product features?

Mostly based on what ideas sound exciting and attainable. We have a roadmap with a substantial backlog, so we try to schedule what’s next based on what will help the community as well as make future tasks easier.

Are there any exciting new releases or features you can let the community know about?

Truffle v5 is coming soon, and we’re quite excited about what’s in store:

  • Bring your own compiler! Specify whatever Solidity version you want, and Truffle will automatically download it. Or install Solidity yourself natively for something like a ~4x speed improvement.
  • We’re overhauling the migrations system to make it more reliable and more transparent. Truffle will detect problems with your migrations ahead of time and provide clear output that helps users see exactly what’s going on.
  • Upgrade to Web3js 1.0
  • Improvements to the Truffle console (await, anyone?)
  • and more!

Where do you see Truffle in the next 5 years? What role will it play in the Ethereum ecosystem? What about the blockchain ecosystem?

It’s dangerous to make predictions like that. In 5 years, Truffle will be a mature suite of tools that provide a one-stop-chocolate-shop for smart contract and decentralized application development. Our products already are built on top of each other, and we expect that this relationship will only get stronger — e.g., Ganache will know about your Truffle projects and provide a GUI for seeing deployed instances, etc. Since the community has been so incredible at building all manners of tools, we expect Truffle to extend this integration even further and allow users to mix-and-match their favorite utilities in an easy-to-use way.

How can the community get involved?

Continue raising issues in our GitHub, helping each other with support in our Gitter channel, and of course, contributing great PRs.

Are you hiring? If yes, for which roles?

Truffle is hiring for all our products (Truffle, Ganache, Drizzle), and more! Expect to see job postings soon, as we hope to grow rapidly to keep up with the needs of the community.

Big thank you to the Truffle team for all of their hard work in enabling the growth of the Ethereum and open source communities, helping to improve the role of decentralization in society, and empowering developers to achieve their goals. #missionaccomplished

Special shout out to Tim Coulter, g. nick d'andrea, and Ben Burns for giving me their sweet, precious time to conduct the interview.

Have a sweet tooth?

Check out TruffleCon in Portland, Oregon!

Truffle Github

Truffle Gitter

Connect with me on Linkedin and Twitter!

Disclaimer: The views expressed by the author above do not necessarily represent the views of Consensys AG. ConsenSys is a decentralized community with ConsenSys Media being a platform for members to freely express their diverse ideas and perspectives. To learn more about ConsenSys and Ethereum, please visit our website.

--

--

Rika Goldberg
ConsenSys Media

I'm no longer active on Medium. You can find my latest writing here: https://paragraph.xyz/@sharingiscaring Follow me on Twitter :) https://x.com/RikaGoldberg