mirror of https://github.com/embarklabs/embark.git
Framework for serverless Decentralized Applications using Ethereum, IPFS and other platforms
https://framework.embarklabs.io/
947ea23c35
This commit refactors the `rpc-manager` to be a stack component and therefore making it available to a variaty of plugins that might need access to its APIs so they can register new RPC interceptors. RpcModifiers have been renamed to `rpc-interceptors` and extracted from the `rpc-manager` source into their own plugin. The reason for the renaming was that modifiers aren't always modifying RPC APIs, but potentially introduce brand new ones. There are a bunch of new APIs that can be used to register new RPC APIs: ``` events.request('rpc:request:interceptor:register', 'method_name', requestInterceptorFn); events.request('rpc:response:interceptor:register', 'method_name', responseInterceptorFn); function requestInterceptorFn(params: ProxyRequestParams<T>) { // mutate `params` here return params; } function responseInterceptorFn(params: ProxyResponseParams<T, S>) { // mutate `params` here return params; } ``` A few things to note here: - `method_name` is either `string`, `string[]`, or `Regex`. This make registering custom RPC APIs extremely flexible. - A `requestInterceptorFn()` gets access to `ProxyRequestParams<T>` where `T` is the type of the params being send to the RPC API. - A `responseInterceptorFn()` gets access to `ProxyResponseParams<T, S>` where `T` is the type of the original request parameters and `S` the type of the response coming from the RPC API. These APIs are used by all `rpc-interceptors` and can be used the same way by any oother plugin that aims to create new or intercept existing APIs. |
||
---|---|---|
.github | ||
dapps | ||
packages | ||
scripts | ||
site | ||
.editorconfig | ||
.eslintrc.json | ||
.gitattributes | ||
.gitignore | ||
.npmrc | ||
.yarnrc | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
azure-pipelines.yml | ||
babel.config.js | ||
header.jpg | ||
lerna.json | ||
package.json | ||
tsconfig.base.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