Building Ethereum Dapps

Book description

Building Ethereum Dapps introduces you to decentralized applications based on the Ethereum blockchain platform. In this book, you'll learn the principles of Dapps development by rolling up your sleeves and actually building a few!



About the Technology

Imagine unbreakably secure applications that handle personal and business transactions without any central agency controlling the process. Decentralized applications, or Dapps, do just this, shifting power to users. The Ethereum blockchain platform provides the tools you need to build Dapps, including an innovative “smart contracts” model and Solidity, a Dapp-aware JavaScript-like programming language.



About the Book

Building Ethereum Dapps teaches Dapps development on the Ethereum blockchain platform. You’ll begin with a mental model of how Dapps operate, and then dive into designing and implementing smart contracts in Ethereum’s Solidity language. You’ll explore Ethereum smart contract development tools, like Truffle and Web3, and pick up best practices for design and security. Practical exercises throughout give you valuable hands-on experience.



What's Inside

  • Ethereum’s key components
  • Implementing smart contracts in Solidity
  • Communicating with a smart contract in Web3
  • Developing Dapps with Truffle
  • Best practices for design and security improvement


About the Reader

For developers with intermediate experience in JavaScript or an OO language. Familiarity with blockchain concepts is helpful.



About the Author
Roberto Infante is a software development consultant who specializes in finance. He currently works on financial risk management systems and on blockchain technology.

We interviewed Roberto as a part of our Six Questions series. Check it out here.



Quotes
Blockchain is about interoperability, and Roberto understands this innately. He arms you with the tools of experts while keeping you aware of the bigger picture.
- From the Foreword by Thomas Bertani, CEO of Oraclize

An excellent and singular resource for learning blockchain development.
- James Nyika, Vocanter

Amazing visuals! They make hard concepts intuitive, simple, and fun.
- Tanya Fesenko, Motiion

Finally, a guide that takes readers on the exciting journey of learning blockchain. This book is proof that writing Dapps is not hard.
- Rahul Rai, Telstra

Table of contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. Foreword
  5. Preface
  6. Acknowledgments
  7. About this book
  8. About the author
  9. About the cover illustration
  10. Part 1.
    1. Chapter 1. A first look at decentralized applications
      1. 1.1. What is a Dapp?
      2. 1.2. Good and bad Dapps
      3. 1.3. A five-minute Dapp implementation
      4. Summary
    2. Chapter 2. Understanding the blockchain
      1. 2.1. A deeper look at decentralized applications
      2. 2.2. What technologies make Dapps viable?
      3. 2.3. Ethereum’s history and governance
      4. Summary
    3. Chapter 3. The Ethereum platform
      1. 3.1. Connecting to Ethereum through the wallet
      2. 3.2. Smart contracts: The brain of Dapps
      3. 3.3. Connecting to Ethereum with geth
      4. 3.4. Managing accounts with geth
      5. 3.5. Revisiting SimpleCoin’s contract
      6. Summary
    4. Chapter 4. Deploying your first smart contract
      1. 4.1. Deploying a contract onto the network
      2. 4.2. Interacting with the contract
      3. 4.3. Nodeless deployment through MetaMask
      4. Summary
  11. Part 2.
    1. Chapter 5. Programming smart contracts in Solidity
      1. 5.1. EVM contract languages
      2. 5.2. High-level contract structure
      3. 5.3. Solidity language essentials
      4. 5.4. Time to improve and refactor SimpleCoin
      5. Summary
    2. Chapter 6. Writing more complex smart contracts
      1. 6.1. Introducing SimpleCrowdsale, a crowdsale contract
      2. 6.2. Extending functionality with inheritance
      3. Summary
    3. Chapter 7. Generalizing functionality with abstract contracts and interfaces
      1. 7.1. Making a contract abstract
      2. 7.2. Allowing multiple contract implementations with interfaces
      3. 7.3. Real-world crowdsale contracts
      4. 7.4. Recap of Solidity’s object-oriented features
      5. 7.5. Libraries
      6. 7.6. Making SimpleCoin ERC20 compliant
      7. Summary
    4. Chapter 8. Managing smart contracts with Web3.js
      1. 8.1. Revisiting deployment through geth’s interactive console
      2. 8.2. Interacting with SimpleCoin through geth’s console
      3. 8.3. Simplifying command-based deployment with Node.js
      4. 8.4. Deploying on a private network
      5. 8.5. Making development more efficient by deploying on mock networks
      6. 8.6. Smoother interaction with SimpleCoin through a web UI
      7. Summary
  12. Part 3.
    1. Chapter 9. The Ethereum ecosystem
      1. 9.1. The core components
      2. 9.2. A bird’s-eye view of the full ecosystem
      3. 9.3. Decentralized address resolution with ENS
      4. 9.4. Decentralized content storage
      5. 9.5. Accessing external data through oracles
      6. 9.6. Dapp frameworks and IDEs
      7. Summary
    2. Chapter 10. Unit testing contracts with Mocha
      1. 10.1. Installing Mocha
      2. 10.2. Setting up SimpleCoin in Mocha
      3. 10.3. Writing unit tests for SimpleCoin
      4. Summary
    3. Chapter 11. Improving the development cycle with Truffle
      1. 11.1. Setting up Truffle
      2. 11.2. Moving SimpleCoin under Truffle
      3. Summary
    4. Chapter 12. Putting it all together: Building a complete voting Dapp
      1. 12.1. Defining the requirements of a voting Dapp
      2. 12.2. The development plan
      3. 12.3. Starting the Truffle project
      4. 12.4. Implementing the voting contract
      5. 12.5. Compiling and deploying SimpleVoting
      6. 12.6. Writing unit tests
      7. 12.7. Creating a web UI
      8. 12.8. Food for thought
      9. Summary
  13. Part 4.
    1. Chapter 13. Making a Dapp production ready
      1. 13.1. Event logging
      2. 13.2. Designing an upgradeable library
      3. 13.3. Designing an upgradeable contract
      4. Summary
    2. Chapter 14. Security considerations
      1. 14.1. Understanding general security weak spots
      2. 14.2. Understanding risks associated with external calls
      3. 14.3. How to perform external calls more safely
      4. 14.4. Avoiding known security attacks
      5. 14.5. General security guidelines
      6. Summary
    3. Chapter 15. Conclusions
      1. 15.1. Evolution of Ethereum
      2. 15.2. Alternative Ethereum implementations
      3. 15.3. Beyond the Ethereum blockchain
      4. Summary
  14. Appendix A. SimpleCoin inherited from Ownable
  15. Appendix B. Full SimpleCrowdsale application
  16. Appendix C. SimpleCoin Mocha unit testing suite
  17. Appendix D. impleVoting contract
  18. The Lifecycle of a Voting Transaction
  19. Full View of the Current Ethereum Ecosystem
  20. Index
  21. List of Figures
  22. List of Tables
  23. List of Listings

Product information

  • Title: Building Ethereum Dapps
  • Author(s): Roberto Infante
  • Release date: March 2019
  • Publisher(s): Manning Publications
  • ISBN: 9781617295157