CorDapp Builder CLI

CorDapp Builder CLI is a command-line utility that assembles Corda package bundles (.cpb files) from Corda package files (.cpk files).

Installation

CorDapp Builder CLI can be installed automatically or manually.

Manual installation

Before you start

If a previous installation of CorDapp Builder CLI exists, remove it. See deleting the CorDapp Builder CLI .

Steps

  1. Download the latest stable .tar or .zip file.

  2. Create a new bin/cordapp-builder directory under the current users home directory.

  3. Extract the previously-downloaded archive into this new directory.

    Once extracted, your folder structure should be as follows:

    bin/cordapp-builder
     ├───bin
     └───lib
    
  4. Windows: Add CorDapp Builder CLI to PATH:

    a. Go to the Edit the system environment variables Control Panel setting.

    b. Edit the Path user variable and add the cordapp-builder bin directory extracted in the previous step as a new entry. For example, C:\Users\username\bin\cordapp-builder\bin.

    c. If you are using Git Bash on Windows, update your home directory username/.bashrc file with the following code:

       # cordapp-builder default path
       export PATH="$HOME/bin/cordapp-builder/bin:$PATH"
    
  5. Linux or macOS: Add CorDapp Builder CLI to PATH by adding the following code to the ~/.bashrc (Linux) or ~/.zshrc file (macOS):

      # cordapp-builder default path
      export PATH="$HOME/bin/cordapp-builder/bin:$PATH"
    
  6. Verify installation by opening a new terminal session and running cordapp-builder --version.

    Step result: If successful, this will output details of the installed CorDapp Builder CLI version.

Automatic installation

  1. Download the universal installer .
  2. Run the following command.
    java -jar cordapp-builder-installer.jar
    
  3. Start a new shell.
  4. Test the program with the following command.
    cordapp-builder --version
    

Usage

Assemble a Corda package bundle

To assemble a .cpb file from a set of .cpk files use the following command.

cordapp-builder create --cpk file1.cpk --cpk file2.cpk -o result.cpb

Where:

  • -o specifies the output file.
  • --cpk specifies a .cpk file to include in the bundle. You can use this option as many times as you want to specify as many .cpk files as you want.

If you have a .cpk file and all of its .cpk dependencies are located in a single folder cpk-repository, you can use the following command.

cordapp-builder create --cpk cpk-repository/root.cpk -A cpk-repository -o result.cpb

This will fetch all the dependencies of root.cpk recursively from cpk-repository and bundle them in result.cpb.

You can also specify multiple repository folders:

cordapp-builder create --cpk root.cpk -A cpk-repository1 -A cpk-repository2 -o result.cpb

Sign the generated .cpb file

You can sign the generated .cpb file with the following command.

cordapp-builder create --cpk file1.cpk --cpk file2.cpk -k keystore.jks -a key-alias -p KEYSTORE_PASSWORD -P KEY_PASSWORD -o file.cpb

For enhanced security, you can also use either environment variables or a password file. Instead of typing KEYSTORE_PASSWORD and KEY_PASSWORD directly, to read secrets from environment variables STORE_PASS and KEY_PASS use, the following command.

cordapp-builder create --cpk file1.cpk --cpk file2.cpk -k keystore.jks -a key-alias -p:env STORE_PASS -P:env KEY_PASS -o file.cpb

To read secrets from files keystore_password_file.txt and key_password_file.txt use the following command.

cordapp-builder create --cpk file1.cpk --cpk file2.cpk -k keystore.jks -a key-alias -p:file keystore_password_file.txt -P:file key_password_file.txt -o file.cpb

Delete the CorDapp Builder CLI

To uninstall CorDapp Builder CLI tool, perform the following steps:

  1. Delete the application’s folder.

  2. Remove the application’s folder from the PATH.

  3. Optional for Unix and macOS only: Remove the symbolic link to the application launcher created in $HOME/.local/bin/cordapp-builder.

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.