diff options
author | Marian Oancea <contact@siteshop.ro> | 2014-11-06 01:46:01 +0800 |
---|---|---|
committer | Marian Oancea <contact@siteshop.ro> | 2014-11-06 01:46:01 +0800 |
commit | 4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c (patch) | |
tree | c368675984eb642f13334f2e61f6401d58776863 /example/node-app.js | |
parent | 3e174a08790ca009a2107a3564b179ae1f036c33 (diff) | |
download | dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.gz dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.bz2 dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.lz dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.xz dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.zst dexon-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.zip |
Converted to node module
Converted to npm package
Added brower
Added browserify with minification
Updated Readme
Diffstat (limited to 'example/node-app.js')
-rw-r--r-- | example/node-app.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/example/node-app.js b/example/node-app.js new file mode 100644 index 000000000..f63fa9115 --- /dev/null +++ b/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 |