Skip to content
Discussions/App Development/Non-manual method for creating parties on DAML hubForum ↗

Non-manual method for creating parties on DAML hub

App Development5 posts423 views2 likesLast activity Jun 2022
JU
Julius_WilliamOP
May 2022

Hi DAML community,

I’m trying to find a way to create many parties quickly on DAML hub (such as via API calls or a script) but it seems that it’s not currently supported.
May I know if there is an alternate solution to create a bunch of parties quickly without using the manual clicks required in DAML hub, both from the participant and admin view?

Thank you.

GY
gyorgybalazsi
May 2022

You can use the damlhub-cli utility: damlhub-cli - npm

See this part of the example script:

 for name in PartyA PartyB PartyC
 do
   damlhub -j ledger party ${LEDGER_ID} $name > /dev/null
 done
JU
Julius_William
May 2022

Thank you! Will try it out and report back.

JU
Julius_William
Jun 2022

Hi gyorg,

I attempted to run this command on an existing ledger on DAML hub :
damlhub -j ledger party <ledgerId> PartyA

after setting my jwt token copied from the identities tab in DAML hub.
I attempted to set the token as both

  • my damlhub account username’s part
  • the admin party manually created

But it returns the below error for both.

Unexpected error: FetchError: invalid json response body at 
https://login.hub.daml.com/auth/ledger/ujw59xsk3hjem7a8/user_grants reason: Unexpected token H in JSON at position 0
    at /usr/local/lib/node_modules/damlhub-cli/node_modules/node-fetch/lib/index.js:273:32
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  type: 'invalid-json'
}

Am I wrongly allocating the JWT token?

Thanks,
Julius

JU
Julius_William
Jun 2022

Solved: Had to use the jwt token in the account settings for anyone else who may encounter this.

← Back to Discussions