Giter Club home page Giter Club logo

corda-cli-plugin-host's Introduction

Corda CLI Plugin Host

Setup/Build

Run ./gradlew build

  • This creates the following:
    • corda-cli.jar in the app/build/libs/ directory
    • plugin-example-plugin-0.0.1.zipin the build/plugins directory
    • wrapper scripts, including corda-cli.sh in the build/generatedScripts directory

These files enable you to run plugins. You can build plugins from other repositories and copy them in to the build/plugins directory. Plugin JARs can be placed into build/plugins without rebuilding this plugin host project; they will be picked up dynamically, and you do not have to list them out or do anything more than just copy them in to this directory. To work with Corda 5, execute the following to retrieve corda-runtime-os/tools/plugins/package and corda-runtime-os/tools/plugins/mgm:

(cd .. && git clone https://github.com/corda/corda-runtime-os.git)
(cd ../corda-runtime-os && ./gradlew :tools:plugins:package:build  :tools:plugins:network:build)
cp ../corda-runtime-os/tools/plugins/package/build/libs/package-cli-plugin-*.jar ../corda-runtime-os/tools/plugins/network/build/libs/network-cli*.jar build/plugins/

Running the CLI Script

The build process generates scripts in the build/generatedScripts directory. This ensures scripts always refer to the correct version of corda-cli.jar. The build process copies the scripts from the root scripts directory to build/generatedScripts and updates the version referenced in the scripts accordingly. It also generates the required Jars. You can also manually trigger this task with ./gradlew generateVersionedScripts if required, but the corda-cli jar must be generated and present in the app\build\libs to execute these scripts.

The build/generatedScripts directory contains a windows cmd and shell command script that can be called after a gradlew Build. corda-cli.cmd etc

Plugins

Refer to the detailed documentation for each plugin:

Example Plugin

Root Command: example-plugin Sub Commands included:

  • sub-command - Prints a welcome message.

Config

Logging config

Corda CLI logs everything to a file in the users home directory located in ~/.corda/cli/logs by default. This behaviour can be changed by editing the following in the corda-cli.cmd/sh files:

  • -DlogLevel - the minimum level to be logged.
  • -DlogFile - location of the log file.

You can add these flags as Java Parameters before the jar file is called.

Plugin Config

You can also change the plugin directory by editing the following in the corda-cli.cmd/sh files:

  • -Dpf4j.pluginsDirโ€” changes the directory plugins are loaded from.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.