web3.js/example/node-app.js
Shayan Eskandari 7df9c539c3 Improvement on Readme.md (#944)
* HTTP Basic Auth, some cleanups

There’s no need for additional dependency `btoa` as `XHR2` already has
the support for Basic Auth.

* remove redundant code

* fix semicolons

* Rewrite Basic Auth to support both sync and async calls.

* semicolon consistency

* Documentation for Basic Auth connection added.

* Add Community and Other implementations to README

* remove contributors
2017-07-27 15:40:24 +02:00

13 lines
295 B
JavaScript

#!/usr/bin/env node
var Web3 = require('../index.js');
var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
var coinbase = web3.eth.coinbase;
console.log(coinbase);
var balance = web3.eth.getBalance(coinbase);
console.log(balance.toString(10));