aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist/assets/ext/ethereum.js/example/node-app.js
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-09 20:01:21 +0800
committerobscuren <geffobscura@gmail.com>2015-01-09 20:01:21 +0800
commit18d8bf4b9cf5ac405aaefd5c949a4ccd26847a02 (patch)
tree5950aa2278d7aaa858155001c9b92d65f10a000c /cmd/mist/assets/ext/ethereum.js/example/node-app.js
parentaee82d3196711f0dc46a625e31dc3a642e4e889b (diff)
downloadgo-tangerine-18d8bf4b9cf5ac405aaefd5c949a4ccd26847a02.tar.gz
go-tangerine-18d8bf4b9cf5ac405aaefd5c949a4ccd26847a02.tar.zst
go-tangerine-18d8bf4b9cf5ac405aaefd5c949a4ccd26847a02.zip
updated ethereum.js
Diffstat (limited to 'cmd/mist/assets/ext/ethereum.js/example/node-app.js')
-rw-r--r--cmd/mist/assets/ext/ethereum.js/example/node-app.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/mist/assets/ext/ethereum.js/example/node-app.js b/cmd/mist/assets/ext/ethereum.js/example/node-app.js
new file mode 100644
index 000000000..f63fa9115
--- /dev/null
+++ b/cmd/mist/assets/ext/ethereum.js/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