In 1.x, we could just the display names supplied when the Parties are allocated in API that calls that need Party IDs. In 2.x this is no longer possible, because the display names are no longer used as the party IDs.
Now, how do I obtain the actual Party IDs to be used in API calls. Specifically, how do I make the act_as argument in the connect call in the dazl API work:
async with dazl.connect(url=FLAGS.ledger_backend,
act_as=[dazl.Party('A'), dazl.Party('B')]) as conn:
await asyncio.gather(A(conn), B(conn))
A and B are the Party names used in daml.yaml. They used to work in 1.x, but in 2.x this yields an INVALID_PARTY_IDENTIFIER error message.
To answer your concrete question you first have to allocate your parties (e.g. via daml script’s allocateParty) and then use the result of that as your party id in dazl. One approach could be that your daml script writes out the party ids it has allocated to a json file via --output-file and you read that file in your python code.