DEV Community


Posted on

Introduction to web3.js

In this new series, I'll write about web3.js and how to import, connect to geth, and use it in Node.js or client-side JavaScript.

I will also build a web client using web3.js for a smart contract.

The following topics will be covered:

  • Importing web3.js in Node.js and client-side JavaScript
  • Connecting to geth
  • Exploring the various things that can be done using web3.js
  • Discovering various most used APIs of web3.js
  • Building a Node.js application for an ownership contract

web3.js provides us with JavaScript APIs to communicate with geth.

It uses JSON-RPC internally to communicate with geth. web3.js can also communicate with any other kind of Ethereum node that supports JSON-RPC.

It exposes all JSON-RPC APIs as JavaScript APIs; that is, it doesn't just support all the Ethereum-related APIs; it also supports APIs related to Whisper and Swarm.

I will write more about web3.js as we discuss various projects, but for now, let's go through some of the most used APIs of web3.js and then we will build a frontend for our ownership smart contract using web3.js.

Follow me on Twitter for the upcoming updates @dominguezdaniel

Reference: Prusty, N. (2017) Building Blockchain Projects. 1st edn. Packt Publishing. Available at: (Accessed: 24 September 2021).

Discussion (0)