Book Image

Truffle Quick Start Guide

By : Nikhil Bhaskar
Book Image

Truffle Quick Start Guide

By: Nikhil Bhaskar

Overview of this book

Truffle is a world-class development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier. If you are a web developer wanting to try your hand at developing Dapps with Truffle, then this is the book for you. This book will teach you to write smart contracts and build Dapps with Truffle. You will begin with covering the basics of Truffle, briefly explaining how it integrates Solidity and Web3, in orderto start building a mini decentralized application. Also, you will dive into migration, testing and integrating Truffle with the use of popular JavaScript frameworks. Lastly, you will ship your decentralized application and package it into a product. Moreover, you will go through the best practices in Truffle,so as to increase your proficiency in building Dapps with Truffle. By the end of the book, you will be able to write smart contracts and build decentralized applications with Truffle on Ethereum blockchains.
Table of Contents (9 chapters)

Gas versus gas limit versus gas price

One of the most common concepts to get your head around is the the difference between gas, gas price, and gas limit. Knowing the difference between these different things is crucial. Let's start with gas.


Every transaction you do costs gas. What's gas? Well, it's the fuel needed to execute a transaction, denominated in Gwei, which is usually equal to 1*10-9 ETH. Recall the smallest denomination of ETH, wei, which is 1*10-18 ETH, that denominates the amount you will be paying for the transaction.

As we've seen before, you can specify a gas amount in a transaction. We've done this before using web3. Recall that in Chapter 6, Testing Your Dapp, we had the following...