-
Notifications
You must be signed in to change notification settings - Fork 488
API Documentation
Core
- code-runner
- console
- core
- engine
- i18n
- logger
- reset
- utils
Stack
- api
- authenticator
- blockchain-client
- blockchain
- communication
- compiler
- contracts-manager
- deployment
- embarkjs
- library-manager
- namesystem
- pipeline
- process-logs-api-manager
- proxy
- storage
- test-runner
- watcher
- webserver
Plugins
- accounts-manager
- basic-pipeline
- coverage
- debugger
- deploy-tracker
- ens
- ethereum-blockchain-client
- ganache
- geth
- graph
- ipfs
- mocha-tests
- parity
- plugin-cmd
- profiler
- rpc-manager
- scaffolding
- snark
- solc
- solidity-tests
- solidity
- specialconfigs
- swarm
- transaction-logger
- transaction-tracker
- vyper
- web3
- whisper-geth
- whisper-parity
EmbarkJS
- embarkjs
- embarkjs-ens
- embarkjs-ipfs
- embarkjs-swarm
- embarkjs-web3
- embarkjs-whisper
Cockpit
- api-client
- ui
module type: plugin
- generates wallet from accounts configuration
- fund accounts according to the accounts configuration
- signs transactions for accounts present in its wallet
- if it's a node account it just ignores it (since it will be processed at the node)
- overrides eth_getAccounts to return the correct list of accounts
actions used
-
blockchain:proxy:request
- to sign the transactions -
blockchain:proxy:response
- to modify accounts list
module type: stack
name: proxy:endpoint
arguments: no arguments
returns the endpoint (string)
name: blockchain:proxy:request
params: {reqData: }
description: actions run when a request is made to the blockchain node. In case the plugin hangs (5 seconds), the action continues.
name: blockchain:proxy:response
params: {respData: , reqData: }
description: actions run when a response is returned from the blockchain node. In case the plugin hangs (5 seconds), the action continues.
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:
module type: stack component
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
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
module type: core component
name: runcode:register
arguments:
-
varName
{string} - name of the variable to be registered in the VM -
code
{any} - primitive or object value that will be assign tovarName
inside the VM
Registers a variable and assigns a value to it inside the VM context.
name: 'runcode:whitelist' arguments:
-
varName
{string} - name of white node module to be whitelisted for imports inside the VM
Whitelists a node module inside the VM context for imports. Generally, the VM context is sandboxed, making it impossible to require/import any arbitrary module. This API enables whitelisting of such modules.
name : runcode:getContext
Returns the current VM context with its sandbox object and options.
name: runcode:eval
arguments:
-
code
{string} - code to be eval'd inside the sandboxed VM -
cb
{function} - callback to be called when the evaluation is done -
tolerateError
{boolean}, default: false - If set to true, errors inside the VM are logged (instead of calling back with an error object) -
logCode
{boolean}, default: true - log the code if it caused an error -
logError
{boolean}, default: true - Also logs the error if there is one emitted by the VM
Runs given code inside a sandboxed VM.
module type: stack component
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
module type: core component
Component that enables interactive console capabilities in the Embark command line interface as well as graphical user interfaces such as Cockpit.
name: console:register:helpCmd
arguments:
-
cmdOptions
{object} - Configuration object for help command to be registered-
helpCmd
{string} - Command to be executed as help command -
cmdName
{string} - Name of help command
-
-
cb
{function} - Callback to be called when help command registration is done
Registers a help command with the console.
name console:unregister:helpCmd
arguments:
-
cmdName
{string} - Name of help command
Deregisters help command from the console.
name: console:executeCmd
arguments:
-
cmd
{string} - Command to be executed -
cb
{function} - Callback to be called when command finished execution
Executes a given command in Embark virtual machine. a
module type: plugin
- 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
module type: ???
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: ???
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: stack component
name: tests:run
arguments:
- options - {object}
- doneCb - {function} called when tests are done
run tests with given options
name: tests:runner:register
arguments:
- name - {string} pluginName
- matchFn - {function(filepath)} function that returns boolean true if file being matched can be run by the plugin
- addFn - {function(filepath)} function that adds the file to the plugin runlist, throws exception if file doesn't match supported by plugin (should run matchFn first)
- runFn - {function(options, reporter)} function that runs the plugin
registers a test runner plugin
module type: plugin component
- runs test suites written in solidity using remix-tests
- ensures existence of the Assert (remix_tests.sol) library
- ensures test files include the Assert (remix_tests.sol) import statement and injects that statement to files that don't have it
- compiles & deploys contracts that have been added to this test runner, and then runs tests
module type: plugin component
- runs test suites written in javascript using mocha
- defines
config
function that gets exported and exposed in the mocha tests - builds, compiles & deploys contracts with the config given
- instantiates contracts in vanilla web3
- overrides require to return specified contracts
- defines
module type: stack component
name: deployment:contracts:deploy
arguments:
-
contractsList
- Array - array of Contract objects -
contractDependencies
-<object(string:[string])>
of dependencies key=contractName, value=`
deploys a list of contracts in the order of their dependencies
name: deployment:contract:deploy
arguments:
-
contract
-Contract
deploy contract
name: deployment:deployer:register
arguments:
-
blockchainType
- name of the blockchain tech (e.g "ethereum") -
deployerCb
-(contract, doneCb(err))
function that deploys specifiedcontract
then on finish callsdoneCb
register a deployer for blockchainType
for example register an ethereum contract deployer
name: deployment:deployContracts:beforeAll
description: actions to run before deploying contracts
name: deployment:deployContracts:afterAll
description: actions to run after contracts are deployed
name: deployment:contract:beforeDeploy
params: {contract: }
description: actions to run before deploying a contract
name: deployment:contract:deployed
params: {contract: }
description: actions to run after a contract has been deployed
name: deployment:contract:shouldDeploy
params: {contract: , shouldDeploy: boolean}
description: actions to run before deploying a contract, can change the shouldDeploy
flag
type: stack component
requests
request: embarkjs:plugin:register
params:
- stackName - e.g "blockchain", "messages", "storage"
- pluginName - e.g "web3", "whisper"
- packageName - e.g "embarkjs-whisper"
- moduleObj - e.g require('embarkjs-whisper')
registers an embarkjs plugin
request: embarkjs:console:register
params:
- stackName - e.g "blockchain", "messages", "storage"
- pluginName - e.g "web3", "whisper"
- packageName - e.g "embarkjs-whisper"
request to register embarkjs plugin the embarkjs instance running on the console/vm.
request: embarkjs:console:setProvider
params:
- stackName - e.g "blockchain", "messages", "storage"
- pluginName - e.g "web3", "whisper"
- config - config object necessary for the connection
request to connect a provider for the embarkjs instance running on the console/vm
request: embarkjs:contract:generate
params:
- contract - contract object
- doneCb - called when done
request to add contract artifact using embarkjs to the pipeline
request: embarkjs:contract:runInVm
params:
- contract - contract object
- doneCb - called when done
requests to run contract using embarkjs in the console/vm
actions used
-
pipeline:generateAll:before
- to generate embarkjs artifact according to registered plugins
module type: stack component
name: namesystem:node:register
arguments:
-
clientName
- {string} - name of node that starts ENS -
startCb
- {function} function to start the node
registers a node and the function that starts it
name: namesystem:node:start
arguments:
- namesystemConfig {object} - namesystem config (taken from dapp config/namesystem.js)
- doneCb {function} - function that is fired once the namesystem node has started
starts a namesystem node according to the config given. will start one of the nodes previously registered with namesystem:node:register
actions used
pipeline:generateAll:before
- to generate the namesystem.json artifact
module type: plugin component
- deploys & configures the ENS contracts, or uses existing one if connected to a supported chain
- registers any domains or subdomains as configured in the namesystem config
- registers the embarkjs-ens plugin & configures it
- registers console commands to interact with ENS
- registers api endpoints
- whitelists eth-ens-namehash package in the vm
actions used
-
deployment:deployContracts:beforeAll
- to deploy & configure ENS contracts -
deployment:deployContracts:afterAll
- to associate contract addresses to ens domain -
deployment:contract:beforeDeploy
- to replace contract arguments if they have ens domains with the associated adddress
module type: plugin
name: graph:create
description: Creates a diagram of Smart Contracts architecture.
params:
- options -
Object
- Options to configure graph task-
skipFunctions
- Skip functions in graph generation -
skipEvents
- Skip events in graph generation -
skipUndeployed
- Skip undeployed contracts -
output
- The path to write the diagram to
-
module type: stack
endpoint: /embark-api/versions
type: GET
params: -
response: Array<{value: string, name: string}>
- List of available versions for packages.
name: versions:get:[NAME]
description: Returns version of a given package, given NAME
.
params:
- name -
String
- Library name (e.g.ipfs
,solc
etc)
name: version:getPackageLocation
description: Returns package location, given a name and version number.
params:
- name -
String
- Library name (e.g.ipfs
,solc
etc) - version - String - version of library
name: version:downloadIfNeeded
description: Downloads a library, given its name.
params:
- name -
String
- Library name (e.g.ipfs
,solc
etc)
name: version:getPackagePath
description: Returns a path to a package given its name and version
params:
- name -
String
- Library name (e.g.ipfs
,solc
etc) - version -
String
- Library version
module type: stack component
name: pipeline:generateAll
Generates files registered with the pipeline
name: pipeline:register
arguments:
- Object
-
path
(array) - directory to write the file -
file
- filename -
format
- file format -
content
- file content
-
registers a file with the pipeline to be generated. if a path+file has already been registered before, it will override it.
name: pipeline:generateAll:before
description: actions to run before the pipeline generates all the files
name: pipeline:generateAll:after
description: actiosn to run after the pipeline generates all the files
module type: plugin
- runs webpack after pipeline generates files that were registered
actions used
-
pipeline:generateAll:after
- to run webpack after pipeline has generated files
events used
-
config:load:pipeline
- to get new pipeline config when it changes
module type: stack component
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
module type: plugin
- 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