Skip to content
CCPEDIAby Unity Nodes
App Development

Roles on Navigator

6 posts386 views13 likesLast activity Feb 2022

  1. h_twistOP 1

    Hello everyone. It might be a silly question, but I could not found it anywhere.

    How can I change the roles displayed on the first screen of navigator?

    Currently it displays only Alice and Bob.

  2. stefanobaghino-da 2

    Navigator should list all the allocated parties. You can make a quick experiment by running

    daml new --template quickstart-java quickstart
    

    Navigator will be opened and you’ll see a few allocated parties in the dropdown, including Alice and Bob.

    If you then run

    daml ledger allocate-parties Charlie
    

    And reload Navigator you should see Charlie listed there as well.

  3. Max 3

    Another way is to have a look at the daml.yaml file, below is an example. If you add another party under parties, for example, Eve, it should display when you run the navigator again

    sdk-version: 1.16.0
    name: iou-demo
    version: 0.1.0
    source: daml
    parties:
    - Alice
    - Bob
    - Charlie
    dependencies:
    - daml-prim
    - daml-stdlib
    - daml-trigger
    sandbox-options:
    - --wall-clock-time
    - --ledgerid=iou-demo-sandbox
    start-navigator: true
    codegen:
      js:
        output-directory: ui/daml.js
        npm-scope: daml.js
    
  4. Ben_M 2

    Nice one @Max that’s what I would do.

    I was going to suggest that, but in terms of code brevity and simplicity, @stefanobaghino-da wins.

    /me upvotes daml ledger allocate-parties Charlie

  5. stefanobaghino-da 3

    On the other hand, @Max’s approach is purely declarative and if you’re trying to set up an environment his approach is probably advisable, allowing you to keep track of parties in your system in a single place.

  6. Luciano 2

    As per @Max 's comment, they can be specified in the parties section of the daml.yaml file. But note also, that in recent versions of the SDK, this list is populated automatically from any init-script you specify in the daml.yaml file, if you omit parties.