update readme

This commit is contained in:
Iuri Matias 2015-10-12 18:33:00 -04:00
parent a9fbce7f5b
commit ea3f3ee3b0
1 changed files with 36 additions and 27 deletions

View File

@ -1,3 +1,5 @@
This Readme applies to Embark 1.0.0 Beta which is currently under development. For the old version please check the old [readme](https://github.com/iurimatias/embark-framework/blob/0.9.3/README.md)
What is embark What is embark
====== ======
@ -11,18 +13,18 @@ With Embark you can:
* Do Test Driven Development with Contracts using Javascript. * Do Test Driven Development with Contracts using Javascript.
* Easily deploy to & use decentralized systems such as IPFS. * Easily deploy to & use decentralized systems such as IPFS.
* Keep track of deployed contracts, deploy only when truly needed. * Keep track of deployed contracts, deploy only when truly needed.
* Manage different chains (e.g testnet, private net, livenet)
* Quickly create advanced DApps using multiple contracts. * Quickly create advanced DApps using multiple contracts.
See the [Wiki](https://github.com/iurimatias/embark-framework/wiki) for more details. See the [Wiki](https://github.com/iurimatias/embark-framework/wiki) for more details.
Installation Installation
====== ======
Requirements: geth (1.0.0), solc (0.1.0) or serpent (develop), node (0.12.2) and npm Requirements: geth (1.0.0), node (0.12.2) and npm
Optional: serpent (develop) if using contracts with Serpent
For specs: pyethereum, ethertdd.py
```Bash ```Bash
$ npm install -g embark-framework grunt-cli $ npm install -g embark-framework
``` ```
See [Complete Installation Instructions](https://github.com/iurimatias/embark-framework/wiki/Installation). See [Complete Installation Instructions](https://github.com/iurimatias/embark-framework/wiki/Installation).
@ -35,11 +37,19 @@ You can easily create a sample working DApp with the following:
$ embark demo $ embark demo
$ cd embark_demo $ cd embark_demo
``` ```
To run the ethereum node for development purposes simply run:
To run a ethereum rpc simulator simply run:
```Bash
$ embark simulator
```
Or Alternatively, you can run a REAL ethereum node for development purposes:
```Bash ```Bash
$ embark blockchain $ embark blockchain
``` ```
By default embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in. This is quite usefull to keep a low CPU. The option can be configured at config/blockchain.yml By default embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in. This is quite usefull to keep a low CPU. The option can be configured at config/blockchain.yml
Then, in another command line: Then, in another command line:
@ -199,42 +209,41 @@ You can also define contract interfaces (Stubs) and actions to do on deployment
Tests Tests
====== ======
You can run specs with ```embark spec```, it will run any files ending *_spec.js under ```spec/```. You can run specs with ```embark spec```, it will run any test files under ```test/```.
Embark includes a testing lib to fastly run & test your contracts in a EVM. Embark includes a testing lib to fastly run & test your contracts in a EVM.
```Javascript ```Javascript
# spec/contracts/simple_storage_spec.js # test/simple_storage_spec.js
Embark = require('embark-framework'); var assert = require('assert');
Embark.init(); var Embark = require('embark-framework');
Embark.blockchainConfig.loadConfigFile('config/blockchain.yml'); var EmbarkSpec = Embark.initTests();
Embark.contractsConfig.loadConfigFile('config/contracts.yml');
var files = ['app/contracts/simpleStorage.sol']; describe("SimpleStorage", function(done) {
Embark.contractsConfig.init(files, 'development'); before(function(done) {
EmbarkSpec.deployAll(done);
var EmbarkSpec = Embark.tests(files);
describe("SimpleStorage", function() {
beforeAll(function() {
// equivalent to initializing SimpleStorage with param 150
SimpleStorage = EmbarkSpec.request("SimpleStorage", [150]);
}); });
it("should set constructor value", function() { it("should set constructor value", function(done) {
expect(SimpleStorage.storedData()).toEqual('150'); SimpleStorage.storedData(function(err, result) {
assert.equal(result.toNumber(), 100);
done();
});
}); });
it("set storage value", function() { it("set storage value", function(done) {
SimpleStorage.set(100); SimpleStorage.set(150, function() {
expect(SimpleStorage.get()).toEqual('100'); SimpleStorage.get(function(err, result) {
assert.equal(result.toNumber(), 150);
done();
});
});
}); });
}) })
``` ```
Embark uses [Jasmine](https://jasmine.github.io/2.3/introduction.html) by default, but you can use any testing framework you want. Embark uses [Mocha](http://mochajs.org/) by default, but you can use any testing framework you want.
Working with different chains Working with different chains
====== ======