Failed to create contract
- skylornaOP
I failed to create a contract using sdk1.18.0 and canton2.0.1,
{
“errors”: [
“INVALID_ARGUMENT: INVALID_PARTY_IDENTIFIER(8,c22af5ed): The given party is not a valid Canton party identifier: Unable to parse party: Invalid unique identifierAlicewith missing namespace.”
],
“status”: 400
}“Alice” is already a valid related party
{
“result”: [
{
“identifier”: “participant1::1220b1d67653f4f11c5155907f15c066f9c7964f112e89ce940cfe56217fcb415055”,
“isLocal”: true
},
{
“identifier”: “Lorna::1220b1d67653f4f11c5155907f15c066f9c7964f112e89ce940cfe56217fcb415055”,
“isLocal”: true
},
{
“identifier”: “Alice::1220b1d67653f4f11c5155907f15c066f9c7964f112e89ce940cfe56217fcb415055”,
“isLocal”: true
},
{
“identifier”: “Bob::1220b1d67653f4f11c5155907f15c066f9c7964f112e89ce940cfe56217fcb415055”,
“isLocal”: true
},
{
“displayName”: “Sky”,
“identifier”: “Sky::1220b1d67653f4f11c5155907f15c066f9c7964f112e89ce940cfe56217fcb415055”,
“isLocal”: true
}
],
“status”: 200
} - skylorna
- skylorna
- cocreature
You need to use the full party id in your
createrequest for theissuerandownerfield soAice::1220b1d… - skylorna 1
- skylorna
- skylorna
Shall I splice here?

- georg 2
Hi @skylorna we’ve just merged Update to 2.2.0, remove Daml Hub support by georg-da · Pull Request #58 · digital-asset/daml-ui-template · GitHub to upgrade to the latest SDK version 2.2.0
This includes a way to login with party aliases, while still using proper Canton party ids in the background.
Check out the latest version on master to see if it works for you.
- skylorna
thank you I’ll try
- skylorna
- a_putkov
@skylorna,
I feel that you’ll benefit from taking a look at the following blog post, which explains the difference between parties in Daml 1.18 vs. Daml 2.x.
Parties and users in Daml 2.0I have tried to submit the contract, but I need to manually change the file parties.json, can it be dynamically obtained.
To answer your question, you can obtain the list of parties with full party IDs from the ledger. You actually included an example of doing this in an earlier post on this thread. But, if I understand correctly, what you’re asking is whether you can obtain the mapping between party aliases and party IDs. Such mapping does not exist on the ledger because party aliases do not exist on the ledger. When you allocate a party on the ledger, you don’t set up an alias for the party. You may setup a party ID hint and a display name, but these serve a different purpose. See the blog post I referenced above for details. In Daml 2.x we recommend against using party display names altogether. Judging by the payload in the HTTP response that you got when you retrieved all known parties, which you included in a previous post on this thread, you didn’t use display names previously either. Party ID hints cannot be used as party identifiers in Daml 2.x.
Long story short, there’s no built-in concept of party aliases on the ledger. But you could set up and maintain party aliases (for the purpose of using them in the UI) in your UI project. The latest version of daml-ui-template-master provides an example of how this could be achieved by storing the mapping between parties and aliases in Parties.json file.
Storing the map between party IDs and aliases in a JSON file in the UI project is just one approach to providing human readable party identifier. Another option is to create an alias contract for each party on the ledger, which is what create-daml-app does. And another is to use User Management. See “Authorization and user management” section in the blog post I referenced above.
I hope this answers your question. - skylorna
thank you
- georg
parties.jsonis dynamically generated everytime you start the ledger usingdaml start. The init script will output the allocated parties into that file, which is then used by the UI. You just need to make sure you always start the ledger usingdaml startbefore starting your UI server. - skylorna
thank you
I start the ledger with Canton. I used
DAML JSON API --ledger host localhost --ledger port 10011 --http port 7575 --allow secure tokens before starting my UI server.
so parties.json has not changed - georg
You need to run the init script in order for
parties.jsonto be (re)generated. You can do that either via starting everything throughdaml start, or by running the init script explicitly throughdaml script .... Make sure to do this before starting up your UI server, so that the newly generatedparties.jsongets picked up by it. - skylorna
Thank you. I’ll study it again





