A premise, I have confused ideas about smart contract client.

I would like to create a website, that runs a classic browser, with a javascript file imported that can execute functions on the blockchain.

I've seen Web3JS but it seems to be a NodeJS library (in fact it use the require() function that is not a built-in function in a Javascript console). I'm searching for a way to connect to the remote node and then execute the smart contract on it and then read the output. But, if a user that uses my website has a local node running, then I use its node instead of my remote node.

Can anyone help me to understand which components I need and how to orchestrate all the components?

I don't know, help me to understand, if instead of connecting to remote node, is it possible to start a light-client on a client browser in a few second?


See https://programtheblockchain.com/posts/2017/12/13/building-decentralized-apps-with-ethereum-and-javascript/ for my writeup of the basics.

The most common choices in brief:

  • Web3.js works well in the browsers.
  • MetaMask is a browser extension that keeps users in control of their private keys. It can connect to a local node or a remote one.
  • Infura is the public node that MetaMask connects to by default.
  • I would mark this answer as the correct one. – Daniel Apr 8 '18 at 4:21

Your Answer

