-
Notifications
You must be signed in to change notification settings - Fork 27
Network Plugin
The Network plugin is a plugin for Corda CLI plugin host to set up and manage application networks using corda-cli.
To use the Network plugin, you will need a working copy of corda-cli
with the plugin installed. To do this, you can either download it from the R3 Developer Portal or build it from source.
- Follow the instructions on the Installing the Corda CLI page.
- Run commands using the
corda-cli.sh
script.
- Clone the corda-cli-plugin-host repository from GitHub:
git clone https://github.com/corda/corda-cli-plugin-host.git
cd corda-cli-plugin-host
- Build the project using Gradle:
./gradlew build
-
Locate the
corda-cli.sh
script in thecorda-cli-plugin-host/build/generatedScripts/
directory. -
Build the plugin JAR from the corda-runtime-os repository from GitHub:
./gradlew :tools:plugins:network:build
-
Move the generated JAR to the
corda-cli-plugin-host/build/plugins/
directory. -
Run commands using the
corda-cli.sh
script.
Note: The commands below expect the REST endpoints of the target Corda cluster to be available at
https://localhost:8888
. To allow insecure server connections with SSL, use--insecure
.
The dynamic
command is for operations related to dynamic networks, including MGM and member onboarding.
The onboard-mgm
command creates a virtual node for an MGM and initiates the onboarding process, through which an application network is created. The session and ECDH keys are auto-generated by the Network plugin during registration. The group policy is also exported to be used for creating Member CPI(s).
./corda-cli.sh network dynamic onboard-mgm "O=MGM, L=London, C=GB" -s <save-group-policy-as> --wait --user=admin --password=admin --target=https://localhost:8888
Use ./corda-cli.sh network dynamic onboard-mgm --help
to view all available options.
The onboard-member
command is for onboarding members onto a dynamic network. It creates a virtual node for the member, and starts the registration process by auto-generating session and ledger keys.
To onboard a member using a CPB and group policy:
./corda-cli.sh network dynamic onboard-member "O=Alice, L=London, C=GB" --cpb-file <path-to-your-CPB-file> --group-policy-file <path-to-your-group-policy> --wait --user=admin --password=admin --target=https://localhost:8888
To onboard a member using the hash of a previously uploaded CPI:
./corda-cli.sh network dynamic onboard-member "O=Alice, L=London, C=GB" --cpi-hash <cpi-hash> --wait --user=admin --password=admin --target=https://localhost:8888
To onboard a member as a notary:
./corda-cli.sh network dynamic onboard-member "O=Alice, L=London, C=GB" --cpi-hash <cpi-hash> --role "notary" --set "corda.notary.service.name"="C=GB, L=London, O=Notary" --wait --user=admin --password=admin --target=https://localhost:8888
Use ./corda-cli.sh network dynamic onboard-member --help
to view all available options.
The get-registrations
command is for checking the status of registration requests.
To view all requests for a holding identity:
./corda-cli.sh network get-registrations -h <holding-id> --user=admin --password=admin --target=https://localhost:8888
To view a specific registration request, use --request-id
:
./corda-cli.sh network get-registrations -h <holding-id> --request-id <request-id> --user=admin --password=admin --target=https://localhost:8888
Note: You can use
--name
and--group
if the holding ID is not known. If only--name
is specified, the last created group will be used by default.
The lookup
command is for looking up group parameters or peers on the network.
Note: You can use
--name
and--group
if the holding ID is not known. If only--name
is specified, the last created group will be used by default.
To look up all members visible to a holding identity:
./corda-cli.sh network lookup members -h <holding-id> --user=admin --password=admin --target=https://localhost:8888
Use ./corda-cli.sh network lookup members --help
to view all available options, including status and X.500 attribute filters.
To look up group parameters for a holding identity:
./corda-cli.sh network lookup group-parameters -h <holding-id> --user=admin --password=admin --target=https://localhost:8888