Hands-On Blockchain Development in 7 Days

Book Description

Build an Ethereum gaming application from scratch in a span of seven days, by mastering smart contracts in Solidity

Key Features

  • Create a simple, functional decentralized application, on the Ethereum network
  • Learn fundamental blockchain programming concepts to become a blockchain developer
  • Understand the development life cycle of a blockchain application

Book Description

Blockchain is a revolutionary technology that is currently been used in a variety of industrial applications, such as finance, healthcare, data analytics, and much more. This book will teach you the key blockchain principles and methodologies that are required to build decentralized applications in just 7 days.

This book will teach you to build an online gaming application using Ethereum. Each section will introduce fundamental blockchain programming concepts as they relate to creating an online game, followed by practical exercises that readers can implement as homework assignments. With this book, you will learn core blockchain application development skills, create smart contracts, and build user interfaces. You will not only learn how to interact with the Ethereum network, but also how to deploy your application to the Internet. This book supplies seven self-contained lessons taught in a practical, hands-on way.

By the end of the book, you will be amazed at how much you have learned about the blockchain application development on the Ethereum network, in just one week!

What you will learn

  • Work with blockchain networks to create interactive applications
  • Learn how to create and use variables in smart contracts
  • Use automated tests to eliminate mistakes and errors in the code
  • Interact with the Ethereum network from a user interface
  • Build a user interface for smart contracts using React
  • Send and receive funds in smart contracts using wallets
  • Deploy blockchain applications on AWS

Who this book is for

This book is for software engineers and IT professionals, who are eager to learn blockchain application development skills and want to master how blockchain applications are developed. This book is perfect for those with limited programming experience.

Publisher Resources

Download Example Code

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Blockchain Development in 7 Days
  3. About Packt
    1. Why subscribe?
    2. Packt.com
  4. Contributor
    1. About the author
    2. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. Day One - Application Introduction, Installation, and Setup
    1. Introduction to our application
    2. Installing the required tools
      1. Visual Studio Code
      2. Node.js
      3. Truffle framework and Ganache
    3. Creating our first smart contract
      1. Analyzing the contracts
      2. Testing the contract
    4. Understanding the basic syntax
      1. Code layout
      2. Blank lines
      3. Line lengths
      4. Function layout
      5. Naming conventions
    5. Writing your first test
    6. Assignment
    7. Summary
  7. Day Two - Solidity Variables and Data Types
    1. Understanding Solidity variables
      1. Understanding visibility
    2. Data types in Solidity
      1. Value types
      2. Reference types
    3. Using Solidity variables
      1. Ether units
      2. Other special units
    4. Understanding Solidity operators
    5. Using Solidity operators
      1. Operators in our application
    6. Assignment
    7. Summary
  8. Day Three - Implementing Business Logic in Your Smart Contracts
    1. Solidity functions 
    2. Adding code to functions
      1. Variable scope
      2. Events
      3. Constructor
      4. Fallback function
    3. Function visibility
      1. Visibility in a nutshell
      2. View functions
      3. Pure functions
    4. Using functions to execute business logic
    5. Understanding modifiers
      1. The require function
    6. Assignment
    7. Summary
  9. Day Four - Creating Tests
    1. Understanding unit tests and integration tests
      1. Why write tests?
        1. Unit tests
        2. Integration tests
    2. Testing strategies for various applications
      1. Testing for success
      2. Testing for failure
      3. Testing using Solidity
      4. Testing using JavaScript
    3. Creating unit tests in Solidity
      1. Solidity test conventions
    4. Multiple tests for the same function under test
    5. Creating integration tests in JavaScript
    6. Running test suites
    7. Assignment
    8. Summary
  10. Day Five - Building a User Interface
    1. Understanding the role of JavaScript and React in a DApp
    2. Creating React apps from templates
      1. Pros and cons
    3. Displaying game state to players
    4. Getting player input from the UI
    5. Providing feedback to the player
    6. Implementing JavaScript promises in a networked application
      1. How a promise works
    7. Using Web3.js to communicate with the Ethereum network
    8. Implementing JavaScript functions in a UI
    9. Assignment
    10. Summary
  11. Day Six - Using Wallets
    1. Understanding wallets and security
    2. Introduction to the wallet
      1. Types of wallets
    3. MetaMask 
    4. Understanding gas price and gas limits
      1. Ethereum gas
      2. Gas price
    5. Viewing blockchain transactions on the Ethereum network
    6. Understanding online and offline wallets
      1. Distributed ledgers
      2. Multiple ledgers
      3. Paper wallets
      4. Hardware wallets
      5. Mobile and desktop wallets
    7. Injecting the Web3 provider
    8. Assignment
    9. Summary
  12. Day Seven - Deploying to the Network
    1. Understanding the role of UI and smart contract
    2. Deploying smart contracts to the Ethereum network
      1. Geth
    3. Obtaining ether for use in test networks
    4. Deploying the UI to AWS
    5. Assignment
    6. Summary
  13. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product Information

  • Title: Hands-On Blockchain Development in 7 Days
  • Author(s): Will Button
  • Release date: February 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781838640101