mirror of https://github.com/embarklabs/embark.git
Updated API Documentation (markdown)
parent
481bc641ea
commit
03a4bb686c
|
@ -12,8 +12,8 @@
|
|||
**Stack**
|
||||
* api
|
||||
* authenticator
|
||||
* blockchain-client
|
||||
* blockchain
|
||||
* [blockchain-client](#blockchain-client)
|
||||
* [blockchain](#blockchain)
|
||||
* communication
|
||||
* compiler
|
||||
* contracts-manager
|
||||
|
@ -69,7 +69,7 @@
|
|||
* embarkjs-whisper
|
||||
|
||||
**Cockpit**
|
||||
* api-client
|
||||
* [api-client](#api-client)
|
||||
* ui
|
||||
|
||||
---------
|
||||
|
@ -112,3 +112,139 @@ name: `blockchain:proxy:response`
|
|||
params: {respData: <Object>, reqData: <Object>}
|
||||
description: actions run when a response is returned from the blockchain node. In case the plugin hangs (5 seconds), the action continues.
|
||||
|
||||
### api-client
|
||||
|
||||
### Requests
|
||||
|
||||
**name**: `compiler:url`
|
||||
**description**: Returns API URL.
|
||||
**params**:
|
||||
* callback - `(url) => {}` - a callback function with access to the API url
|
||||
|
||||
---
|
||||
**name**: `logs:api:enable`
|
||||
**description**: Enables api server log output
|
||||
**params**: -
|
||||
|
||||
---
|
||||
**name**: `logs:api:disable`
|
||||
**description**: Disables api server log output
|
||||
**params**:
|
||||
|
||||
### blockchain
|
||||
|
||||
module type: stack component
|
||||
|
||||
#### API
|
||||
|
||||
##### requests
|
||||
|
||||
name: `blockchain:node:register`
|
||||
arguments:
|
||||
* clientName {string} - name of the client (e.g 'geth')
|
||||
* startCb {function} - function that starts the node
|
||||
|
||||
registers a client and the function that starts it
|
||||
|
||||
name: `blockchain:node:start`
|
||||
arguments:
|
||||
* blockchainConfig {object} - blockchain config (taken from dapp config/blockchain.js)
|
||||
* doneCb {function} - function that is fired once the blockchain node has started
|
||||
|
||||
starts a blockchain name according to the config given. will start one of the nodes previously registered with `blockchain:node:register`
|
||||
|
||||
**actions used**
|
||||
|
||||
* `pipeline:generateAll:before` - to generate blockchain.json config artifact
|
||||
|
||||
**events emited*
|
||||
|
||||
* `blockchain:started` - emitted when blockchain node starts
|
||||
|
||||
### blockchain-client
|
||||
|
||||
module type: stack component
|
||||
|
||||
name: `blockchain:client:register` (not being used should be removed)
|
||||
|
||||
name: `blockchain:client:provider`
|
||||
arguments:
|
||||
* clientName {string} - name of blockchain technology (e.g "ethereum")
|
||||
* cb {function(err, provider)} - callback that returns the blockchain provider
|
||||
|
||||
Returns a provider object that allows libraries to connect to the embark's blockchain node
|
||||
|
||||
### communication
|
||||
|
||||
module type: stack component
|
||||
|
||||
#### API
|
||||
|
||||
##### requests
|
||||
|
||||
name: `communication:node:register`
|
||||
arguments:
|
||||
* clientName {string} - name of the client (e.g 'ipfs')
|
||||
* startCb {function} - function that starts the node
|
||||
|
||||
registers a node and the function that starts it
|
||||
|
||||
name: `communication:node:start`
|
||||
arguments:
|
||||
* communicationConfig {object} - communication config (taken from dapp config/communication.js)
|
||||
* doneCb {function} - function that is fired once the blockchain node has started
|
||||
|
||||
starts a communication node according to the config given. will start one of the nodes previously registered with `communication:node:register`
|
||||
|
||||
**actions used**
|
||||
|
||||
* `pipeline:generateAll:before` - to generate communication.json config artifact
|
||||
|
||||
**events emited*
|
||||
|
||||
* `communication:started` - emitted when communication node starts
|
||||
|
||||
### whisper
|
||||
|
||||
module type: plugin
|
||||
|
||||
#### Description
|
||||
|
||||
* whitelists embarkjs & embarkjs-whisper packages in the vm
|
||||
* generates whisper artifacts
|
||||
* makes whisper work in the console
|
||||
* registers api endpoints
|
||||
|
||||
**actions used**
|
||||
|
||||
* `pipeline:generateAll:after` - to register whisper artifact
|
||||
|
||||
**events used**
|
||||
|
||||
* `blockchain:started` - to connect embarkjs whisper to node in the console
|
||||
|
||||
### compiler
|
||||
|
||||
module type: ???
|
||||
|
||||
## API
|
||||
|
||||
### Requests
|
||||
|
||||
**name**: `compiler:contracts:compile`
|
||||
**description**: Compiles Smart Contracts given a list of Smart Contract files and returns the compilation data.
|
||||
**params**:
|
||||
* `{ contractsFiles: any[], cb: function }`module type: ???
|
||||
|
||||
## API
|
||||
|
||||
### Requests
|
||||
|
||||
**name**: `compiler:contracts:compile`
|
||||
**description**: Compiles Smart Contracts given a list of Smart Contract files and returns the compilation data.
|
||||
**params**:
|
||||
* `{ contractsFiles: any[], cb: function }`
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue