How To Connect To Web3.0 With Nodejs?

Farhad Razzaghi
2 min readFeb 11, 2022

Today, Web3.0 is one of the most noticeable contents that you will encounter in the world of programming. But let me first give you a brief overview of what Web3.0 is.

What is Web3.0?

For this explanation of Web3.0, I need to first tell you why 3.0. The use of the number 3 is because we actually had web1.0 and web2.0 in the past, and now we have entered the third version.

Web1.0 was, in fact, the static pages in the Internet world that we all either remember or see as images of. After this version, Web2.0 was released, during which platforms such as Facebook, Amazon, etc. were created.

We have now entered the era of Web3.0. In a nutshell, in Web3.0, the ownership of everything you produce is clear, and any published content is owned accordingly. Do not be afraid that anonymity is not going to disappear in the world of the Internet. It is only clear that the owner of this content is this user. But the real identity of this user is not known. So do not be afraid of Web3.0.

Web3.0 and Blockchain

These days, wherever we hear the name Web3.0, we will hear the name blockchain. This is because Web3.0 is one of the most important development tools in blockchain today, in fact, Web3.0. And due to the widespread use of blockchain these days, this tool has also received a lot of attention.

Web3.0 and Nodejs

Today we want to learn how to work with Web3.0 tools in Nodejs. So join me to start learning together.

First, you need to install the Web3.0 package with this command:

npm i web3

Now create a file called app.js and import web3.0 into the project:

const Web3 = require('web3');

Now we need an HTTP provider to use Web3.0 before we can use Web3.0 to send our requests to this HTTP provider. Here we want to use the HTTP provider binance to get started. Its address is as follows:

https://bsc-dataseed1.binance.org

Now we need to connect web3.0 to this HTTP Provider. Which we do as follows:

const appWeb3 = new Web3(new Web3.providers.HttpProvider("https://bsc-dataseed1.binance.org"));

And congratulations, you have now successfully connected to HTTP Provider Binance using web3.0 and use its tools.

Conclusion:

In this article, we learned what Web3.0 is, and then we learned why it is known as the third version of the Web, and what the previous versions of the Web had in common, and then explained what the purpose of Web3.0 is. Finally, we learned how to use Web3.0 and add it to the HTTP provider.

Stay tuned for the next parts of this article.

Please like me to motivate me to continue this path and Please Feel Free For Ask Me questions you have.

--

--