Updated formatted for last `embark-blockchain` stack component changes.

Eric Mastro 2020-02-18 15:47:07 +11:00
parent 91baed81f4
commit fbe6e2c933
1 changed files with 36 additions and 36 deletions

@ -141,53 +141,53 @@ module type: stack component
##### requests
###### blockchain:node:register
**name**: `blockchain:node:register`
**description**: Registers a blockchain client
**arguments**:
* `clientName {string}` - name of the client (e.g 'geth')
* `clientFunctions {object}` - object containing functions that interact with the blockchain node being registered. Object properties (all required):
- `isStartedFn {function}` - function that determines if the node is already started
- `launchFn {function}` - function that starts the blockchain
- `stopFn {function}` - function that stops the blockchain
- `provider {function}` - function that returns a provider for the blockchain. Defaults to a Web3 provider connecting to the endpoint specified in the blockchain config.
* `cb {function}` - callback function called after registration is completed.
- **name**: `blockchain:node:register`
- **description**: Registers a blockchain client
- **arguments**:
- `clientName {string}` - name of the client (e.g 'geth')
- `clientFunctions {object}` - object containing functions that interact with the blockchain node being registered. Object properties (all required):
- `isStartedFn {function}` - function that determines if the node is already started
- `launchFn {function}` - function that starts the blockchain
- `stopFn {function}` - function that stops the blockchain
- `provider {function}` - function that returns a provider for the blockchain. Defaults to a Web3 provider connecting to the endpoint specified in the blockchain config.
- `cb {function}` - callback function called after registration is completed.
###### blockchain:node:start
**name**: `blockchain:node:start`
**description**: Starts a blockchain name according to the config given. Will start one of the nodes previously registered with `blockchain:node:register`. If the registered `isStartedFn` returns `true`, the node is already running and not attempted to be started again. If `isStartedFn` returns `false`, `launchFn` is called.
**arguments**:
* `blockchainConfig {object}` - blockchain config (taken from dapp config/blockchain.js)
* `cb {function}` - function that is fired once the blockchain node has started
- **name**: `blockchain:node:start`
- **description**: Starts a blockchain name according to the config given. Will start one of the nodes previously registered with `blockchain:node:register`. If the registered `isStartedFn` returns `true`, the node is already running and not attempted to be started again. If `isStartedFn` returns `false`, `launchFn` is called.
- **arguments**:
- `blockchainConfig {object}` - blockchain config (taken from dapp config/blockchain.js)
- `cb {function}` - function that is fired once the blockchain node has started
###### blockchain:node:stop
**name**: `blockchain:node:stop`
**description**: Stops a blockchain node, by calling the registered `stopFn`. Will stop one of the nodes previously registered with `blockchain:node:register`.
**arguments**:
* `clientName {string}` - name of the registered blockchain node
* `cb {function}` - function that is fired once the blockchain node has stopped
- **name**: `blockchain:node:stop`
- **description**: Stops a blockchain node, by calling the registered `stopFn`. Will stop one of the nodes previously registered with `blockchain:node:register`.
- **arguments**:
- `clientName {string}` - name of the registered blockchain node
- `cb {function}` - function that is fired once the blockchain node has stopped
###### blockchain:node:provider
**name**: `blockchain:node:provider`
**description**: Gets a blockchain node's provider, by calling the registered `provider` function. Will get the provider of the nodes previously registered with `blockchain:node:register`. A **node provider** is a provider that allows a direct connection to the node, without going through Embark's proxy. It is not recommended to use this provider unless a **direct connection to the node is explicitly needed**. In most cases, `blockchain:client:provider` should be used instead.
**arguments**:
* `clientName {string}` - name of the registered blockchain node
* `cb {function}` - callback function called with an error and value of the provider
- **name**: `blockchain:node:provider`
- **description**: Gets a blockchain node's provider, by calling the registered `provider` function. Will get the provider of the nodes previously registered with `blockchain:node:register`. A **node provider** is a provider that allows a direct connection to the node, without going through Embark's proxy. It is not recommended to use this provider unless a **direct connection to the node is explicitly needed**. In most cases, `blockchain:client:provider` should be used instead.
- **arguments**:
- `clientName {string}` - name of the registered blockchain node
- `cb {function}` - callback function called with an error and value of the provider
###### blockchain:client:register
**name**: `blockchain:client:register`
**description**: Registers a function that returns a **client** provider for the node. A client provider is to be used by modules that want to connect to Embark's proxy, which is recommended for all modules that do not need a direct connection to the node (which is all modules except the proxy in most cases).
**arguments**:
* `clientName {string}` - name of the registered blockchain client provider
* `getProviderFunction {function}` - function that accepts a parameter `endpoint {string}` and returns a provider (ie a Web3 provider)
* `cb {function}` - callback function called after completion
- **name**: `blockchain:client:register`
- **description**: Registers a function that returns a **client** provider for the node. A client provider is to be used by modules that want to connect to Embark's proxy, which is recommended for all modules that do not need a direct connection to the node (which is all modules except the proxy in most cases).
- **arguments**:
- `clientName {string}` - name of the registered blockchain client provider
- `getProviderFunction {function}` - function that accepts a parameter `endpoint {string}` and returns a provider (ie a Web3 provider)
- `cb {function}` - callback function called after completion
###### blockchain:client:provider
**name**: `blockchain:client:provider`
**description**: Calls the client provider function registered using `blockchain:client:register`, and passes in the endpoint of the proxy. A **client provider** is to be used by modules that want to connect to Embark's proxy, which is recommended for all modules that **do not need a direct connection** to the node (which is all modules except the proxy in most cases).
**arguments**:
* `clientName {string}` - name of the registered blockchain client provider
* `cb {function}` - callback function called with an error and the value of the provider
- **name**: `blockchain:client:provider`
- **description**: Calls the client provider function registered using `blockchain:client:register`, and passes in the endpoint of the proxy. A **client provider** is to be used by modules that want to connect to Embark's proxy, which is recommended for all modules that **do not need a direct connection** to the node (which is all modules except the proxy in most cases).
- **arguments**:
- `clientName {string}` - name of the registered blockchain client provider
- `cb {function}` - callback function called with an error and the value of the provider
#### Actions used