diff options
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.js | 18 |
1 files changed, 7 insertions, 11 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 index f63fa9115..8c2fc0ba3 100644 --- a/cmd/mist/assets/ext/ethereum.js/example/node-app.js +++ b/cmd/mist/assets/ext/ethereum.js/example/node-app.js @@ -1,16 +1,12 @@ #!/usr/bin/env node -require('es6-promise').polyfill(); - var web3 = require("../index.js"); -web3.setProvider(new web3.providers.HttpRpcProvider('http://localhost:8080')); +web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); + +var coinbase = web3.eth.coinbase; +console.log(coinbase); + +var balance = web3.eth.balanceAt(coinbase); +console.log(balance); -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 |