Framework for serverless Decentralized Applications using Ethereum, IPFS and other platforms https://framework.embarklabs.io/
Go to file
emizzle 9a9eb45836 feat(@embark/core): Run all code in VM2
All code to be run in the console is run through a completely sandboxed VM2 instance, instead of the default Node VM.

VM2 will only allow whitelisted packages in a `require` statement. The whitelisted packages needed to run EmbarkJS scripts are:
```
[
  "@babel/runtime-corejs2/helpers/interopRequireDefault",
  "@babel/runtime-corejs2/core-js/json/stringify",
  "@babel/runtime-corejs2/core-js/promise",
  "@babel/runtime-corejs2/core-js/object/assign",
  "eth-ens-namehash"
]
```

This can be circumvented in an Embark context (ie Plugin) if needed, for example in a Plugin constructor:
```
Embark.events.emit('runcode:register', 'require', require('lodash'), false);

Embark.events.request("runcode:eval", "_.head(['a', 'b', 'c', 'd']);", (err, result) => {
  if(err) return console.log('========> error: ' + err);
  console.log('========> ' + result);
});
```
Will emit `========> a`.

NOTE: Attempts to use this method to override `require` and `eval` should be handled by Embark and not allowed.

NOTE: VM2 seems to allow `eval`, however it is in a completely sandboxed environment, so I'm unsure that we need to be too concerned with this. Thoughts?

Refactor tests to use standalone instance of the newly created VM class, so that code is not evaluated through the console. This was done based on the new unit test case where accounts are redefined in a subsequent unit test, which was not originally working with the initial VM2 PR.

Refactor `codeRunner`, put all code-affecting logic in the `VM` class.

Changed `runCode` to `VM` and converted to TypeScript

Add unit tests for `VM`.
2019-01-16 10:16:54 +11:00
.github chore: introduce issue and pull request templates 2018-11-07 17:31:17 +01:00
bin build(packaging): reorg sources for transpilation with Babel 2018-11-11 15:08:55 -06:00
embark-ui fix: allow to debug instanceOf contracts 2019-01-14 10:33:08 +01:00
locales Add Slovenian translation 2018-11-21 15:53:37 -05:00
scripts build: introduce a `prepare` script in embark's package.json 2018-12-03 16:24:10 -06:00
src feat(@embark/core): Run all code in VM2 2019-01-16 10:16:54 +11:00
templates change to use an object instead and change templates 2019-01-14 08:29:21 -05:00
test_apps change to use an object instead and change templates 2019-01-14 08:29:21 -05:00
.editorconfig Add editor config 2018-10-22 19:25:16 +02:00
.eslintrc.json refactor(@embark/console): convert suggestions class into typescript 2018-11-15 13:51:05 -05:00
.gitignore test(@embark/cli): remove the cli_shim demo scripts 2018-12-19 10:48:41 -06:00
.npmignore build: introduce a `prepare` script in embark's package.json 2018-12-03 16:24:10 -06:00
.npmrc build: introduce a `prepare` script in embark's package.json 2018-12-03 16:24:10 -06:00
.travis.yml build: introduce a `prepare` script in embark's package.json 2018-12-03 16:24:10 -06:00
.yarnrc build: introduce a `prepare` script in embark's package.json 2018-12-03 16:24:10 -06:00
CHANGELOG.md chore(release): 4.0.0-beta.0 2019-01-10 13:07:10 -05:00
CODE_OF_CONDUCT.md chore(@embark) remove extra line 2018-12-24 16:14:01 -05:00
CONTRIBUTING.md docs: align with angular/conventional commit config 2018-11-15 12:12:43 +01:00
LICENSE add license 2015-07-10 20:41:45 -04:00
README.md update badges to use master instead of develop 2018-11-09 04:18:55 -05:00
appveyor.yml build: introduce a `prepare` script in embark's package.json 2018-12-03 16:24:10 -06:00
babel.config.js build(packaging): reorg sources for transpilation with Babel 2018-11-11 15:08:55 -06:00
header.png Update header 2018-09-27 10:23:03 -04:00
package.json feat(@embark/core): Run all code in VM2 2019-01-16 10:16:54 +11:00
tsconfig.json feat(scaffold): allow association/file 2018-12-03 09:38:22 +00:00
tslint.json feat(@embark/core): improve long running webpack UI 2018-12-07 10:10:11 -05:00
yarn.lock feat(@embark/core): Run all code in VM2 2019-01-16 10:16:54 +11:00

README.md

Embark

npm Gitter Build Status Build status Open PRs Closed PRs GitHub commit activity the past week, 4 weeks, year

What is Embark

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

A Decentralized Application is a serverless html5 application that uses one or more decentralized technologies.

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

With Embark you can:

Blockchain (Ethereum)

  • 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.
  • Contracts are available in JS with Promises.
  • Do Test Driven Development with Contracts using Javascript.
  • Keep track of deployed contracts; deploy only when truly needed.
  • Manage different chains (e.g testnet, private net, livenet)
  • Easily manage complex systems of interdependent contracts.

Decentralized Storage (IPFS, Swarm)

  • Easily Store & Retrieve Data on the DApp through EmbarkJS. Including uploading and retrieving files.
  • Deploy the full application to IPFS or Swarm.
  • Import and deploy contracts hosted on Swarm.

Decentralized Communication (Whisper, Orbit)

  • Easily send/receive messages through channels in P2P through Whisper or Orbit.

Web Technologies

  • Integrate with any web technology including React, Foundation, etc..
  • Use any build pipeline or tool you wish, including grunt, gulp and webpack.
$ npm -g install embark

See Complete Documentation.