From d7dd92169ba5c2d6cd6093aff7e68a4ee766e456 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 13 Jul 2015 15:58:38 +0200 Subject: [PATCH] updated README.md --- README.md | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4b18db1..ebf6749 100644 --- a/README.md +++ b/README.md @@ -17,40 +17,52 @@ You need to run a local ethrereum node to use this library. ### Node.js - $ npm install web3 +```bash +npm install web3 +``` ### Meteor.js - $ meteor add ethereum:web3 +```bash +meteor add ethereum:web3 +``` ### As Browser module Bower - $ bower install web3 +```bash +bower install web3 +``` Component - $ component install ethereum/web3.js +```bash +component install ethereum/web3.js +``` * Include `ethereum.min.js` in your html file. (not required for the meteor package) ## Usage Use the `web3` object directly from global namespace: - console.log(web3); // {eth: .., shh: ...} // it's here! +```js +console.log(web3); // {eth: .., shh: ...} // it's here! +``` Set a provider (HttpProvider) - web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); +```js +web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); +``` There you go, now you can use it: -``` +```js var coinbase = web3.eth.coinbase; var balance = web3.eth.getBalance(coinbase); ``` -For another example see `example/index.html`. +You can find more examples in [`example`](https://github.com/ethereum/web3.js/tree/master/example) directory. ## Contribute!