Skip to content

Commit f19de43

Browse files
committed
update readme
1 parent 33ec36d commit f19de43

File tree

2 files changed

+53
-22
lines changed

2 files changed

+53
-22
lines changed

README.md

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Table of Contents
5757

5858
Installation
5959
======
60-
Requirements: geth (1.6.5 or higher recommended, 1.6.0 or lower for whisper v1 support; whisper v5 support coming soon), node (6.9.1 or higher is recommended) and npm
61-
Optional: testrpc (3.0 or higher) if using the simulator or the test functionality.
60+
Requirements: geth (1.6.7 or higher recommended), node (6.9.1 or higher is recommended) and npm
61+
Optional: testrpc (3.0 or higher) if using the simulator
6262
Further: depending on the dapp stack you choose: [IPFS](https://ipfs.io/)
6363

6464
```Bash
@@ -174,18 +174,18 @@ Embark will automatically take care of deployment for you and set all needed JS
174174

175175
```Javascript
176176
# app/contracts/simple_storage.sol
177-
pragma solidity ^0.4.7;
177+
pragma solidity ^0.4.17;
178178
contract SimpleStorage {
179179
uint public storedData;
180180

181-
function SimpleStorage(uint initialValue) {
181+
function SimpleStorage(uint initialValue) public {
182182
storedData = initialValue;
183183
}
184184

185-
function set(uint x) {
185+
function set(uint x) public {
186186
storedData = x;
187187
}
188-
function get() constant returns (uint retVal) {
188+
function get() view returns (uint retVal) {
189189
return storedData;
190190
}
191191
}
@@ -194,9 +194,9 @@ Will automatically be available in Javascript as:
194194

195195
```Javascript
196196
# app/js/index.js
197-
SimpleStorage.set(100);
198-
SimpleStorage.get().then(function(value) { console.log(value.toNumber()) });
199-
SimpleStorage.storedData().then(function(value) { console.log(value.toNumber()) });
197+
SimpleStorage.methods.set(100).send({from: web3.eth.defaultAccount});
198+
SimpleStorage.methods.get().call().then(function(value) { console.log(value.toNumber()) });
199+
SimpleStorage.methods.storedData().then(function(value) { console.log(value.toNumber()) });
200200
```
201201

202202
You can specify for each contract and environment its gas costs and arguments:
@@ -303,24 +303,61 @@ Contracts addresses can be defined. If an address is defined, Embark uses the de
303303
}
304304
```
305305

306+
You can Also specify which versions of solc and web3.js to use:
307+
308+
```Json
309+
# config/contracts.json
310+
{
311+
...
312+
"development": {
313+
"versions": {
314+
"web3.js": "1.0.0-beta",
315+
"solc": "0.4.17"
316+
}
317+
}
318+
...
319+
}
320+
```
321+
322+
You specify which node the contracts should be deploy to and the order of nodes
323+
the dapp should connect to. $WEB3 means the dapp will try to use an existing
324+
web3 object first if available.
325+
326+
```Json
327+
# config/contracts.json
328+
{
329+
...
330+
"development": {
331+
"deployment": {
332+
"host": "localhost",
333+
"port": 8545,
334+
"type": "rpc"
335+
},
336+
"dappConnection": [
337+
"$WEB3",
338+
"http://localhost:8545"
339+
]
340+
}
341+
...
342+
}
343+
```
344+
306345
EmbarkJS
307346
======
308347

309348
EmbarkJS is a javascript library meant to abstract and facilitate the development of DApps.
310349

311350
**promises**
312351

313-
methods in EmbarkJS contracts will be converted to promises.
314-
315352
```Javascript
316353
var myContract = new EmbarkJS.Contract({abi: abiObject, address: "0x123"});
317-
myContract.get().then(function(value) { console.log("value is " + value.toNumber) });
354+
myContract.methods.get().call().then(function(value) { console.log("value is " + value.toNumber) });
318355
```
319356

320357
events:
321358

322359
```Javascript
323-
myContract.eventName({from: web3.eth.accounts}, 'latest').then(function(event) { console.log(event) });
360+
myContract.events.eventName({from: web3.eth.accounts}, 'latest').then(function(event) { console.log(event) });
324361
```
325362

326363
**deployment**
@@ -391,7 +428,7 @@ EmbarkJS - Communication
391428

392429
**initialization**
393430

394-
For Whisper (note: currently requires geth 1.6.0):
431+
For Whisper (note: currently requires geth 1.6.0 or higher):
395432

396433
```Javascript
397434
EmbarkJS.Messages.setProvider('whisper')
@@ -438,12 +475,6 @@ Embark includes a testing lib to rapidly run & test your contracts in a EVM.
438475

439476
```Javascript
440477
# test/simple_storage_spec.js
441-
442-
var assert = require('assert');
443-
var Embark = require('embark');
444-
var EmbarkSpec = Embark.initTests();
445-
var web3 = EmbarkSpec.web3;
446-
447478
describe("SimpleStorage", function() {
448479
before(function(done) {
449480
this.timeout(0);

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
# built documents.
5959
#
6060
# The short X.Y version.
61-
version = u'2.6'
61+
version = u'2.5'
6262
# The full version, including alpha/beta/rc tags.
63-
release = u'2.6.0'
63+
release = u'2.5.2'
6464

6565
# The language for content autogenerated by Sphinx. Refer to documentation
6666
# for a list of supported languages.

0 commit comments

Comments
 (0)