diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 158 |
1 files changed, 95 insertions, 63 deletions
@@ -1,96 +1,128 @@ -# Ethereum JavaScript API +[](https://waffle.io/ethereum/go-ethereum) +[](https://waffle.io/ethereum/go-ethereum) +[](http://waffle.io/ethereum/go-ethereum) +[](https://gitter.im/ethereum/go-ethereum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -This is the Ethereum compatible [JavaScript API](https://github.com/ethereum/wiki/wiki/JavaScript-API) -which implements the [Generic JSON RPC](https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC) spec. It's available on npm as a node module and also for bower and component as an embeddable js -[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![dependency status][dep-image]][dep-url] [![dev dependency status][dep-dev-image]][dep-dev-url] +Ethereum PoC-8 +======== -<!-- [](https://ci.testling.com/ethereum/ethereum.js) --> +* [](http://build.ethdev.com:8010/builders/Linux%20Go%20master%20branch/builds/-1) master +* [](http://build.ethdev.com:8010/builders/Linux%20Go%20develop%20branch/builds/-1) develop +* [](https://travis-ci.org/ethereum/go-ethereum) travis-ci +* [](https://coveralls.io/r/ethereum/go-ethereum?branch=develop) -## Installation +Ethereum Go Client © 2014 Jeffrey Wilcke. -### Node.js +Build +===== - npm install ethereum.js +Mist (GUI): -### For browser -Bower +`go get github.com/ethereum/go-ethereum/cmd/mist` - bower install ethereum.js +Ethereum (CLI): -Component +`go get github.com/ethereum/go-ethereum/cmd/ethereum` - component install ethereum/ethereum.js +For further, detailed, build instruction please see the [Wiki](https://github.com/ethereum/go-ethereum/wiki/Building-Ethereum(Go)) -* Include `ethereum.min.js` in your html file. -* Include [bignumber.js](https://github.com/MikeMcl/bignumber.js/) +Automated (dev) builds +====================== -## Usage -Require the library: +* [[OS X](http://build.ethdev.com/builds/OSX%20Go%20develop%20branch/latest/app/)] +* [Windows] Coming soon™ +* [Linux] Coming soon™ - var web3 = require('web3'); +Binaries +======== -Set a provider (QtProvider, WebSocketProvider, HttpRpcProvider) +Go Ethereum comes with several binaries found in +[cmd](https://github.com/ethereum/go-ethereum/tree/master/cmd): - var web3.setProvider(new web3.providers.WebSocketProvider('ws://localhost:40404/eth')); +* `mist` Official Ethereum Browser +* `ethereum` Ethereum CLI +* `ethtest` test tool which runs with the [tests](https://github.com/ethereum/testes) suit: + `cat file | ethtest`. +* `evm` is a generic Ethereum Virtual Machine: `evm -code 60ff60ff -gas + 10000 -price 0 -dump`. See `-h` for a detailed description. +* `rlpdump` converts a rlp stream to `interface{}`. +* `peerserver` simple P2P (noi-ethereum) peer server. +* `disasm` disassembles EVM code: `echo "6001" | disasm` -There you go, now you can use it: +General command line options +============================ ``` -var coinbase = web3.eth.coinbase; -var balance = web3.eth.balanceAt(coinbase); +== Shared between ethereum and Mist == + += Settings +-id Set the custom identifier of the client (shows up on other clients) +-port Port on which the server will accept incomming connections +-upnp Enable UPnP +-maxpeer Desired amount of peers +-rpc Start JSON RPC +-dir Data directory used to store configs and databases + += Utility +-h This +-import Import a private key +-genaddr Generates a new address and private key (destructive action) +-dump Dump a specific state of a block to stdout given the -number or -hash +-difftool Supress all output and prints VM output to stdout +-diff vm=only vm output, all=all output including state storage + +Ethereum only +ethereum [options] [filename] +-js Start the JavaScript REPL +filename Load the given file and interpret as JavaScript +-m Start mining blocks + +== Mist only == + +-asset_path absolute path to GUI assets directory ``` +Contribution +============ -For another example see `example/index.html`. +If you'd like to contribute to Ethereum please fork, fix, commit and +send a pull request. Commits who do not comply with the coding standards +are ignored (use gofmt!). If you send pull requests make absolute sure that you +commit on the `develop` branch and that you do not merge to master. +Commits that are directly based on master are simply ignored. -## Contribute! +To make life easier try [git flow](http://nvie.com/posts/a-successful-git-branching-model/) it sets +this all up and streamlines your work flow. -### Requirements +Coding standards +================ -* Node.js -* npm -* gulp (build) -* mocha (tests) +Sources should be formatted according to the [Go Formatting +Style](http://golang.org/doc/effective_go.html#formatting). -```bash -sudo apt-get update -sudo apt-get install nodejs -sudo apt-get install npm -sudo apt-get install nodejs-legacy -``` - -### Building (gulp) - -```bash -npm run-script build -``` +Unless structs fields are supposed to be directly accesible, provide +Getters and hide the fields through Go's exporting facility. +When you comment put meaningful comments. Describe in detail what you +want to achieve. -### Testing (mocha) +*wrong* -```bash -npm test +```go +// Check if the value at x is greater than y +if x > y { + // It's greater! +} ``` -**Please note this repo is in it's early stage.** +Everyone reading the source probably know what you wanted to achieve +with above code. Those are **not** meaningful comments. -If you'd like to run a WebSocket ethereum node check out -[go-ethereum](https://github.com/ethereum/go-ethereum). - -To install ethereum and spawn a node: - -``` -go get github.com/ethereum/go-ethereum/ethereum -ethereum -ws -loglevel=4 -``` +While the project isn't 100% tested I want you to write tests non the +less. I haven't got time to evaluate everyone's code in detail so I +expect you to write tests for me so I don't have to test your code +manually. (If you want to contribute by just writing tests that's fine +too!) -[npm-image]: https://badge.fury.io/js/ethereum.js.png -[npm-url]: https://npmjs.org/package/ethereum.js -[travis-image]: https://travis-ci.org/ethereum/ethereum.js.svg -[travis-url]: https://travis-ci.org/ethereum/ethereum.js -[dep-image]: https://david-dm.org/ethereum/ethereum.js.svg -[dep-url]: https://david-dm.org/ethereum/ethereum.js -[dep-dev-image]: https://david-dm.org/ethereum/ethereum.js/dev-status.svg -[dep-dev-url]: https://david-dm.org/ethereum/ethereum.js#info=devDependencies |