mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
388 B
16 lines
388 B
#!/usr/bin/env node
|
|
|
|
require('es6-promise').polyfill();
|
|
|
|
var web3 = require("../index.js");
|
|
|
|
web3.setProvider(new web3.providers.HttpRpcProvider('http://localhost:8080'));
|
|
|
|
web3.eth.coinbase.then(function(result){
|
|
console.log(result);
|
|
return web3.eth.balanceAt(result);
|
|
}).then(function(balance){
|
|
console.log(web3.toDecimal(balance));
|
|
}).catch(function(err){
|
|
console.log(err);
|
|
}); |