mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 11:38:12 +00:00
updated README.md
This commit is contained in:
parent
b13ed4ee27
commit
4583998bfb
24
README.md
24
README.md
@ -33,14 +33,13 @@ Component
|
|||||||
$ component install ethereum/web3.js
|
$ component install ethereum/web3.js
|
||||||
|
|
||||||
* Include `ethereum.min.js` in your html file. (not required for the meteor package)
|
* Include `ethereum.min.js` in your html file. (not required for the meteor package)
|
||||||
* Include [bignumber.js](https://github.com/MikeMcl/bignumber.js/) (not required for the meteor package)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
Use the `web3` object directly from global namespace:
|
Use the `web3` object directly from global namespace:
|
||||||
|
|
||||||
console.log(web3); // {eth: .., shh: ...} // it's here!
|
console.log(web3); // {eth: .., shh: ...} // it's here!
|
||||||
|
|
||||||
Set a provider (QtSyncProvider, HttpProvider)
|
Set a provider (HttpProvider)
|
||||||
|
|
||||||
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
|
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
|
||||||
|
|
||||||
@ -51,7 +50,6 @@ var coinbase = web3.eth.coinbase;
|
|||||||
var balance = web3.eth.getBalance(coinbase);
|
var balance = web3.eth.getBalance(coinbase);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
For another example see `example/index.html`.
|
For another example see `example/index.html`.
|
||||||
|
|
||||||
|
|
||||||
@ -82,26 +80,6 @@ npm run-script build
|
|||||||
npm test
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing (karma)
|
|
||||||
Karma allows testing within one or several browsers.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run-script karma # default browsers are Chrome and Firefox
|
|
||||||
npm run-script karma -- --browsers="Chrome,Safari" # custom browsers
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
**Please note this repo is in it's early stage.**
|
|
||||||
|
|
||||||
If you'd like to run a Http ethereum node check out
|
|
||||||
[cpp-ethereum](https://github.com/ethereum/cpp-ethereum).
|
|
||||||
|
|
||||||
Install ethereum and spawn a node:
|
|
||||||
|
|
||||||
```
|
|
||||||
eth -j
|
|
||||||
```
|
|
||||||
|
|
||||||
[npm-image]: https://badge.fury.io/js/web3.png
|
[npm-image]: https://badge.fury.io/js/web3.png
|
||||||
[npm-url]: https://npmjs.org/package/web3
|
[npm-url]: https://npmjs.org/package/web3
|
||||||
[travis-image]: https://travis-ci.org/ethereum/web3.js.svg
|
[travis-image]: https://travis-ci.org/ethereum/web3.js.svg
|
||||||
|
Loading…
x
Reference in New Issue
Block a user