Onboard External Party
This tutorial demonstrates how to onboard an external party using the Ledger API.Prerequisites
This tutorial uses a script which is included as an example in the Canton artifact. Please note that the script uses openssl to create keys on the file system, which is not secure for production use. To obtain a Canton artifact refer to the getting started section. From the artifact directory, start Canton using the command:Run The Script
The steps of this tutorial are included in the scriptexternal_party_onboarding.sh located in the examples/08-interactive-submission directory of the artifact. The steps covered by the script are:
- Create a private key using openssl for the external party.
- Determine the synchronizer-id available.
- Create a set of topology transactions to define a new external party.
- Sign the topology transactions.
- Upload the signed topology transactions to the Ledger API.
canton_ports.json file which contains the port configuration of the running Canton instance, or invoke the script with the hostname and port of the Ledger API using the command line argument -p1 <host>:<port>.
Once you start it, you will see:
The Details of the Script
First, the script determines the available synchronizer-ids using thev2/connected-synchronizers endpoint, assuming that there is exactly one. The party allocation must be repeated for each synchronizer-id the party should be hosted on.
/v2/parties/external/generate-topology to generate the topology transactions required to onboard the external party. This is fine if the node is trusted. In other scenarios, the transactions should be built manually or inspected before signing, including recomputing the hash.
Onboard Multi-Hosted External Party
This tutorial demonstrates how to onboard an external party using the Ledger API which is hosted on multiple validators. It is a simple extension to the onboard external party tutorial.Prerequisites
Make sure that you have completed the onboard external party tutorial and still have a running Canton example instance.Run The Script
The example script used in the previous tutorial also supports onboarding a multi-hosted external party. It will onboard by default on two nodes if invoked with the--multi-hosted command line argument.
The Details of the Script
The flag--multi-hosted will pass the second participant id into the generate-topology request through the
observingParticipantUids, confirmationThreshold and more. If not configured, then the confirmation threshold will be set to the number of confirming nodes.
The generated topology transactions then just need to be uploaded to the Ledger API of the second participant:
txHash, which can be obtained from the output of the previous command: