From e42517754ac2912b6d3ca78a34b8aeadf8805906 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 22 Dec 2014 11:57:13 +0100 Subject: updated ethereum.js --- cmd/ethtest/example/node-app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 cmd/ethtest/example/node-app.js (limited to 'cmd/ethtest/example/node-app.js') diff --git a/cmd/ethtest/example/node-app.js b/cmd/ethtest/example/node-app.js new file mode 100644 index 000000000..f63fa9115 --- /dev/null +++ b/cmd/ethtest/example/node-app.js @@ -0,0 +1,16 @@ +#!/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); +}); \ No newline at end of file -- cgit v1.2.3