aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ethtest/example/node-app.js
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-22 18:57:13 +0800
committerobscuren <geffobscura@gmail.com>2014-12-22 18:57:13 +0800
commite42517754ac2912b6d3ca78a34b8aeadf8805906 (patch)
treec69969cf68d0fd20598c531db394cbff864547dd /cmd/ethtest/example/node-app.js
parenta153b47c2be80bbfb38954c5eae310305d54120b (diff)
downloadgo-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.tar
go-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.tar.gz
go-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.tar.bz2
go-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.tar.lz
go-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.tar.xz
go-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.tar.zst
go-tangerine-e42517754ac2912b6d3ca78a34b8aeadf8805906.zip
updated ethereum.js
Diffstat (limited to 'cmd/ethtest/example/node-app.js')
-rw-r--r--cmd/ethtest/example/node-app.js16
1 files changed, 16 insertions, 0 deletions
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