In this chapter, we introduce Web3.js, which is a special application programming interface library written in JavaScript. This interface connects our web browser with the Ethereum blockchain node. We will begin this chapter by looking at the differences between geth, Web3.js, and Mist. Then we will learn how to import this API library and get connected with geth. We will then explore the API structure inside the Web3.js library. We conclude the chapter by studying the design of an ownership contract.
After studying this chapter, you will be able to do the following:
- Differentiate between Mist, geth, and Web3.js
- Realize how Web3.js interacts with the Ethereum blockchain
- Use Web3.js to run a basic smart contract
- Know the API structure of Web3.js library
- Understand the design of an ownership contract