digital-asset / daml

The Daml smart contract language
https://www.digitalasset.com/developers
797 stars 199 forks source link

Add CLI flag to set Navigator port to daml ledger navigator #10510

Closed bame-da closed 2 years ago

bame-da commented 3 years ago

The way to set both the ledger and navigator port with daml ledger navigator is currently

daml ledger navigator --host localhost --port 6866 --port 4001

I'd prefer having different names for the two ports.

cocreature commented 3 years ago

My preference here is still to kill daml ledger navigator/make it simply redirect to daml navigator. The only thing that daml ledger navigator does at this point is to read the deploy section from daml.yaml and you’re overwriting that so you gain nothing by using it over daml navigator.

bame-da commented 3 years ago

The other difference is that daml ledger navigator always reads the parties from the running ledger, whereas daml navigator takes them form daml.yaml.

But I agree that we should consolidate the two and that daml navigator is more in line with the rest of the assistant.

bame-da commented 3 years ago

I guess what's missing from daml navigator is an ability to start it outside of a project directory and have it read the parties from the ledger.

cocreature commented 3 years ago

I guess what's missing from daml navigator is an ability to start it outside of a project directory and have it read the parties from the ledger.

That’s not true. See release notes for SDK 1.8.0

If no parties are in the Navigator config or daml.yaml, Navigator will now pick up parties from the party management service. Those parties are periodically refreshed.

daml ledger navigator only passes -ignore-project-parties to daml navigator so it always ignores the daml.yaml file. Apart from that, they are identical wtr to parties.

I think we should just deprecate the parties field in daml.yaml. It servers no useful purpose and doesn’t work with implicit party allocation. An init-script is a better solution for allocating a set of parties initially.

bame-da commented 3 years ago

Yes, but that doesn't work outside a project. If you try to use daml navigator server outside a project (ie in the absence of a daml.yaml, you get:

No configuration file found!
Please specify a configuration file and restart Navigator.
Config file path was 'DefaultConfig(ui-backend.conf)'.
Hint: use the create-config command to create a sample config file.

I think if we just made that behave the same as daml navigator server in a project with no parties specified, we could deprecate daml ledger navigator.

cocreature commented 3 years ago

Oh I see, so we just need to default to an empty config file. Easy enough.

cocreature commented 3 years ago

Opened https://github.com/digital-asset/daml/issues/10516 for the config file stuff.

cocreature commented 3 years ago

The config file stuff has been merged so daml navigator server works fine outside of a project now.

cocreature commented 2 years ago

daml ledger navigator is dead.