Skip to content

Commit 1010606

Browse files
committed
Merge branch 'develop'
2 parents cfc75c3 + b32cef9 commit 1010606

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6660
-5724
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ test_app/.embark/development/
1212
test_app/config/production/password
1313
test_app/node_modules/
1414
test_app/chains.json
15+
.idea

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: node_js
22
node_js:
3+
- "7"
34
- "6"
4-
- "5"
5-
- "4"
65
addons:
76
code_climate:
87
repo_token: 7454b1a666015e244c384d19f48c34e35d1ae58c3aa428ec542f10bbcb848358

CONTRIBUTING.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11+
build.
12+
2. Update the README.md with details of changes to the interface, this includes new environment
13+
variables, exposed ports, useful file locations and container parameters.
14+
3. Increase the version numbers in any examples files and the README.md to the new version that this
15+
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16+
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17+
do not have permission to do that, you may request the second reviewer to merge it for you.
18+
19+
## Code of Conduct
20+
21+
### Our Pledge
22+
23+
In the interest of fostering an open and welcoming environment, we as
24+
contributors and maintainers pledge to making participation in our project and
25+
our community a harassment-free experience for everyone, regardless of age, body
26+
size, disability, ethnicity, gender identity and expression, level of experience,
27+
nationality, personal appearance, race, religion, or sexual identity and
28+
orientation.
29+
30+
### Our Standards
31+
32+
Examples of behavior that contributes to creating a positive environment
33+
include:
34+
35+
* Using welcoming and inclusive language
36+
* Being respectful of differing viewpoints and experiences
37+
* Gracefully accepting constructive criticism
38+
* Focusing on what is best for the community
39+
* Showing empathy towards other community members
40+
41+
Examples of unacceptable behavior by participants include:
42+
43+
* The use of sexualized language or imagery and unwelcome sexual attention or
44+
advances
45+
* Trolling, insulting/derogatory comments, and personal or political attacks
46+
* Public or private harassment
47+
* Publishing others' private information, such as a physical or electronic
48+
address, without explicit permission
49+
* Other conduct which could reasonably be considered inappropriate in a
50+
professional setting
51+
52+
### Our Responsibilities
53+
54+
Project maintainers are responsible for clarifying the standards of acceptable
55+
behavior and are expected to take appropriate and fair corrective action in
56+
response to any instances of unacceptable behavior.
57+
58+
Project maintainers have the right and responsibility to remove, edit, or
59+
reject comments, commits, code, wiki edits, issues, and other contributions
60+
that are not aligned to this Code of Conduct, or to ban temporarily or
61+
permanently any contributor for other behaviors that they deem inappropriate,
62+
threatening, offensive, or harmful.
63+
64+
### Scope
65+
66+
This Code of Conduct applies both within project spaces and in public spaces
67+
when an individual is representing the project or its community. Examples of
68+
representing a project or community include using an official project e-mail
69+
address, posting via an official social media account, or acting as an appointed
70+
representative at an online or offline event. Representation of a project may be
71+
further defined and clarified by project maintainers.
72+
73+
### Enforcement
74+
75+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
76+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
77+
complaints will be reviewed and investigated and will result in a response that
78+
is deemed necessary and appropriate to the circumstances. The project team is
79+
obligated to maintain confidentiality with regard to the reporter of an incident.
80+
Further details of specific enforcement policies may be posted separately.
81+
82+
Project maintainers who do not follow or enforce the Code of Conduct in good
83+
faith may face temporary or permanent repercussions as determined by other
84+
members of the project's leadership.
85+
86+
### Attribution
87+
88+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89+
available at [http://contributor-covenant.org/version/1/4][version]
90+
91+
[homepage]: http://contributor-covenant.org
92+
[version]: http://contributor-covenant.org/version/1/4/

Class Hierarchy.mmd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Mind Map generated by NB MindMap plugin
2+
> __version__=`1.1`,showJumps=`true`
3+
---
4+
5+
# Embark
6+
7+
## Config
8+
9+
## CLI
10+
11+
## Engine
12+
> leftSide=`true`
13+
14+
15+
### Plugins
16+
17+
#### DefaultLogger
18+
19+
#### DefaultPipeline
20+
21+
### Services
22+
23+
## DefaultLogger
24+
25+
## Utils
26+
> leftSide=`true`
27+
28+
29+
## DeployManager

Gruntfile.coffee

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ module.exports = (grunt) ->
2121
mochaTest:
2222
test:
2323
src: ['test/**/*.js']
24+
2425
jshint:
25-
all: ['bin/embark', 'lib/**/*.js', 'js/mine.js', 'js/embark.js']
26+
all: ['bin/embark', 'lib/**/*.js']
27+
options: grunt.file.readJSON('package.json').jshintConfig
28+
with_overrides:
29+
options:
30+
undef: false
31+
esversion: 5
32+
files:
33+
src: ['js/mine.js', 'js/embark.js']
2634

2735
grunt.loadTasks "tasks"
2836
require('matchdep').filterAll(['grunt-*','!grunt-cli']).forEach(grunt.loadNpmTasks)

README.md

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[![Join the chat at https://gitter.im/iurimatias/embark-framework](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iurimatias/embark-framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1+
[![npm](https://img.shields.io/npm/dm/embark.svg)]()
2+
[![Gitter](https://img.shields.io/gitter/room/iurimatias/embark-framework.svg)]()
23
[![Build
34
Status](https://travis-ci.org/iurimatias/embark-framework.svg?branch=develop)](https://travis-ci.org/iurimatias/embark-framework)
45
[![Code Climate](https://codeclimate.com/github/iurimatias/embark-framework/badges/gpa.svg)](https://codeclimate.com/github/iurimatias/embark-framework)
@@ -8,22 +9,22 @@ What is Embark
89

910
Embark is a framework that allows you to easily develop and deploy Decentralized Applications (DApps).
1011

11-
A Decentralized Application is serverless html5 application that uses one or more decentralized technologies.
12+
A Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.
1213

13-
Embark currently integrates with EVM blockchains (Ethereum), Decentralized Storages (IPFS), and Decentralizaed communication platforms (Whisper and Orbit). Swarm is supported for deployment.
14+
Embark currently integrates with EVM blockchains (Ethereum), Decentralized Storages (IPFS), and Decentralized communication platforms (Whisper and Orbit). Swarm is supported for deployment.
1415

1516
With Embark you can:
1617

1718
**Blockchain (Ethereum)**
1819
* Automatically deploy contracts and make them available in your JS code. Embark watches for changes, and if you update a contract, Embark will automatically redeploy the contracts (if needed) and the dapp.
1920
* Contracts are available in JS with Promises.
2021
* Do Test Driven Development with Contracts using Javascript.
21-
* Keep track of deployed contracts, deploy only when truly needed.
22+
* Keep track of deployed contracts; deploy only when truly needed.
2223
* Manage different chains (e.g testnet, private net, livenet)
2324
* Easily manage complex systems of interdependent contracts.
2425

2526
**Decentralized Storage (IPFS)**
26-
* Easily Store & Retrieve Data on the DApp through EmbarkJS. Includin uploading and retrieving files.
27+
* Easily Store & Retrieve Data on the DApp through EmbarkJS. Including uploading and retrieving files.
2728
* Deploy the full application to IPFS or Swarm.
2829

2930

@@ -41,20 +42,20 @@ Table of Contents
4142
* [Dashboard](#dashboard)
4243
* [Creating a new DApp](#creating-a-new-dapp)
4344
* [Libraries and APIs available](#libraries-and-languages-available)
44-
* [Using and Configuring Contracts](#dapp-structure)
45+
* [Using and Configuring Contracts](#using-contracts)
4546
* [EmbarkJS](#embarkjs)
4647
* [EmbarkJS - Storage (IPFS)](#embarkjs---storage)
4748
* [EmbarkJS - Communication (Whisper/Orbit)](#embarkjs---communication)
4849
* [Testing Contracts](#tests)
4950
* [Working with different chains](#working-with-different-chains)
5051
* [Custom Application Structure](#structuring-application)
51-
* [Deploying to IPFS](#deploying-to-ipfs)
52+
* [Deploying to IPFS](#deploying-to-ipfs-and-swarm)
5253
* [Extending Functionality with Plugins](#plugins)
5354
* [Donations](#donations)
5455

5556
Installation
5657
======
57-
Requirements: geth (1.5.8 or higher), node (6.9.1 or higher is recommended) and npm
58+
Requirements: geth (1.6.5 or higher), node (6.9.1 or higher is recommended) and npm
5859
Optional: testrpc (3.0 or higher) if using the simulator or the test functionality.
5960
Further: depending on the dapp stack you choose: [IPFS](https://ipfs.io/)
6061

@@ -68,7 +69,7 @@ $ npm -g install ethereumjs-testrpc
6869
See [Complete Installation Instructions](https://github.com/iurimatias/embark-framework/wiki/Installation).
6970

7071

71-
**updating from embark 1**
72+
**updating from Embark 1**
7273

7374
Embark's npm package has changed from ```embark-framework``` to ```embark```, this sometimes can create conflicts. To update first uninstall embark-framework 1 to avoid any conflicts. ```npm uninstall -g embark-framework``` then ```npm install -g embark```
7475

@@ -96,7 +97,7 @@ Alternatively, to use an ethereum rpc simulator simply run:
9697
$ embark simulator
9798
```
9899

99-
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.json```. Note that running a real node requires at least 2GB of free ram, please take this into account if running it in a VM.
100+
By default Embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in. This is quite useful to keep a low CPU. The option can be configured at ```config/blockchain.json```. Note that running a real node requires at least 2GB of free ram, please take this into account if running it in a VM.
100101

101102
Then, in another command line:
102103

@@ -105,7 +106,7 @@ $ embark run
105106
```
106107
This will automatically deploy the contracts, update their JS bindings and deploy your DApp to a local server at http://localhost:8000
107108

108-
Note that if you update your code it will automatically be re-deployed, contracts included. There is no need to restart embark, refreshing the page on the browser will do.
109+
Note that if you update your code, it will automatically be re-deployed, contracts included. There is no need to restart embark, refreshing the page on the browser will do.
109110

110111
Dashboard
111112
=====
@@ -114,20 +115,20 @@ Embark 2 comes with a terminal dashboard.
114115

115116
![Dashboard](http://i.imgur.com/s4OQZpu.jpg)
116117

117-
The dashboard will tell you the state of your contracts, the enviroment you are using, and what embark is doing at the moment.
118+
The dashboard will tell you the state of your contracts, the environment you are using, and what Embark is doing at the moment.
118119

119120
**available services**
120121

121-
Available Services will display the services available to your dapp in green, if one of these is down then it will be displayed in red.
122+
Available Services will display the services available to your dapp in green. If a service is down, then it will be displayed in red.
122123

123124
**logs and console**
124125

125-
There is a console at the bottom which can be used to interact with contracts or with embark itself. type ```help``` to see a list of available commands, more commands will be added with each version of Embark.
126+
There is a console at the bottom which can be used to interact with contracts or with Embark itself. Type ```help``` to see a list of available commands. More commands will be added with each version of Embark.
126127

127128
Creating a new DApp
128129
======
129130

130-
If you want to create a blank new app.
131+
If you want to create a blank new app:
131132

132133
```Bash
133134
$ embark new AppName
@@ -144,13 +145,16 @@ DApp Structure
144145
|___ css/
145146
|___ js/
146147
config/
147-
|___ blockchain.json #environments configuration
148-
|___ contracts.json #contracts configuration
148+
|___ blockchain.json #rpc and blockchain configuration
149+
|___ contracts.json #ethereum contracts configuration
150+
|___ storage.json #ipfs configuration
151+
|___ communication.json #whisper/orbit configuration
152+
|___ webserver.json #dev webserver configuration
149153
test/
150154
|___ #contracts tests
151155
```
152156

153-
Solidity/Serpent files in the contracts directory will automatically be deployed with embark run. Changes in any files will automatically be reflected in app, changes to contracts will result in a redeployment and update of their JS Bindings
157+
Solidity/Serpent files in the contracts directory will automatically be deployed with Embark run. Changes in any files will automatically be reflected in app, changes to contracts will result in a redeployment and update of their JS Bindings
154158

155159
Libraries and languages available
156160
======
@@ -223,7 +227,7 @@ If you are using multiple contracts, you can pass a reference to another contrac
223227
"SimpleStorage": {
224228
"args": [
225229
100,
226-
$MyStorage
230+
"$MyStorage"
227231
]
228232
},
229233
"MyStorage": {
@@ -233,7 +237,7 @@ If you are using multiple contracts, you can pass a reference to another contrac
233237
},
234238
"MyMainContract": {
235239
"args": [
236-
$SimpleStorage
240+
"$SimpleStorage"
237241
]
238242
}
239243
}
@@ -274,7 +278,7 @@ You can now deploy many instances of the same contract. e.g
274278
...
275279
```
276280

277-
Contracts addresses can be defined, If an address is defined the contract wouldn't be deployed but its defined address will be used instead.
281+
Contracts addresses can be defined. If an address is defined, Embark uses the defined address instead of deploying the contract.
278282

279283

280284
```Json
@@ -322,22 +326,28 @@ events:
322326
Client side deployment will be automatically available in Embark for existing contracts:
323327

324328
```Javascript
325-
SimpleStorage.deploy().then(function(anotherSimpleStorage) {});
329+
SimpleStorage.deploy([args], {options}).then(function(anotherSimpleStorage) {});
326330
```
327331

328332
or it can be manually definied as
329333

330334
```Javascript
331335
var myContract = new EmbarkJS.Contract({abi: abiObject, code: code});
332-
myContract.deploy().then(function(anotherMyContractObject) {});
336+
myContract.deploy([args], {options}).then(function(anotherMyContractObject) {});
337+
```
338+
339+
so you can define your gas as
340+
341+
```Javascript
342+
myContract.deploy([100, "seconde argument"], {gas: 800000}).then(function(anotherMyContractObject) {});
333343
```
334344

335345
EmbarkJS - Storage
336346
======
337347

338348
**initialization**
339349

340-
The current available storage is IPFS. it can be initialized as
350+
The current available storage is IPFS. It can be initialized as
341351

342352
```Javascript
343353
EmbarkJS.Storage.setProvider('ipfs',{server: 'localhost', port: '5001'})
@@ -422,7 +432,7 @@ Tests
422432

423433
You can run specs with ```embark test```, it will run any test files under ```test/```.
424434

425-
Embark includes a testing lib to fastly run & test your contracts in a EVM.
435+
Embark includes a testing lib to rapidly run & test your contracts in a EVM.
426436

427437
```Javascript
428438
# test/simple_storage_spec.js
@@ -434,6 +444,7 @@ var web3 = EmbarkSpec.web3;
434444

435445
describe("SimpleStorage", function() {
436446
before(function(done) {
447+
this.timeout(0);
437448
var contractsConfig = {
438449
"SimpleStorage": {
439450
args: [100]
@@ -459,6 +470,7 @@ describe("SimpleStorage", function() {
459470
});
460471

461472
});
473+
462474
```
463475

464476
Embark uses [Mocha](http://mochajs.org/) by default, but you can use any testing framework you want.
@@ -521,20 +533,20 @@ To deploy a dapp to SWARM, all you need to do is run a local SWARM node and then
521533
Plugins
522534
======
523535

524-
It's possible to extend Embarks functionality with plugins. For example the following is possible:
536+
It's possible to extend Embark's functionality with plugins. For example, the following is possible:
525537

526538
* plugin to add support for es6, jsx, coffescript, etc (``embark.registerPipeline``)
527539
* plugin to add standard contracts or a contract framework (``embark.registerContractConfiguration`` and ``embark.addContractFile``)
528540
* plugin to make some contracts available in all environments for use by other contracts or the dapp itself e.g a Token, a DAO, ENS, etc.. (``embark.registerContractConfiguration`` and ``embark.addContractFile``)
529-
* plugin to add a libraries such as react or boostrap (``embark.addFileToPipeline``)
541+
* plugin to add a libraries such as react or bootstrap (``embark.addFileToPipeline``)
530542
* plugin to specify a particular web3 initialization for special provider uses (``embark.registerClientWeb3Provider``)
531543
* plugin to create a different contract wrapper (``embark.registerContractsGeneration``)
532544
* plugin to add new console commands (``embark.registerConsoleCommand``)
533545
* plugin to add support for another contract language such as viper, LLL, etc (``embark.registerCompiler``)
534546

535-
For more information on how to develop your own plugin please see the [plugin documentation](http://embark.readthedocs.io/en/latest/plugins.html)
547+
For more information on how to develop your own plugin, please see the [plugin documentation](http://embark.readthedocs.io/en/latest/plugins.html)
536548

537549
Donations
538550
======
539551

540-
If you like Embark please consider donating to 0x8811FdF0F988f0CD1B7E9DE252ABfA5b18c1cDb1
552+
If you like Embark, please consider donating to 0x8811FdF0F988f0CD1B7E9DE252ABfA5b18c1cDb1

0 commit comments

Comments
 (0)