Commit Graph

207 Commits

Author SHA1 Message Date
Simon Maxen
75f7dadf9d
Update Metering Helper in line with spec changes [DPP-904] (#13007)
* Switch metering command line aruments to day from ISO time

* New metering json layout

changelog_begin
changelog_end
2022-02-22 11:14:56 +00:00
Moritz Kiefer
71fc3529e6
Improve --help ux for Canton sandbox (#12990)
* Improve --help ux for Canton sandbox

fixes #12985

changelog_begin
changelog_end

* .
2022-02-21 10:33:50 +01:00
Moritz Kiefer
0b64817fdb
Rename Canton repl to Canton console (#12866)
Product decided on console so console it is. Name bikeshedding will
not be accepted.

changelog_begin
changelog_end
2022-02-10 13:18:03 +00:00
Moritz Kiefer
8b8ee4c9e5
Bump Canton and reenable tests (#12852)
* Bump Canton and reenable tests

fixes #12808

changelog_begin
changelog_end

* display names are no longer defaulted

changelog_begin
changelog_end

* topology-change-delay is redundant

changelog_begin
changelog_end

* Switch away from grpcurl

changelog_begin
changelog_end

* try to fix canton conformance tests

changelog_begin
changelog_end

* that’s not how you scala

changelog_begin
changelog_end
2022-02-10 08:13:44 +01:00
Moritz Kiefer
22165730bf
Migrate Haskell tests to Sandbox on X (#12761)
* Migrate Haskell tests to Sandbox on X

The diff here looks extremely confusing. sandbox-classic is now
sandbox on x not sandbox classic so this isn’t a typo. It is really
moving to sandbox on x.

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2022-02-07 21:18:16 +01:00
Sofia Faro
4995728213
Expose Canton Repl as "daml canton-repl" (#12736)
Fixes #12268

changelog_begin
changelog_end
2022-02-03 16:04:25 +00:00
Moritz Kiefer
6ff7dc240a
Drop sandbox-kv from the SDK (#12717)
Depends on #12716 and #12625 (CI fails until they are merged & this
is rebased so no chance of merging this accidentally).

changelog_begin
changelog_end
2022-02-03 11:19:06 +00:00
Moritz Kiefer
f6344a2098
Accept a --wall-clock-time option for the Canton sandbox (#12733)
We have this in so many of our examples that I expect a lot of users
have it as well and we can trivially support it so it seems nice to
not break things more for our users than necessary.

changelog_begin
changelog_end
2022-02-03 11:54:01 +01:00
Moisés Ackerman
e4764cc426
Upgrade to GHC 9.0.2 (#12300)
changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2022-02-01 11:27:11 +01:00
Moritz Kiefer
f1c7e9ed9a
Drop daml ledger navigator in favor of daml navigator (#12669)
fixes #11323

changelog_begin
changelog_end
2022-02-01 09:50:00 +01:00
Moritz Kiefer
d215a010fd
Enable user management for the Canton sandbox (#12667)
changelog_begin
changelog_end
2022-01-31 12:27:29 +00:00
Moritz Kiefer
9c3f1ce93a
Drop dummy token from JSON API check (#12593)
* Drop dummy token from JSON API check

That token is broken in a number of ways, e.g. broken ledger ids,
parties that may not exist, ….

When we created that there was no healthcheck endpoint on the JSON API
but now that there is one, we can just use that one and it doesn’t
need any token so things get a lot simpler.

changelog_begin
changelog_end

* I promise it compiles this time

changelog_begin
changelog_end
2022-01-26 13:11:37 +01:00
Moritz Kiefer
ad7148b1d6
Tear down daml services gracefully (#12591)
* Tear down daml services gracefully

The integration tests occasionally produce errors of the form

```
daml-helper: /tmp/extra-dir-68844949176204: changeWorkingDirectory:
does not exist (No such file or directory)
```

While these are mostly harmless they are at the very least very
confusing.

This is caused by yet another instance of killing processes without
waiting for them to terminate which causes us to remove a temp dir
before the process reaches the `finally` clause of
`wtihCurrentDirectory`.

This PR fixes this by shutting things down gracefully. Process groups
& graceful shutdowns are a mess on Windows so we go via the shutdown
on stdin close functionality we added for that.

changelog_begin
changelog_end

* typing is hard

changelog_begin
changelog_end
2022-01-26 11:31:25 +00:00
Moritz Kiefer
122a487ac7
Fix static-time config in Canton (#12584)
Slightly confusingly there are three different options that need to be
set for this to actually work from a ledger API pov and with the port
files option.

changelog_begin
changelog_end
2022-01-26 10:35:29 +01:00
Simon Maxen
8fa54c67ce
Experimental daml assistant support for metering report [DPP-816] (#12485)
* Add experimental Daml assistant support for ledger metering

CHANGELOG_BEGIN
Add experimental Daml assistant support for ledger metering
CHANGELOG_END

* Update with review comments

* Update with review comments
2022-01-24 16:11:59 +00:00
Sofia Faro
a5f56e0671
Use canton sandbox in script+trigger compat tests (#12514)
Part of #11831. This kills another two uses of sandbox-kv.

Also fixes a daml-helper issue where we weren't passing "localhost" to the
ledger flags, so it was complaining about starting outside of a project.

changelog_begin
changelog_end
2022-01-20 17:10:11 +00:00
Sofia Faro
7880d5416d
Add --port-file and --dar flags in daml sandbox (#12505)
* Add some compatibility flags in daml sandbox

Part of https://github.com/digital-asset/daml/issues/11831

This PR is just to make it easier to migrate to the new sandbox.
I changed the behavior of --port-file to output a simple port (the
old behavior can be obtained with --canton-port-file instead, which
outputs all the port files of each participant), and I added a --dar
option to upload a dar after setting up the sandbox.

In addition, I made the `daml sandbox` command output something on
startup & success. The previous version was completely silent, so
you couldn't tell just from running it whether it was succesful.

However, I did discover that `--static-time` was accidentally
a no-op. Upon enabling it, I find that sim-clock doesn't work,
it causes canton to hang. This seems like a canton issue, but
needs further investigation.

For testing, I'm using --port-file and --dar in the quickstart
integration test, and --canton-port-file in the other canton
sandbox test.

changelog_begin
changelog_end

* redundant message

* Allow multiple --dar arguments
2022-01-20 14:19:03 +00:00
Sofia Faro
b2a7f9e640
Change default sandbox to canton (#12438)
* Change default sandbox to canton.

Some progress on #11831

* made `daml start` use canton sandbox by default
  * changed the non-ledger api ports to use free ports by default
    (still haven't tried using port 0 instead of `getFreePort`).
* renamed `daml sandbox-canton` to `daml sandbox`
* implement a `--static-time` option for `daml sandbox` that sets the
  canton clock type parameter to `sim-clock`
* moved the quickstart-java integration test to use the new sandbox
  * the test uses `--static-time`, but doesn't really depend on it

changelog_begin
changelog_end

* fix parens

* fix hot reload test

* reinstant --sandbox-kv in create-daml-app test for now

* fix damlStart test
2022-01-18 09:10:58 +00:00
Moritz Kiefer
29ba8e6433
Drop sandbox classic from the SDK tarball (#12410)
🔥

changelog_begin
changelog_end
2022-01-17 11:40:25 +00:00
Sofia Faro
a0aee0f248
Rename daml sandbox to daml sandbox-kv (#12394)
* Rename daml sandbox to daml sandbox-kv

Also drop the default sandbox on `daml start`

Part of #11831

changelog_begin
changelog_end

* update release test instructions

* try to fix a couple compat tests

* dont need special 0.0.0 logic

* buildifier-fixx
2022-01-17 10:36:06 +00:00
Moritz Kiefer
2005068e3e
Drop platform-version support from daml.yaml (#12397)
* Drop `platform-version` support from `daml.yaml`

Doesn’t work properly with Canton sandbox, nobody uses it and product
agreed to deleting it.

changelog_begin
changelog_end

* drop run-platform-jar

changelog_begin
changelog_end

* fix run-jar commands

changelog_begin
changelog_end
2022-01-13 16:32:24 +00:00
Sofia Faro
09013eb501
Add eager timeouts to the polling functions used in daml start and assistant integration tests. (#12361)
* Add timeouts to polling funcs in daml start.

This PR adds timeouts to some polling functions used in daml start and
the assistant integration tests, and also early exits based on a process
exit status. E.g. waitForHttpServer will make sure some process is
still running, instead of waiting to timeout.

The effect of this is that now whenever there is some error in a
subprocess, daml start and the integration tests will finish early
instead of running forever (or timing out in bazel).

changelog_begin
changelog_end

* missing a readPortFile instance
2022-01-12 10:01:56 +00:00
Sofia Faro
ca33990005
Use canton port file in daml start and tests. (#12324)
changelog_begin
changelog_end
2022-01-10 15:14:54 +00:00
Sofia Faro
8fdc871048
Make daml start integration tests use canton. (#12292)
* Make daml start integration tests use canton.

(Haven't fixed the hot reload test yet.)

changelog_begin
changelog_end

* remove vestigial message

* re-enable hot reload tests for sandbox-kv
2022-01-07 10:13:57 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Sofia Faro
830497ae34
Add --sandbox-canton option in daml start (#12192)
* --sandbox-canton option for daml start

changelog_begin
changelog_end

* hlint

* Move getFreePort to da-hs-base

* Use flag' not switch
2021-12-21 12:39:11 +00:00
Stefano Baghino
42adfdc857
Get rid of deprecated components (#12167)
* Get rid of deprecated components

Removes:
- mentions of the Node.js bindings
- mentions of the Scala bindings
- usage of the Scala codegen as an SDK tool
- Java bindings "reactive components"

changelog_begin
The Node.js bindings are no longer supported as part of the Daml SDK
The Scala bindings are no longer supported as part of the Daml SDK
The Java bindings reactive components are no longer supported as part of the Daml SDK
The `daml codegen` command has dropped support for Scala
changelog_end

* Fix typo noticed by @cocreature

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Address https://github.com/digital-asset/daml/pull/12167#issuecomment-995714093

* Remove quickstart-scala from the SDK tarballs

* Fix failing codegen test

* Address https://github.com/digital-asset/daml/pull/12167#pullrequestreview-833991243

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-12-16 16:55:19 +00:00
Sofia Faro
8b05a533ce
Refactor daml start options, add true/false to yes/no/auto flags. (#12169)
* Refactor daml start & add true/false to yesNoAuto.

- Refactor the way we pass arguments to daml start. We were relying on
  positional arguments with newtypes, but this is super cumbersome. I
  changed it to a RecordWildCards-style approach, where we don't need
  quite so many newtypes, and no more positional arguments.

- "--start-navigator" flag had some custom logic to accept "true" and
  "false". I don't see why we can't just accept "true" and "false"
  anywhere we use the "yes/no/auto" flags, so I just changed that and
  got rid of the custom logic.

- The way "auto" was handled for this flag was incorrect, since "auto"
  is supposed to be equivalent the default, i.e. not passing any
  flag. I changed it so auto is equivalent to not passing an argument.
  (I.e. it looks in daml.yaml for the start-navigator option).

changelog_begin
changelog_end

* dont pass in shutdownStdinClose to runStart
2021-12-16 14:40:36 +00:00
Moritz Kiefer
132c277bda
Add a Canton sandbox to the SDK (#11881)
This is only the first step so we have something to use in tests,
eventually `daml sandbox` should map to this Sandbox.

part of #11831

changelog_begin
changelog_end
2021-11-26 11:27:41 +01:00
Moritz Kiefer
63d855f202
Pass damlc build logs through daml logger (#11485)
* Pass `damlc build` logs through daml logger

This gives us some timings which can be useful in some
circumstances (I want timings around data-dependencies next).

I also changed the default log level to INFO. The `damlc build` output
doesn’t get any noisier from that.

Example output:

```
2021-11-01 15:25:17.16 [INFO]  [build]  []
Compiling foobar to a DAR.

2021-11-01 15:25:17.80 [INFO]  [build]  []
Created .daml/dist/foobar-0.0.1.dar
```

changelog_begin
changelog_end

* Adjust scenario service log level

changelog_begin
changelog_end

* Adjust tests

changelog_begin
changelog_end

* delete comment

changelog_begin
changelog_end
2021-11-02 12:10:09 +00:00
Moritz Kiefer
cb1fb6f7bf
Reuse sandbox & JSON API across daml ledger tests (#11214)
Speeds them up by more than 2x and reduces flakiness. I also added a higher
timeout to the allocate party call since that seems to still be
sometimes too slow if lots of things run in parallel.

changelog_begin
changelog_end
2021-10-13 11:19:44 +02:00
John Sullivan
7a4963b43d
add --max-inbound-message-size flag to daml ledger export (#11087)
Add support for `--max-inbound-message-size` flag to the [Ledger Export](https://docs.daml.com/tools/export/index.html) tool.

CHANGELOG_BEGIN

- [Daml Assistant] Add support for `--max-inbound-message-size` flag to the Ledger Export tool.

CHANGELOG_END
2021-09-30 12:17:53 +02:00
Robin Krom
87ecf1fe63
daml-ledger: better errors for non-json responses. (#11055)
This fixes #10985.

CHANGELOG_BEGIN
CHANGELOG_END
2021-09-29 11:46:54 +02:00
Moritz Kiefer
04f322e2aa
Bump resources for daml-ledger tests (#10984)
changelog_begin
changelog_end
2021-09-22 13:11:14 +00:00
Moritz Kiefer
b748fd6b67
Support TLS in Daml Helper --json-api requests (#10709)
This PR accepts the --tls flag but rejects the flags to set certs
because those don’t really make sense here (or are at least not easily
settable).

Unfortunately no great way to test this without a huge amount of test
infrastructure to setup a custom TLS reverse proxy for tests.

If someone has an idea to add a reasonable test, I’m all ears.

changelog_begin

- [Daml Assistant] The `daml ledger` commands now accepts `--tls` in
  combination with `--json-api` to access a JSON API behind a TLS
  reverse proxy.

changelog_end
2021-09-01 08:45:42 +02:00
nicu-da
7cc698948c
Add multiple ways of specifying deduplication [KVL-1047] (#10601)
CHANGELOG_BEGIN
ledger-api - Command deduplication period can now be specified by setting `deduplication_offset` instead of `deduplication_time` (only valid for v2 WriteService). This change is backwards compatible.
CHANGELOG_END

* Propagate the enriched deduplicationPeriod instead of deduplication duration

* Update the Haskell bindings for the new deduplication period

* Calculate the deduplicateUntil using the new deduplication period for backward compat

* Use consistent naming for deduplication_period

* Cleanup command timeout extraction from deduplication period

* Add the required deduplication_offset to deduplication instead of deduplication_start

* Update haskell bindings to support deduplication_offset

* Add support for deduplication_offset in the ledger-api

* Remove the timestamp-based deduplication from our models to simplify upgrade for users

* Add optional conformance test for offset based deduplication

* Remove buf rule for FIELD_SAME_ONEOF as our change is backwards compatible

* Disable FIELD_SAME_ONEOF buf check for commands file

* Apply suggestions from code review

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

* Update comment for deduplication period

Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2021-08-25 05:58:03 -07:00
Moritz Kiefer
34fa5a0a7c
Support running daml navigator without a config file (#10532)
No reason to force the existence of a config file if you can start
without one.

fixes #10516

changelog_begin

- [Navigator] Navigator will now start with an empty config if no
config file exists and it is run outside of a project.

changelog_end
2021-08-10 11:15:55 +00:00
nicu-da
35641b7f62
Add submission id to the GRPC api [KVL-999] (#10467)
* Add optional submission id to commands.proto

This allows to propagate a submission id. If no id is submitted (the submission id is empty) then we generate a new submission id

CHANGELOG_BEGIN
Add optional submission_id to the commands.proto.
CHANGELOG_END

* Update haskell bindings to include the submission id

* Code review - rename submission id extractor

* Code review - update comment and remove braces from if block

* Fix braces
2021-08-06 08:54:54 +02:00
Moritz Kiefer
88c83ec476
Mark //daml-assistant/daml-helper:test-deployment as flaky (#9769)
Fails a bit too often to waste people’s time with restarts.

changelog_begin
changelog_end
2021-05-21 09:57:19 +02:00
Andreas Herrmann
98d97e11ff
Don't duplicate export script option parsing (#9432)
* Don't duplicate export script option parsing

Forward all flags to the wrapped executable instead of handling them in
daml-helper with optparse-applicative.

changelog_begin
changelog_end

* Fix hlint warning

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-04-16 13:53:10 +00:00
Andreas Herrmann
5e652bb2f8
Add daml export script command to Daml assistant (#9414)
* rename "dump" to "export"

* Add Daml export command to assistant

* Make daml export script a subcommand of daml export

* daml-assistant IT for daml export script

* Expose export as daml ledger command (hidden for now)

Add Haskell side parser for ledger export flags

changelog_begin
* [Daml export] New feature: Use ``daml ledger export script`` to
  generate a Daml script that will reconstruct a given ledger state.
  This is an early access feature.
changelog_end

* Update integration test

* Remove daml export - it's daml ledger export now

* integration-test set ledger port

The integration tests don't configure the port in the project config,
but on the command-line, and they don't use the default value.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2021-04-16 10:53:49 +00:00
Robin Krom
f84b6abc05
daml build: add a --access-token-file for remote dependencies (#9358)
* daml build: add a --access-token-file for remote dependencies

This adds a `ledger.access-token-file` field in the `daml.yaml` project
file and a `--access-token-file` flag to `daml build` to authorize
querying/fetching of remote dependencies.

CHANGELOG_BEGIN
[daml build] A new flag `--access-token-file` is added for the `daml
build` command. It allows the specify the path to an access token to
authenticate against the ledger API. This is needed if the project
depends on a remote Daml package hosted on such a ledger. Alternatively,
the path to the token can also be specified in the `daml.yaml` project
file under the `ledger.access-token-file` field.
CHANGELOG_END
2021-04-08 23:20:52 +02:00
Robin Krom
2b1f882a9d
daml-ledger: new list-packages command (#9325)
Fixes #9196.

This adds a new command `daml package list` which fetches all
available packages from the ledger and prints package name/versions to
stdout.

CHANGELOG_BEGIN
[daml packages] A new `daml packages list` command has been added to
list packages deployed on a remote Daml ledger.
CHANGELOG_END
2021-04-07 13:23:56 +02:00
Robin Krom
4d0c6dbb6b
daml ledger: better error messages for missing host/port args (#9322)
Fixes #9187.

Instead of `daml: Must be called from within a project` you will get now
`daml: This command needs to be either run from within a project  or the argument --host needs to be specified.`

CHANGELOG_BEGIN
CHANGELOG_END
2021-04-06 15:06:24 +00:00
Robin Krom
b4bda47e7d
remote pkgs: resolve package names in data dependencies via ledger (#9270)
* remote pkgs: resolve package names in data dependencies via ledger

This implements part 3) of #8976.

This adds the ability to specify package names/versions in daml.yaml in
the data-dependencies stanza. They are being resolved via the project
ledger and a daml.lock lock file.

CHANGELOG_BEGIN
  [remote dependencies] Package names and versions, as well as package
  ID's are allowed in the `data-dependencies` list of `daml.yaml`. These
  packages are fetched from the project ledger. The auto-generated
  `daml.lock` file keeps track of the package name/version to package
  ID's resolution and should be checked in to version control of the
  project.
CHANGELOG_END

* added docs

* Update compiler/damlc/lib/DA/Cli/Damlc/DependencyDb.hs

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/daml/reference/packages.rst

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* suggestions

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2021-03-31 15:37:36 +02:00
Moritz Kiefer
615f4e4bae
Support passing sandbox port via --sandbox-option --port (#9208)
--sandbox-port has caused confusion several times and cannot be
specified in daml.yaml which is a bit annoying. There isn’t really any
good reason not to support --sandbox-option --port since we can pick
up the port via the port file either way.

This change is fully backwards compatible.

changelog_begin

- [Daml Assistant] The sandbox port can now also be configured via
  `--sandbox-option=--port=12345` instead of `--sandbox-port`. Other
  tools like Navigator, the JSON API and Daml Script will pick up the
  modified port automatically.

changelog_end
2021-03-23 13:31:07 +01:00
Robin Krom
f89aa294e5
damlc pkg: use cache for already present packages (#9193)
* damlc pkg: use cache for already present packages

This only downloads packages from a remote ledger, if the package is not
already present in the dependency db as a normal dependency.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-22 13:57:38 +01:00
Robin Krom
8c64f120da
pkgid data deps (#9153)
* damlc: Allow package IDs in data-dependencies.

This is the next step outlined in issue #8976. If package id's are
present in the `data-dependency` section of the daml.yaml file, we try
to fetch them (and their transitive dependencies) from the default
ledger of the project.

CHANGELOG_BEGIN
CHANGELOG_END
2021-03-18 12:17:38 +01:00
Robin Krom
55b52f1249
daml start: less scary colors for rebuild message (#8929)
We change the color from red to yellow to inform about the possibility
to rebuild and also output the success message in green.

CHANGELOG_BEGIN
CHANGELOG_END
2021-02-24 11:32:59 +01:00
Moritz Kiefer
e0c5abd647
Switch to GHC 8.10.3 (#8394)
* Switch to GHC 8.10.3

changelog_begin
changelog_end

* Update bazel-haskell-deps.bzl

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Comment on rules_haskell patch

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2021-01-25 11:53:53 +00:00