Reader small image

You're reading from  Truffle Quick Start Guide

Product typeBook
Published inJun 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789132540
Edition1st Edition
Languages
Tools
Concepts
Right arrow
Author (1)
Nikhil Bhaskar
Nikhil Bhaskar
author image
Nikhil Bhaskar

Nikhil Bhaskar is the founder and CEO of Ulixir Inca newly founded tech company that builds decentralized and traditional software. He completed B9lab's Ethereum Developer Course, and he is now a certified Ethereum developer. Aside from running Ulixir, he spends his time traveling and eating. He is a bit of a digital nomad; this year, he's lived in five countries and plans to live in six more before the year ends.
Read more about Nikhil Bhaskar

Right arrow

Preface

This book provides an intuitive, step-by-step, and engaging guide on how to write smart contracts and build decentralized applications with Truffle on Ethereum blockchains.

The first section will cover the basics of Truffle, briefly explain how it integrates Solidity and Web3, and get the reader to build a mini-decentralized application. The following sections will dive into migration, testing, and combining Truffle with popular JavaScript frameworks. The final section of this book will cover the best practices and common mistakes in Truffle to increase the reader's level of proficiency in building Dapps with Truffle.

This book will contain code snippets, exercises, and a project that the reader will continuously build throughout their reading journey.

Who this book is for

This book is for JavaScript developers who are interested in learning about writing smart contracts and building decentralized applications on blockchain. The reader of this book will be required to have some basic understanding of JavaScript and web services. Basic knowledge of Ethereum and/or blockchain is also required.

What this book covers

Chapter 1, Truffle for Decentralized Applications, introduces you to Truffle and explains why it is used and how it works from a high level. It will also demonstrate how JavaScript, Solidity, and Web3 interact inside the basic Truffle environment.

Chapter 2, Web3 and Solidity in Truffle, concerns Web3 and its related APIs and uses in Truffle. You will gain an understanding of the fundamentals of Web3 and how it is used in Truffle.

Chapter 3, Choosing an Ethereum Client for Your Dapp, is about various Ethereum clients, and will highlight the use case for each one and show you how to integrate each Ethereum client with your Truffle application.

Chapter 4, Migrating Your Dapp to Ethereum Blockchains, teaches you how to correctly migrate your Truffle application to Ethereum blockchains. You will also learn about common pitfalls when attempting to migrate your application.

Chapter 5, Truffle and Popular JavaScript Technologies, illustrates the use of Truffle with modern JavaScript technologies such as Angular, React, and Node.js. You will learn how to integrate Truffle with JavaScript frontend libraries and frameworks as well as on the backend with Node.js.

Chapter 6, Testing Your Dapp, demonstrates to you the importance of thoroughly testing your smart contracts, detailing various techniques and approaches for successfully testing a Truffle application.

Chapter 7, Truffle Gotchas and Best Practices, explains the common mistakes people make when developing with Truffle, as well as how to remedy them. Lastly, you will learn and understand how to diagnose and resolve common blockchain issues, such as chain syncing, as well as some best security practices.

To get the most out of this book

As mentioned before, basic knowledge of JavaScript and web development, as well as of Ethereum/blockchain, is required. To get the most out of this book, have the GitHub repository (mentioned in the chapters) by your side; simply follow the instructions outlined in each chapter.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Truffle-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Code in Action

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system."

A block of code is set as follows:

web3.eth.getAccounts(callback(error, result){ ... })

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

web3.eth.getAccounts()
.then(function (accounts) {
console.log(JSON.stringify(accounts, null, 2));
})
.catch(function (error) {
console.error(error);
});

Any command-line input or output is written as follows:

make geth

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email feedback@packtpub.com and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at questions@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packtpub.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packtpub.com.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Truffle Quick Start Guide
Published in: Jun 2018Publisher: PacktISBN-13: 9781789132540
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Nikhil Bhaskar

Nikhil Bhaskar is the founder and CEO of Ulixir Inca newly founded tech company that builds decentralized and traditional software. He completed B9lab's Ethereum Developer Course, and he is now a certified Ethereum developer. Aside from running Ulixir, he spends his time traveling and eating. He is a bit of a digital nomad; this year, he's lived in five countries and plans to live in six more before the year ends.
Read more about Nikhil Bhaskar