Commit Graph

3678 Commits

Author SHA1 Message Date
Remy
c76e0bc1e0
DAML-LF add support for generic comparison in archive (#4983)
* DAML-LF: add generic comparison to archive
2020-03-13 20:13:13 +01:00
Leonid Shlyapnikov
5c2ed56c8e
Allocate party JSON API endpoint (#4991)
* Allocate party JSON API endpoint

changelog_begin

[JSON API - Experimental]
Allocate party endpoint added: ``/v1/parties/allocate``. See #4638.

changelog_end

* cleanup

* Update ledger-service/http-json/src/main/scala/com/digitalasset/http/LedgerClientJwt.scala

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-03-13 14:06:08 -04:00
Stephen Compall
0cb3541666
optional offset argument to WebSocket streams (#4819)
* capture the pattern of an optional stream input prefix

* allow LiveBegins to be appended

- should have been included with #4593

* StreamQuery will parse JsValues instead of Strings

* shortcut in HttpServiceTestFixture; clean up InsertDeleteStepTest

* compatibly add withOptPrefix stage to WS input

* parsing the offset argument

* add offset parsing to input stream, but drop it on the floor

* another form of the two cases

* percolate the starting offset to the next step

* percolate the starting offset to the next step

* percolate the starting offset to the next step

* use transactionsFollowingBoundary in ContractsService if begin offset specified

* integration test for scan from offset in WS query

* tool for catching the first offset in a stream

* documentation

* add changelog entry

CHANGELOG_BEGIN
- [JSON API - Experimental] WebSocket endpoints now support an optional offset argument.
  See `issue #4509 <https://github.com/digital-asset/daml/issues/4509>`_.
CHANGELOG_END

* move offset argument doc to later

- suggested by @hurryabit; thanks

* remove stray TODO

- pointed out by @leo-da; thanks

* redesign withOptPrefix to make the usage a little easier to follow

- suggested by @leo-da; thanks
2020-03-13 12:52:17 -04:00
Gary Verhaegen
364262a7f6
saner scalafmt target (#4985)
The current behaviour of our scalafmt checks compares for changes with
origin/master, which means it is dependent on the state of the local git
repository. This makes it non-reproducible.

Added to the fact that the master branch is not currently green as per
our scalafmt rules, this makes it impossible to rebuild older commits,
which in turn could interfere with our release process.

This PR does two things:

1. Fix our codebase to agree with our formatting rules.
2. Add a flag to `fmt.sh` to enable scalafmt's diff behaviour, and
   change the default to a full scan.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 17:37:13 +01:00
Shayne Fletcher
0db2273a53
Make it so you can run in a known location (#4989)
changelog_begin
changelog_end
2020-03-13 12:12:22 -04:00
Stefano Baghino
e66500173d
Add data access objects for the new transaction schema (#4988)
This PR only covers the write path, the read path will be addressed in a follow-up.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 17:04:12 +01:00
Andreas Herrmann
559c78003e
Update rules_haskell (#4751)
* Update rules_haskell

The workaround for linking against `Cffi` in the REPL has been
upstreamed in a more generalized form.

CHANGELOG_BEGIN
CHANGELOG_END

* ghcide: Use rules_haskell's hie-bios support

* Document `ghcide` Bazel integration

* Rename files to match module names

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-13 16:49:34 +01:00
Nemanja
05403da7d3
GSG info on restarting the ledger and making changes (#4968)
* GSG info on restarting the ledger and making changes

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/source/getting-started/first-feature.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/getting-started/first-feature.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Changed the explanation for why we need to run './daml-start.sh' again

* Update docs/source/getting-started/first-feature.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/getting-started/first-feature.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/getting-started/first-feature.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-13 16:48:01 +01:00
Nemanja
ce54e1392d
Explaining the DAML code in GSG (#4987)
* Explaning the DAML code in GSG

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/source/getting-started/app-architecture.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/getting-started/app-architecture.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/getting-started/app-architecture.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update docs/source/getting-started/app-architecture.rst

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-13 16:47:47 +01:00
Nemanja
90033b05c4
Linking TS API documentation in the GSG (#4961)
* Linking TS API documentation in the GSG

* Changelog entry

CHANGELOG_BEGIN
CHANGELOG_END

* Changed the links to point to our own docs
2020-03-13 16:47:33 +01:00
Nemanja
17f6ec0839
Yarn information for the GSG docs (#4920)
* Solves #4841

* Added info for successfull daml-start.sh script run

* fix syntax

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-13 16:47:12 +01:00
Nemanja
ff926d0a0f
TypeScript lexer for TS syntax highlighting (#4900)
* Resolves #4304

Added highlighting to the application architecture section

Highlighter that works

The latest highlighter

* Added the lexer to pdf and html and restructured how conf.py is called within the theme

* Added copyright headers

* add typescript.py to srcs

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-13 16:46:23 +01:00
Moritz Kiefer
a15bfd80f3
Fix lf versions in the tests for buliding against newer LF versions (#4933)
This makes sure that they won’t break once we switch defaults. For
consistency they are specified via `build-options` everywhere.

changelog_begin
changelog_end
2020-03-13 16:27:54 +01:00
Moritz Kiefer
4e99f18613
Introduce a DA.Test.Sandbox module for managing sandbox in tasty (#4986)
We previously had 3 slightly different but consistently shitty logic
for handling this in the tests for daml-helper daml repl and the
Haskell ledger bindings. This PR introduces a module that is flexible
enough to capture all their needs and hopefully is somewhat less
shitty.

changelog_begin
changelog_end
2020-03-13 15:35:03 +01:00
Shayne Fletcher
33e384869a
Change code generation scheme for DAML enums (#4975)
changelog_begin
changelog_end
2020-03-13 09:30:52 -04:00
Bernhard Elsner
757e0e841b
Remove references to DA Ledgers, DA Platform and similar from docs (#4690)
* Remove references to DA Ledgers, DA Platform and similar from docs

* Some additional amendments

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 13:02:11 +01:00
Moritz Kiefer
b3a5c3b28d
Share test certificates (#4982)
* Share test certificates

This is primarily an attempt at making sure my contribution stats
remain negative but I think it’s a nice cleanup. The only difference
in the certs used by daml-helper which are now used everywhere is that
they use a different CN for the CA and the server. This is required to
make openssl happy (which is used by the daml-helper).

changelog_begin
changelog_end

* Fix script and trigger tests
2020-03-13 12:12:34 +01:00
Remy
277883e4d5
DAML-LF: base GenMap on SortedMap (#4893)
Change underlying implementation of GenMap from insertion order Map to sorted Map

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 11:10:38 +01:00
Richard Kapolnai
d198f74d61
Fix ledgerId cli help message by removing note about persistent stores. (#4980)
* Fix ledgerId cli help message by removing note about persistent stores.

* format change
CHANGELOG_BEGIN
CHANGELOG_END

* Revert "format change"

This reverts commit 02e234df29.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-13 09:26:44 +00:00
Moritz Kiefer
96f62418c5
Support TLS in DAML script and DAML triggers (#4971)
This adds CLI parametrs for connecting via TLS following the scheme
used by navigator, extractor and `daml ledger`.

changelog_begin

- [DAML Script] Support TLS. Enable it by passing ``--tls``. You can
  set certificates for client authentication via ``--pem`` and
  ``-crt`` and a custom root CA for validating the server certificate
  via ``--cacrt``.

- [DAML Triggers - Experimental] Support TLS. Enable it by passing ``--tls``. You can
  set certificates for client authentication via ``--pem`` and
  ``-crt`` and a custom root CA for validating the server certificate
  via ``--cacrt``.

changelog_end
2020-03-13 09:54:44 +01:00
Leonid Shlyapnikov
bc7d76c9d7
Mark JSON API tests flaky, failing on Windows consistently (#4978)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 21:32:46 +00:00
Remy
65e988b778
[DAML-LF] specification for generic comparison. (#4942)
* [DAML-LF] specification for generic comparison.

+ update generic equality

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 22:07:13 +01:00
Remy
198973f23b
DAML-LF: introduce HexString to represents base16 array encoding (#4952)
* DAML-LF: introduce the string type HexString that represents base16 array encoding

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 22:04:36 +01:00
Robin Krom
b748f88fa2
language: docs: use typedoc comments for daml-react (#4977)
Using the correct typedoc comment form gives nice generated
documentation.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 21:54:33 +01:00
Gary Verhaegen
fd185ed22e
publish prerelease documentation (#4976)
This PR changes the documentation release process to publish the
documentation for releases tagged "prerelease" on GitHub, while
discarding them when deciding on the latest version (the one that shows
on `/` on the docs site) and omitting them from the `versions.json` file
(meaning they do not appear on the dropdown).

This PR also makes a bit of cleanup/bug fixing:
- The change in `nix` toolset name (#4724) needs to be protected by a
  version check, as we checkout older versions of the repo during docs
  build.
- The data types BlogSubmit and BlogId seem to have survived the "dead
  code detection" in #4956.
- The documentation build step had not been updated to pass down the
  correct version string (#4513).

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 18:54:47 +00:00
Robin Krom
f6936a6d6e
docs: fix: include html assets for generated docs (#4974)
The tar command in the bazel rule would not dereference links in the
documentation folder which let to missing assets. This is fixed with the
additional command line flag `-h` to tar.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 19:37:17 +01:00
Stefano Baghino
cc2e97ee51
Add functions to compute disclosure for different stream types (#4970)
* Add functions to compute disclosure for different stream types

CHANGELOG_BEGIN
CHANGELOG_END

* Address https://github.com/digital-asset/daml/pull/4970#pullrequestreview-373708955

* Optimize imports
2020-03-12 18:44:10 +01:00
Leonid Shlyapnikov
f69100a4d4
Fixing blinking tests, multiple heartbeats are expected, change heartbeat format, live marker is gone (#4969)
* Fixing tests, multiple heartbeats are expected, change heartbeat format

changelog_begin
changelog_end

* scalafmt
2020-03-12 12:49:15 -04:00
Moritz Kiefer
fdeac8d69c
Make extractor and navigator work without client auth (#4966)
This PR fixes the tls configuration to work if client auth is not
enabled and adds a `--tls` flag to extractor and navigator which
allows you to enable tls without overriding any certificates.

There is a test for extractor but none for navigator since there are
no tls tests at all afaict atm. I did however test it manually.

changelog_begin

- [Navigator] Navigator can now run a TLS enabled ledger without
  client authentication. You can enable TLS without any special
  certificates by passing ``--tls``.

- [Extractor] Extractor can now run a TLS enabled ledger without
  client authentication. You can enable TLS without any special
  certificates by passing ``--tls``.

changelog_end
2020-03-12 17:33:30 +01:00
Moritz Kiefer
edd73384c4
Make client authentication in Sandbox configurable (#4965)
Currently sandbox only supports TLS if you also enable client
authentication. There is no reason for why this has to be the case and
for things like DABL we want TLS without client authentication so it’s
useful to be able to test this in sandbox. This PR introduces a
`--client-auth` flag that allows you to configure the behavior. The
default is the current one of requiring client authentication.

This PR does not yet update Java clients, however, the Haskell client
supports this already and is used to test this functionality.

I’ve also added a section in the documentation on TLS (there were no
docs at all so far).

changelog_begin

- [DAML Sandbox] When Sandbox is run with TLS enabled, you can now
  configure the requirement for client authentication via
  ``--client-auth``. See
  https://docs.daml.com/tools/sandbox.html#running-with-tls for more information.

changelog_end
2020-03-12 16:04:46 +01:00
Stefano Baghino
1bf1a8e8e9
Add diff function between Relations (#4962)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 14:41:22 +01:00
Jussi Mäki
583c0a7749
Run most tests for ledger-dump (#4910)
We exclude the tests that create lots of data.
CommandDeduplicationIT is disabled as kvutils does not yet
have time-based deduplication.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 14:10:22 +01:00
associahedron
5b1698e553
Update packaging docs. (#4936)
* Update packaging docs.

changelog_begin
changelog_end

* Fix the code blocks

* Fix another code block

* Move comment so ordered list doesnt break.

* fix code blocks again???

* Apply suggestions from code review

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Make name collision section

* Incorporate feedback

* Small edit

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-12 12:33:53 +00:00
Moritz Kiefer
e0d652df91
Generate ssl certs in a genrule instead of checking them in (#4950)
changelog_begin
changelog_end

For now this is only used for the daml-helper tests. I’ll shuffle
things around and use it for all tests in a separate PR.
2020-03-12 10:36:40 +01:00
simonmaxen-da
4c55a67e38
Allow time for all nodes to see contract before executing (#4909)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-12 08:57:02 +01:00
Shayne Fletcher
cdc31ebe81
rename package 'build-and-lint' to 'build-and-lint-test' (#4957)
changelog_begin
changelog_end
2020-03-11 17:38:56 -04:00
Gary Verhaegen
872a5fc0df
do not send release notes to hubspot (#4956)
@bame-da wants a more manual process where he can control exactly when
release notes are posted, possibly in advance.

CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 21:41:46 +01:00
Robin Krom
254ee50b7c
docs: better readme's for ts libraries (#4954)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 21:35:42 +01:00
Leonid Shlyapnikov
19f5b86c79
Websocket stream to emit last seen offset instead of heartbeat message (#4886)
* Capture lastSeenOffset in the @volatile var

CHANGELOG_BEGIN
[JSON API - Experimental] Websocket stream now emits last seen offset instead of the heartbeat message.
``{"heartbeat": "ping"}`` is replaced by ``{"events":[],"offset":"<last seen offset>"}``. See #4510.
CHANGELOG_END

* updating docs

* moving the last seen offset into the stream, WIP

* adding in-stream state

* minor docs

* cleanup the heartbeat logic

* minot cleanup

* Change live and heartbeat msg handling + some debug logging (to be removed)

* fixing ts tests, cleaning up

* Adding todo with the reference to the follow-up ticket

* Adding todo with the reference to the follow-up ticket
2020-03-11 19:53:05 +00:00
Shayne Fletcher
901b28777e
Reduce repetition by reuse of 'modPath' (#4951)
* Reduce repetition by reuse of 'modPath'

changelog_begin
changelog_end

* Use intercalate not joinPath; import </> from FilePath.Posix

These two changes should remove any ambiguity about whether paths are
treated any differently on Windows vs 'nix.
2020-03-11 15:21:01 -04:00
Robert Autenrieth
d333d9e882
Add command deduplication changelog (#4944)
* Add command deduplication changelog

Fixes #4623

CHANGELOG_BEGIN
- [Sandbox] The command client is no longer idempontent with respect to duplicate
  submissions. Duplicate submissions now instead return an ALREADY_EXISTS error,
  consistent with the new deduplication mechanism of the submission client.
  See also `issue #4623 <https://github.com/digital-asset/daml/issues/4623>`_.
CHANGELOG_END

* Add changelog entry for command deduplication

Fixes #4623

CHANGELOG_BEGIN
- [Sandbox] The command client is no longer idempotent with respect to duplicate
  submissions. Duplicate submissions now instead return an ALREADY_EXISTS error,
  consistent with the new deduplication mechanism of the submission client.
  See also `issue #4623 <https://github.com/digital-asset/daml/issues/4623>`_.
CHANGELOG_END
2020-03-11 18:01:50 +00:00
Shayne Fletcher
793609fd04
client module import ideal syntax (#4946)
changelog_begin
changelog_end
2020-03-11 13:33:16 -04:00
Moritz Kiefer
ed5886051d
Support TLS in daml-helper (#4943)
This PR adds TLS support to DAML helper both via client certs and
without (although the latter is not tested so far since atm this is
not supported by sandbox). The CLI options follow the scheme used by
navigator/extractor/… with the addition that you can just pass `--tls`
which will turn on TLS without custom root certs or client certs.

changelog_begin

- [DAML Assistant] You can now connect to ledger via TLS for ``daml
  deploy`` and ``daml ledger`` commands. See
  https://docs.daml.com/deploy/generic_ledger.html for more information.

changelog_end
2020-03-11 17:58:05 +01:00
Andreas Herrmann
f3f39a23a3
daml-assistant tests: fix flaky test on Windows (#4945)
* daml-assistant tests: fix flaky test on Windows

```
bazel test //daml-assistant:test --test_arg=--quickcheck-replay=425714
```
failed on Windows in the test-case:
```
tail . ascendents == ascendents . takeDirectory
```
In that case the two path components given two the test case shrink to
`p1 = "a"` and `p2 = "\\"`. Confusingly, on Windows
```
isRelative "\\" == True
```
while
```
"a" </> "\\" = "\\"
```
This is documented behaviour on Windows, see [1] and [2].

Using `p1 </> p2 /= p2` instead of `isRelative p2` works around this.

[1]: https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:-60--47--62-
[2]: https://hackage.haskell.org/package/filepath-1.4.2.1/docs/System-FilePath-Posix.html#v:isRelative

* Fix ascendants test group name

`ascendants` is defined in `DA.Daml.Project.Util`, not
`DA.Daml.Assistant`.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-11 16:04:31 +00:00
Robert Autenrieth
3cc17c0253
Command client remove deduplication (#4783)
* Remove deduplication from command client

CHANGELOG_BEGIN
CHANGELOG_END

* Adapt tests for the new behavior
2020-03-11 16:27:29 +01:00
Shayne Fletcher
7634b7cfad
Do not require the user type '@' (#4939)
changelog_begin
changelog_end
2020-03-11 11:27:15 -04:00
Leonid Shlyapnikov
953d55f338
Replace AsyncWordSpec with WordSpec, thanks @rautenrieth-da, see #4938 (#4941)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 14:58:38 +00:00
Robert Autenrieth
42adfb1887
Fix tests not running with bazel test (#4938)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-11 15:15:02 +01:00
Robert Autenrieth
9216a68ad1
Don't read exclusive end in completions query (#4899)
* Don't read exclusive end in completions query

CHANGELOG_BEGIN
CHANGELOG_END

* Store offsets directly and do +1 only on read side

* Fix existing completions

* Add test for the completion service

Co-authored-by: Gerolf Seitz <gerolf.seitz@digitalasset.com>
2020-03-11 14:10:32 +00:00
fabiotudone-da
e4ce69ea58
Rename EC auth cmdline options in line with the standard and document them. (#4930)
* Rename EC auth cmdline options in line with the standard and document them.

CHANGELOG_BEGIN
CHANGELOG_END

* 📝 Fix doc

* Auth docs: change `RSA DSA` -> `RSA Signature` (clashed with DSA algo)

As proposed by @SamirTalwar-DA

CHANGELOG_BEGIN
[Sandbox] Rename the `--auth-jwt-ec256-crt` command line option to `--auth-jwt-es256-crt` as well as `--auth-jwt-ec256-crt` to `--auth-jwt-es256-crt` and fix their docs
CHANGELOG_END
2020-03-11 13:18:47 +00:00