mirror of https://github.com/embarklabs/embark.git
Framework for serverless Decentralized Applications using Ethereum, IPFS and other platforms
https://framework.embarklabs.io/
9a9eb45836
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`. |
||
---|---|---|
.github | ||
bin | ||
embark-ui | ||
locales | ||
scripts | ||
src | ||
templates | ||
test_apps | ||
.editorconfig | ||
.eslintrc.json | ||
.gitignore | ||
.npmignore | ||
.npmrc | ||
.travis.yml | ||
.yarnrc | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
appveyor.yml | ||
babel.config.js | ||
header.png | ||
package.json | ||
tsconfig.json | ||
tslint.json | ||
yarn.lock |
README.md
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