-
Notifications
You must be signed in to change notification settings - Fork 27
Member Onboarding (Static Networks)
This page describes the onboarding process for static members. To understand the basic concept behind the static network, see the Membership wiki.
Note: Static Networks does not require an MGM. If you will need to use an MGM then please follow the instructions for Dynamic Onboarding.
To build and deploy Corda 5 to a Kubernetes cluster, follow the instructions for Local development with Kubernetes.
Create a directory to store your files.
mkdir -p ~/Desktop/register-member/
Build the mgm
plugin in the corda-runtime-os repo using the following command:
./gradlew :tools:plugins:mgm:build
Build the corda-cli-plugin-host repo:
./gradlew build
Copy mgm-5.0.0.0-SNAPSHOT.jar
from corda-runtime-os
:
cd tools/plugins/mgm/build/libs
To the corda-cli-plugin-host
repo's build/plugins
directory. Run the following command to generate your GroupPolicy
file:
./build/generatedScripts/corda-cli.sh mgm groupPolicy --name="C=GB, L=London, O=Alice" --name="C=GB, L=London, O=Bob" --name="C=GB, L=London, O=Charlie" --endpoint-protocol=1 --endpoint="http://localhost:1080" > ~/Desktop/register-member/GroupPolicy.json
For more options to generate GroupPolicy
file follow this readme.
Create a CPI by building the CPB and adding the group policy to it.
./gradlew testing:cpbs:flow-worker-dev:build
cp testing/cpbs/flow-worker-dev/build/libs/flow-worker-dev-5.0.0.0-SNAPSHOT-package.cpb ~/Desktop/register-member/
cd ~/Desktop/register-member/
zip flow-worker-dev-5.0.0.0-SNAPSHOT-package.cpb -j ./GroupPolicy.json
Upload the CPI:
curl --insecure -u admin:admin -F upload=@./flow-worker-dev-5.0.0.0-SNAPSHOT-package.cpb https://localhost:8888/api/v1/cpi/
The returned identifier (e.g. the return will look like {"id":"f0a0f381-e0d6-49d2-abba-6094992cef02"}
and the identifier is the id, or, using jq, one can run CPI_ID=$(curl --insecure -u admin:admin -F upload=@$CPI_PATH $API_URL/cpi | jq -r '.id')
) ) is the CPI ID
, use it below to get the checksum of the CPI
curl --insecure -u admin:admin https://localhost:8888/api/v1/cpi/status/<CPI ID>
The result contains the CPI checksum
. Save this for the next step.
Next is to create a virtual node for each member using the CPI checksum
. Save the holding identity ID short hash
s obtained from this step.
curl --insecure -u admin:admin -d '{ "request": { "cpiFileChecksum": "<CPI checksum>", "x500Name": "<member's name>" } }' https://localhost:8888/api/v1/virtualnode
The available key schemes are viewable through
KeysRpcOps
. One of them is used as an example in the command below.
To register a member, run the following command (replace <holding identity ID short hash>
with the ID short hash obtained before):
curl --insecure -u admin:admin -d '{ "memberRegistrationRequest": { "action": "requestJoin", "context": { "corda.key.scheme": "CORDA.ECDSA.SECP256R1" } } }' https://localhost:8888/api/v1/membership/<holding identity ID short hash>
Run this command for each member defined in the staticNetwork
section of your GroupPolicy.json.
Perform a lookup to ensure all members have registered successfully and are visible to each other:
curl --insecure -u admin:admin -X GET https://localhost:8888/api/v1/members/<holding identity ID short hash>
Note: Only the members who has
ACTIVE
membership status should be visible.