As described here Daml Script — Daml SDK 1.18.1 documentation, I am trying to run daml script against a postgresql ledger that has --auth-jwt-rs256-crt
enabled.
I am getting the error:
Command allocateParty failed: DEADLINE_EXCEEDED: REQUEST_TIME_OUT(3,MYID-3c9): Request timed out
In the daml on sql logs:
15:28:53.201 [daml.index.db.threadpool.connection.sandbox-0] WARN c.d.p.s.stores.ledger.sql.SqlLedger - Ignoring duplicate party submission with ID for submissionId Some(-3c9b2ad9-6200-4356-9c57-178d30a259e6) , context: {participantId: “daml-on-sql”, party: “”, submissionId: “-3c9b2ad9-6200-4356-9c57-178d30a259e6”}
In my participants.json I have:
{
"default_participant": {"host": "localhost", "port": 6865, "application_id": "<APPID>", "access_token": "<access_token>"},
"participants": {
"one": {"host": "localhost", "port": 6865, "application_id": "<APPID>", "access_token": "<myid_access_token>"}
},
"party_participants": {"<MYID>": "one"}
}
and in my script I have:
testJWT : Script ()
testJWT = do
myid <- allocatePartyWithHint "MYID" (PartyIdHint "MYID")
submit myid do
createCmd SampleTemplate with
p1 = myid
observers = [myid]
id = "mytest"
pure()
which I am running with:
daml script --dar .daml/dist/MYPROJ-0.1.0.dar --script-name MyScript:testJWT --access-token-file=./jwt_token_admin --participant-config participants.json
(I have successfully run daml upload-jar --access-token-file=./jwt_token_admin
)
Do I need to remove the myid <- allocatePartyWithHint "MYID" (PartyIdHint "MYID")
line? If so how do I reference the myid
party?
Does the participants.json
file automatically allocate parties to the ledger by the default_participant
?
Also, without the script, do parties need to be explicitly allocated or do they just need the appropriate jwt token signed by the rsa private key?