3

Reason is that I wanted to know what Ethereum blockchain client uPort uses and someone said it's web3.js.

I haven't understood this concept enough since I was expecting something like eth, geth or pyethapp. This may be a noob question but I just wanted to ask to clarify some things.

2 Answers 2

3

No, web3.js or any other implementation is just a "portal" to the actual Ethereum clients which accept JSON-RPC calls.

Essentially, instead of you doing custom HTTP calls in JavaScript, the web3 community developed a nice, off-the-shelf package for you to install and use right away. That means that you should either run your own node or connect to a service like Infura.

0
1

Web3.js is a JavaScript framework for interfacing with a node synchronised to the Ethereum blockchain.

In the same way that jQuery is a framework for achieving more complex requirements without having to write raw JavaScript.

When making requests to an Ethereum node (like those provided by Infura) you have to format your requests in a specific manner - that outlined in the JSON-RPC specification and implemented by Ethereum node clients like Geth and Parity.

Similarly when returning a response web3.js handles lots of the legwork involved in converting the response to a human consumable format.

You can interface with an Ethereum node directly for example by making appropriately formatted CURL requests like those outlined in the Parity documentation but using a library like web3.js saves you from reinventing the wheel and means that developers can focus on their core product.

There are other libraries that do similar things. For example ethers.js.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.