DAR file uploaded through canton remote console
- kctamOP
Hi Team,
I am testing DAR upload in a canton participant node with authorization enabled, with commandparticipant1.dars.upload(<a dar file>.I found that the upload is successful when it is done directly in interactive mode (the console with the canton process), but fails when it is done through a remote console, with error unauthenticated.
I suspect it is because the remote console is using ledger-api for DAR upload, such that authorization (a signed JWT) is needed.
I have generated that signed JWT and tested it with
daml ledger upload-darwith daml sdk. May I know how to specify that JWT in the configuration of the remote canton console?Thanks in advance.
kc
- Ratko_Veprek 2
Hi @kctam
Right now, there are two ways to upload to canton via the console:
participant.dars.uploadandparticipant.ledger_api.upload_dar. Which one are you using? Generally, if your remote console works, thenparticipant.dars.uploadshould work. In a subsequent version of the Ledger API, we’ll see to unify them again, but for now, we need to keep both, as thedars.uploadhas some additional control and preserves the DAR (you can list it viaparticipant.dars.list()).You can define the JWT token for the ledger api using
canton.remote-participants.myparticipant.token = "JWT TOKEN AS A STRING"However, please note that the whole
participant.ledger_apicommand section is for convenience only and we don’t currently guarantee that the interface will remain stable, as our ultimate goal is to strive for uniform user experience across all integrations.I hope this helps
Ratko
- kctam
Thanks @Ratko_Veprek
I’m using
particpant.dars.uploadand not using theledger_apione.The configuration
canton.remote-participants.myparticipant.tokenworks fine. That’s what i need. Thanks again.What interests me is that the console directly attached on participant node doesn’t require the token, while the remote console needs the token. My guess is that the direct console doesn’t use ledger-api when uploading the DAR, while remote console the upload is done through ledger-api (but not admin-api).
Thanks again!
kc
- Ratko_Veprek
The
participant.upload.dardoes some synchronisation to ensure that the upload DAR is usable once the call terminates. This synchronisation is looking at the ledger-api as well and because of that it needs the auth token.For local setups, we can use some magic:
https://docs.daml.com/canton/usermanual/security.html#ledger-api-authorizationBut that magic is not available for remote nodes.
- kctam
Thanks @Ratko_Veprek This answers my query. Interesting magic…
cheers,
kc