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.