# createUser error when running the script in Canton

**URL:** <https://forum.canton.network/t/createuser-error-when-running-the-script-in-canton/4566>\
**Category:** App Development\
**Tags:** canton\
**Created:** [May 19, 2022, 8:43am UTC](https://forum.canton.network/t/createuser-error-when-running-the-script-in-canton/4566 "2022-05-19T08:43:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dorrit\_Du](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/dorrit_du/32/2417_2.png) [@Dorrit\_Du](https://forum.canton.network/u/Dorrit_Du)\
**Post date:** [May 19, 2022, 8:43am UTC](https://forum.canton.network/t/createuser-error-when-running-the-script-in-canton/4566/1 "2022-05-19T08:43:41Z")

</div>

Hi team,

I am using daml script to to create User base on party and the dar file deployed to Canton. However when trying to run the script on Canton, the script failed on createUser. Can you advise please?

Daml script

```haskell
  createUserFromParty: Party -> Script ()
    createUserFromParty p = do
      -- add alias for mapping
      let hint = getPartyHint p
      submit p do createCmd Alias with currentParty = p; displayName = hint; ..
      userId <- validateUserId $ asciiToLower hint
      createUser (User userId $ Some p) $ (CanActAs p) :: [CanReadAs public]

```

Error when running the daml script

```haskell
~/canton-enterprise-2.0.0$ daml script --dar da-marketplace-0.2.0.dar --script-name Tests.FundManagement.Distribution:preMarketUISetupTest --participant-config participant.json
Exception in thread "main" com.daml.lf.engine.script.ScriptF$FailedCmd: Command createUser failed: No default participant
Daml stacktrace:

```

thanks,  
Dorrit

---

<div class="post-metadata">

**Author:** ![soren](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/soren/32/51_2.png) [@soren](https://forum.canton.network/u/soren)\
**Post date:** [May 19, 2022, 9:45am UTC](https://forum.canton.network/t/createuser-error-when-running-the-script-in-canton/4566/2 "2022-05-19T09:45:20Z")

</div>

Hi Dorrit,

How does your `participant.json` look like? You need to specify a `default_participant` in case you use daml script in a distributed topology, see [Daml Script — Daml SDK 2.2.0 documentation](https://docs.daml.com/daml-script/index.html#use-daml-script-in-distributed-topologies).

---

<div class="post-metadata">

**Author:** ![Dorrit\_Du](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/dorrit_du/32/2417_2.png) [@Dorrit\_Du](https://forum.canton.network/u/Dorrit_Du)\
**Post date:** [May 23, 2022, 7:02am UTC](https://forum.canton.network/t/createuser-error-when-running-the-script-in-canton/4566/3 "2022-05-23T07:02:10Z")

</div>

> [@soren](#):
>
> default\_participant

thanks Soren. after adding default\_participant and it works!
