Search code examples
blockchainethereum

How would one create a new Ethereum node from the browser?


I'm reading the Web3 documentation and I see that using it in the console requires a running Ethereum node. But since plenty of DApp users will be new to Ethereum, what are the standard ways of generating new nodes from the browser?

Of course, this can be done with the Geth command line tools - but how does one use these tools in the console?


Solution

  • As far as I know, there is not yet a way to run a node in the browser but you can get to something apparently close using Metamask.

    If you use geth, you can start it with geth console, that will give you access to the console.

    If you started a node with rpc (geth or other) you can attach geth to it with geth attach http://localhost:8545

    If you are running a DAPP in your browser, it very likely loaded web3.js into your browser for you. If you open the dev console, you can also access web3 through the console.

    Finally, you can also use Metamask (a chrome extension) that will inject web3.js in your browser. From there, you can open the dev console and start issuing commands such as web3.eth.accounts