Book Image

Mastering Ethereum

By : Merunas Grincalaitis
Book Image

Mastering Ethereum

By: Merunas Grincalaitis

Overview of this book

Ethereum is one of the commonly used platforms for building blockchain applications. It's a decentralized platform for applications that can run exactly as programmed without being affected by fraud, censorship, or third-party interference. This book will give you a deep understanding of how blockchain works so that you can discover the entire ecosystem, core components, and its implementations. You will get started by understanding how to configure and work with various Ethereum protocols for developing dApps. Next, you will learn to code and create powerful smart contracts that scale with Solidity and Vyper. You will then explore the building blocks of the dApps architecture, and gain insights on how to create your own dApp through a variety of real-world examples. The book will even guide you on how to deploy your dApps on multiple Ethereum instances with the required best practices and techniques. The next few chapters will delve into advanced topics such as, building advanced smart contracts and multi-page frontends using Ethereum blockchain. You will also focus on implementing machine learning techniques to build decentralized autonomous applications, in addition to covering several use cases across a variety of domains such as, social media and e-commerce. By the end of this book, you will have the expertise you need to build decentralized autonomous applications confidently.
Table of Contents (17 chapters)
Free Chapter
1
Section 1: Blockchain - Ethereum Refresher
5
Section 2: Decentralized Application Development Workflow
12
Section 3: Ethereum Implementations

Setting up and configuring Ethereum and Truffle

Now that we have the required tools, we'll set up the basic file structure so that we have a clean environment to work with for all of our desired dApps. You'll be able to use it over and over as long as you need to, because it has all the dependencies set up.

First, let's create a folder called dapp, which will contain all of our files. Then, with your Terminal or command line, execute truffle init to set up Truffle, making sure that you're inside the dapp folder.

After installing Truffle in that folder, run npm init to set up your package.json file of Node.js that will allow you to install npm plugins. It will ask you for some general information about your project; simply fill it in as you please or press Enter to leave them empty, which is what I usually do unless I'm planning on distributing that project...