It is understood that daml sandbox v2.0 comes with a canton participant node, with the namespace changing every time we start it.
Is it possible to fix that namespace? Or at least give an option to do so? Reasons
(1) We have a CI environment built prior to 2.0, in which we are using hardcoded Party ID (fixed) as input for some contract creation. This breaks when we move to sandbox 2.0 as the Party we input needs to have the latest namespace.
(2) It makes sense to have this namespace for identity in a typical canton setup (multiple participant nodes), but the sandbox is just a one participant node + one domain. For dev/test purpose, there is no much need on the identity in a sandbox.
Or kindly advice if there is any workaround to address this challenge.
Generally, if you assume static identities in your development setup, then it will start to fall apart once you try to deploy it to production, where the cryptographic keys are used to generate identities. Therefore, I’d recommend that you really fix your development setup.
However, if you want to preserve identities between deployments, you can export the private keys and use them to manually re-initialise the node. I’ve described this previously here:
I tried to use daml sandbox and did something like key download/upload. Here are some findings.
Download/upload is not seen in the daml canton-console.
@ sandbox.keys.secret.
discard generate_signing_key list
generate_encryption_key help
I suspect it is because the daml canton-console is using remote-participants. I have tested this with canton examples/01-simple-topology and I see both upload and download.
@ participant1.keys.secret.
delete generate_encryption_key list
discard generate_signing_key upload
download help
Kindly advise if it is the case. If so, it seems I cannot download/upload key in the sandbox.
Many thanks.
kc
(PS: I have tested the recovery of namespace in a canton 2.0.0 setup. Thanks a lot for your post!)
Download / Upload are only available for local nodes, not remote ones. I think you should be able to use a bootstrap script with the sandbox, so you could place these commands in the script.