Command-line interface for Fabric setup and update operations
Example
// Update Fabric install script
node fabric.js update
// Setup Fabric components
node fabric.js setup --fabric-version 2.5.12 --ca-version 1.5.15 --components binary docker
Methods
# static setupFabric(config) → {Promise.<void>}
This function installs the specified Fabric components using the install-fabric.sh script. It iterates through the components list and executes the script for each component with the specified Fabric and CA versions. After installation, it copies configuration files to the root config folder.
Sets up Fabric components based on the provided configuration
Parameters:
| Name | Type | Description |
|---|---|---|
config |
Object
|
Configuration object for Fabric setup |
fabricVersion |
string
|
Fabric version to install |
caVersion |
string
|
Fabric CA version to install |
components |
Array.<string>
|
List of components to install |
If the install script is not found, component installation fails, or file copying fails
Error
Promise.<void>
Example
const config = {
fabricVersion: "2.5.12",
caVersion: "1.5.15",
components: ["binary", "docker"]
};
await setupFabric(config);
# static updateFabric() → {Promise.<void>}
This function removes the existing install script (if present), downloads the latest version from the Hyperledger Fabric GitHub repository, and makes it executable.
Updates the Fabric install script by downloading the latest version
If the download fails or file operations encounter issues
Error
Promise.<void>
Example
await updateFabric();