7 Web3 and a channel Dapp

 

This chapter covers

  • Accessing Ethereum node functions using the web3 API
  • Programming with web3 modules and a web3 provider
  • Designing a Dapp with a channel application model
  • Implementing a micropayment channel for a global cleanup problem
  • Integrating off-chain operations and on-chain operations

The focus of this chapter is on web3. Using web3, you can pretty much set your Dapp on autopilot. But what is it? The web3 API is a comprehensive package for accessing blockchain functions. Blockchain infrastructure provides services that include account management, recording of transactions, and smart contract execution, all of which we’ve explored in previous chapters. Web3 exposes these functions of the Ethereum blockchain node and facilitates interactions between external applications and the blockchain node. This chapter demonstrates its role and reinforces your knowledge of and skills in application development with web3. You’ll learn about various functional modules defined in the API and explore its use through a practical example, developing a versatile channel model and applying it to build a Dapp for facilitating global recyclable plastics cleanup.

Definition web3.js is a JavaScript library—commonly referred to as web3—that enables applications to access the services offered by the Ethereum blockchain node.

7.1 The web3 API

 

7.1.1 Web3 in the Dapp stack

 
 
 
 

7.1.2 Web3 packages

 

7.2 The channel concept

 
 
 

7.2.1 The micropayment channel

 
 
 

7.3 Micropayment channel (MPC) use case

 
 
 
 

7.3.1 Traditional banking solution

 
 
 

7.3.2 Users and roles

 
 

7.3.3 On-chain and off-chain operations

 
 

7.3.4 MPC smart contract (MPC-contract)

 
 

7.3.5 MPC application development (MPC-app)

 

7.3.6 MPC sequence diagram

 
 
 

7.3.7 Demonstration of MPC execution

 
 

7.3.8 Accessing the web3 provider

 

7.3.9 Extensions of MPC

 
 

7.3.10 Relevance of the micropayment channel

 
 
 

7.3.11 Other web3 packages of interest

 
 
 

7.4 Best practices

 

7.5 Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest