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.
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.
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.
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
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
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.
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
.