Commit Graph

941 Commits

Author SHA1 Message Date
Robin Krom
36c267f422
added a section on extending daml models (#8093)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-27 16:03:22 +01:00
Samir Talwar
9976b4cd50
Bazel: Factor out logic around Protobuf JARs. [KVL-714] (#8084)
* kvutils: Use ScalaPB to generate a Scala JAR for daml_kvutils.proto.

* Bazel: Delete the unused `da_java_binary` rule, and inline `_wrap_rule`.

* Bazel: Factor out Java/Scala protobuf class generation into a helper.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/archive: Use `proto_jars`.

* Bazel: Remove the visibility modifier from `proto_jars`.

It's too confusing. Just make everything public.

* daml-lf/archive: Push protobuf source tarballs into `proto_jars`.

* Bazel: Add comments to the various parts of `proto_jars`.

* daml-assistant: Do unpleasant things with `location` in Bazel.
2020-11-27 08:34:53 +00:00
Richard Kapolnai
de498e4b0c
Add party management service to the services page, targeting #8027. (#8075)
* Add party management service to the services page, targeting #8027.
CHANGELOG_BEGIN
CHANGELOG_END

* rephrase to make it more compact

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* remove unnecessary note

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* remove unnecessary note

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* remove blank line

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-11-26 14:51:08 +01:00
Gary Verhaegen
8dba45a478
minor docs edits (#8073)
A question on discuss prompted me to read this page, and I spotted a
couple typos.

As a side note, I find references to DAML-LF versions unhelpful. I don't
think it's fair to expect our users to know the mapping between DAML
versions and DAML-LF versions.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-26 10:57:53 +00:00
Richard Kapolnai
239f4df945
Link concepts "gRPC Ledger API" and "Ledger API" in glossary for #8029. (#8051)
* Link concepts "gRPC Ledger API" and "Ledger API" in glossary for #8029.
CHANGELOG_BEGIN
CHANGELOG_END

* remove gRPC Ledger API which was in the wrong place

* rephrase alternative names

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-11-25 16:28:33 +01:00
Robin Krom
a0ccfdb80e
docs: improve upgrade docs (#8047)
This addresses feedback on the upgrade documentation. We switch the
example from coins to carbon certificates and add a section for the
centralized database case to make the base case clear.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-25 15:24:57 +01:00
Richard Kapolnai
f3caa5919d
rename "gRPC API" to "gRPC Ledger API" (#8046)
* rename "gRPC API" to "gRPC Ledger API"
an incremental step towards #8029
changelog_begin
changelog_end

* fix section underline
2020-11-24 16:34:07 +01:00
Richard Kapolnai
57e0b065ad
Fix typo in json-api docs (#8045)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-24 10:46:02 +01:00
Richard Kapolnai
34d7429147
fix section link in docs (#7850)
changelog_begin
changelog_end
2020-11-20 08:42:24 +00:00
Richard Kapolnai
db08959811
Topology documentation: refine "serving the API" (#7971)
* concretize item on "serving the API"
CHANGELOG_BEGIN
CHANGELOG_END

* Revert "concretize item on "serving the API""

This reverts commit 83e35114c4.

* change authentication to authorization

* remove "etc." to make item clearer
2020-11-19 14:49:02 +01:00
Shaul Kfir
2b9bc2b8bf
Minor improvements to getting started doc (#7854)
* Minor improvements to getting started doc

* add empty changelog

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-11-19 09:42:22 +00:00
nickchapman-da
6a745ed1fa
Support choice observers in 1.dev (#7922)
* Adapt to new desugaring for choice observers.

update hash of ghc patch.

changelog_begin
changelog_end

update ghc patch to final version

update stack-snapshot hashes for ghc-lib(-parser)

update stackage_snapshot.json, following `bazel run @stackage-unpinned//:pin`

expose Optional constructors for desugared code to use

adapt LFConversion to expect a 4-tuple for a desugared choice def/sig

update LFConversion for choice-observers

first example using new choice observer syntax.

fix scala type checker to have correct scoping rules for choice-observers

remove comment from example which says it is broken

improve variable names

improve tests for choice-observer clause

only test choice-observers SINCE 1.dev

add jq queries for choice observeres

make positive statement in jq test which checks choice obserers are present

test behaviour of choice observers

squash me

typo

* test more choice-observer divulgence

* Update documention for choice observers.

changelog_begin
Support choice observers in 1.dev
changelog_end

* fix docs build

* fix daml docs choice-observers example

* address comments: rewording text

* annotate choices observers as early-access in documention

* split out documentation code-snippets which require --target=1.dev

* final tweaks to documentation text
2020-11-18 19:51:15 +00:00
Richard Kapolnai
831ed8bdfc
doc: rename user to party (#7985)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-17 14:47:21 +00:00
Stephen Compall
ac8cffd98f
document name mangling from DAML to DAML-LF (#7976)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-17 09:20:14 -05:00
Moritz Kiefer
10792ed6fd
Make application ID configurable in trigger service (#7974)
* Make application ID configurable in trigger service

fixes #7671

changelog_begin

- [Trigger Service] The application id used by a trigger can now be
  configured by an optional `applicationId` in the start request.

changelog_end

* Update triggers/service/src/main/scala/com/digitalasset/daml/lf/engine/trigger/Server.scala

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

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2020-11-17 10:25:30 +01:00
Sofia Faro
f7e096afc3
Make GHC recognise our ($) operator. (#7969)
* Make GHC recognise our ($) operator.

Fixes #4555 by moving ($) to GHC.Base and giving it a levity polymorphic
signature, as GHC expects. Added a regression test.

changelog_begin
changelog_end

* Update line numbers for debug...

* Fix `daml test-script` tests

changelog_begin
changelog_end

* fmt for the format gods

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-11-16 15:10:14 +00:00
Moritz Kiefer
dbf28e0794
Revamp trigger status endpoint (#7961)
* Revamp trigger status endpoint

fixes #7951

The previous endpoint was a memory leak, nothing got persisted across
restarts and it omitted useful information like the metadata of the
trigger. The information is useful for testing, so I abstracted over
it so we can do what we did before in testing.

As for the endpoint, it now queries the actor for its current status
and only returns that and includes the metadata in the response.

As mentioned in #7951, I do think there is value in some kind of
history and potentially something including trace statements but I’d
like to do that properly instead of the hacky thing we have atm.

changelog_begin

- [Trigger Service] The trigger status endpoint /v1/triggers/:id now
  includes metadata about the trigger like the party and the trigger
  id. The logs field has been replaced by a status field.

changelog_end

* Fix ACS query test

changelog_begin
changelog_end
2020-11-13 15:59:34 +01:00
Richard Kapolnai
ea44ddec4c
fix backtick rendering errors in docs (#7962)
CHANGELOG_BEGIN
CHANGELOG_END
2020-11-13 15:08:20 +01:00
Moritz Kiefer
1dcfca11d7
Include listKnownParties in DAML Script docs (#7955)
* Include listKnownParties in DAML Script docs

Ratko pointed out that this can often be useful in demo scenarios so
we might as well include it while documenting the caveats. I’ve also
added some subheadings since this got a bit out of hand.

changelog_begin
changelog_end

* Fix tests

changelog_begin
changelog_end
2020-11-13 07:43:56 +00:00
Moritz Kiefer
07d5a19d50
Cleanup trigger service endpoints (#7950)
* Cleanup trigger service endpoints

fixes #6333

changelog_begin

- [Trigger Service]

  Endpoints have been rearranged to be more consistent:

  | New endpoint              | Old endpoint       | Functionality                |
  |---------------------------|--------------------|------------------------------|
  | GET `/v1/triggers`        | `/v1/list`         | List triggers                |
  | POST `/v1/triggers`       | `/v1/start`        | Start trigger                |
  | GET `/v1/triggers/:id`    | `/v1/status/:id`   | Trigger status               |
  | DELETE `/v1/triggers/:id` | `/v1/triggers/:id` | Stop/delete trigger          |
  | POST `/v1/packages`       | `/v1/upload_dar`   | Upload DAR                   |
  | GET `/livez`              | `/v1/health`       | liveness check               |

changelog_end

* Fix integration tests

changelog_begin
changelog_end
2020-11-12 11:23:28 +01:00
Robin Krom
c852a42455
docs: update the insaller instructions for PATH (#7933)
The PATH variable is now set automatically by the Mac OS/Linux
installers.

CHANGELOG_BEGIN
CHANGELOG_END
2020-11-11 13:24:09 +01:00
Brian Healey
08e1dc34ef
Replace com.digitalasset.platform with com.daml.platform (#7912)
* com.digitalasset.platform --> com.daml.platform in logbacks

* correct some broken running scala test examples

* correct com.digitalasset.platform broken links

CHANGELOG_BEGIN
Correct some remaining package name references to
com.digitalasset.platform in logback and readme file
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>
2020-11-05 19:27:24 -05:00
Bernhard Elsner
5629032dbe
Improve Ledger API versioning docs (#7865)
* Improve Ledger API versioning docs

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/source/support/compatibility.rst

Co-authored-by: Kamil Bożek <72492440+kamil-da@users.noreply.github.com>

Co-authored-by: Kamil Bożek <72492440+kamil-da@users.noreply.github.com>
2020-11-03 10:42:09 +00:00
Moritz Kiefer
a74a1c15f4
Add healthcheck endpoints to JSON API (#7852)
* Add healthcheck endpoints to JSON API

This PR adds /livez and /readyz (following k8s naming scheme) that can
be used as liveness and readyness check. There isn’t much we can do
for liveness apart from showing that we can still respond to http
requests but readyness can be a bit more clever and check the ledger
connection as well as the database connection.

changelog_begin

- [JSON API] Add `/livez` and `/readyz` health check endpoints for
  easier integration with k8s and other schedulers.

changelog_end

* I hate windows

changelog_begin
changelog_end
2020-11-02 18:41:49 +01:00
Richard Kapolnai
258a96ea7e
fix formatting italics in docs (#7832)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-28 14:34:24 +01:00
Kamil Bożek
9a2317cbdb
API version service [KVL-541] (#7792)
This change exposes a new endpoint with information about the ledger API version.
The current approach is to read contents of ledger-api/VERSION and provide it as it is to the user.

CHANGELOG_BEGIN
- ledger API version endpoint
CHANGELOG_END
2020-10-27 17:47:44 +01:00
Bernhard Elsner
1478669e2d
Amend docs to introduce the concept of DAML Connect (#7813)
* Amend docs to introduce the concept of DAML Connect

CHANGELOG_BEGIN
CHANGELOG_END

* Slightly change how Sandbox is positioned in the app-arch

* Mention integrated drivers in app arch docs

* Lowercase DAML network
2020-10-27 16:13:53 +00:00
Bernhard Elsner
c20bd82f47
Improve support statement in docs (#7729)
* Improve support statement in docs

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback

* Rename the last minor version "terminal"

* Lowercase drivers

* Incorporate Derek's Feedback
2020-10-27 15:52:39 +00:00
Bernhard Elsner
1c8c6deef4
Remove references to 0.X SDK releases (#7814)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-27 15:12:24 +01:00
Gary Verhaegen
ebde049cc6
@daml/react: support for multi-{key,query} streams (#7789)
This follows up on #7066 and exposes the new underlying multi-key and
multi-query stream functions through the React bindings. Following the
same reasoning as in #7066, we therefore deprecate the existing
functions (with no intention of removing them) as they become redundant.

CHANGELOG_BEGIN
* JavaScript Client Libraries: Updated React bindings to expose the
  recent addition of multi-key and multi-query streams in @daml/ledger.
  The singular versions are marked as deprecated as they have become
  redundant.

  The upgrade path for `useStreamQuery` is very straightforward: the
  query factory remains optional, but if specified it should return an
  array of queries instead of a single query. The array may be empty,
  which will return all contracts for that template (similar as not
  passing in a query factory). The return values of `useStreamQuery` and
  `useStreamQueries` are the same type.
  ```
  useStreamQuery(T) --> useStreamQueries(T)
  useStreamQuery(T, () => query, ...) --> useStreamQueries(T, () => [query], ...)
  ```

  The upgrade path for `useStreamFetchByKey` is only slightly more
  involved as the return type of `useStreamFetchByKeys` is a new type
  called `FetchByKeysResult` instead of the existing `FetchResult`.
  `FetchByKeysResult` differs from `FetchResult` in that it contains a
  `contracts` field with an array of contracts instead of a singular
  `contract` field. (It differs from `QueryResult` in that each element of
  the returned array can also be `null`, if there is no corresponding
  active contract.) Call sites can be updated as follows:
  ```
  const {loading, contract} = useStreamFetchByKey(T, () => k, ...);

  -->

  const {loading, contracts} = useStreamFetchByKeys(T, () => [k], ...));
  const contract = contracts[0];
  ```
CHANGELOG_END
2020-10-23 14:40:20 +02:00
Bernhard Elsner
df1dee2397
Replace occurrances of DAML SDK in the docs with appropriate new terms (#7739)
* Replace occurrances of DAML SDK in the docs with appropriate new terms

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

Revert two renamings.

* Fix broken internal link
2020-10-21 12:03:00 +00:00
Moritz Kiefer
9da86a602e
Relax restrictions on JWTs on write endpoints in JSON API (#7712)
The previous restriction was both too lax and too strict now that we
have multi pary queries:

1. It allowed a party in `readAs` for command submissions which just
   fails on the ledger side. Changing this is technically breaking but
   only if you used a token that would have been rejected as soon as you
   enabled auth so that seems very resonable to break.

2. It didn’t allow extra parties in `readAs`.

This PR switches to requiring exactly one party in `actAs` while
supporting multiple parties in `readAs`.

changelog_begin

- [JSON API] JWTs on command submissions can now contain extra parties
  in the `readAs` field. `actAs` is still limited to a single party.

changelog_end
2020-10-20 19:37:44 +02:00
mzagorski-da
0de3b5a6bf
ledger-api-test-tool cmd line option to skip dar upload (#7732)
CHANGELOG_BEGIN
- [ledger-api-test-tool] Introduced new cmd line argument skip-dal-upload see `docs <https://docs.daml.com/tools/ledger-api-test-tool/index.html>`__.
CHANGELOG_END
2020-10-20 13:22:18 +02:00
Richard Kapolnai
1eaffb4e04
fix formatting italic in docs (#7730)
CHANGELOG_BEGIN
CHANGELOG_END
2020-10-19 12:42:51 +02:00
Nemanja
6a452c184f
Positioning the 'Next' buttonn so it doesn't overlap with other elements (#7716)
* Positioning the 'Next' buttonn so it doesn't overlap with other elements

* CHANGELOG_BEGIN
CHANGELOG_END
2020-10-16 18:42:33 +02:00
Moritz Kiefer
886d3ec358
Clarify recommended backend for JSON API (#7699)
changelog_begin
changelog_end
2020-10-15 16:37:10 +02:00
Stephen Compall
6d39ac6984
allow updating user state from high-level trigger rule (#7674)
* allow updating user state from high-level trigger rule

* fix tests and examples for new rule signature

* fix doc for new rule signature

* add changelog

CHANGELOG_BEGIN
- [Triggers] ``rule`` can now ``get`` and ``put`` the user-defined state just
  like ``updateState`` does.  It no longer accepts the state as an argument.
  You can port your rule function types by replacing ``s -> TriggerA`` with
  ``TriggerA s``, removing the last argument from the function, and using
  ``get`` to retrieve the state at the beginning of the ``rule``'s ``do`` block,
  if needed.
  See `issue #7674 <https://github.com/digital-asset/daml/pull/7674>`__.
CHANGELOG_END

* test that rule userState changes propagate all the way out

* adapt compatibility filtering to #7681
2020-10-14 14:51:25 +00:00
anthonylusardi-da
2007c92393
Remove refs to #public Slack channel and some general Slack refs (#7684)
* Remove references to #public Slack channel and some general Slack references

* CHANGELOG_BEGIN
CHANGELOG_END
2020-10-14 09:47:17 -04:00
Stephen Compall
bda13392fd
replace getContracts with query Action, usable in initialize, updateState, rule (#7632)
* add ACS reader to TriggerA and TriggerStateA

* propagate changes in TriggerA, TriggerStateA structure

* allow query to be used in updateState and rule

* remove getTemplates

* remove ACS argument from updateState and rule

* fix type parameter order on query

* use query function in all tests and examples

* replace getContracts with query in documentation

* use wildcards instead of otherwise

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

* rename TriggerStateA to TriggerUpdateA

- suggested by @cocreature; thanks

* missed renamings of TriggerStateA to TriggerUpdateA

- suggested by @cocreature; thanks

* make the meaning of the rlift functions clearer

* make initialize a TriggerInitializeA instead of a function; remove getContracts

* update tests and examples for new initialize signature

CHANGELOG_BEGIN
- [Triggers] Trigger ``updateState``, ``rule``, and ``initialize`` functions no
  longer accept an ``ACS`` argument; instead, they must use the ``query`` action
  to query the ACS, similar to the same function in DAML Script.
  See `issue #7632 <https://github.com/digital-asset/daml/pull/7632>`__.
CHANGELOG_END

* disable older compatibility trigger builds

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-10-13 13:20:43 -04:00
Stephen Compall
664a0c0076
add Action to high-level trigger updateState (#7621)
* add ActionState to the standard library

* use 1 ActionState, 1 get, 1 put in low-level trigger library

* introduce TriggerStateA for updateState

* fix tests and examples for new updateState signature

CHANGELOG_BEGIN
- [Triggers] The ``updateState`` function now returns a ``TriggerStateA``.  This
  is an action like ``TriggerA``, but doesn't permit emitting commands.  Instead
  of taking the state as an argument and returning a new state, you can
  manipulate the state with ``get``, ``put``, and ``modify``.  Any existing
  ``updateState`` can be ported by replacing ``s -> expr`` in the lambda
  expression with ``-> modify $ \s ->``, and then made to look nicer from there
  as desired.
  See `issue #7621 <https://github.com/digital-asset/daml/pull/7621>`__.
CHANGELOG_END

* some DAML docs for updateState and TriggerStateA
2020-10-09 13:56:24 -04:00
Moritz Kiefer
8f3d117dbe
Update JSON API docs to mention multi-party queries (#7609)
* Update JSON API docs to mention multi-party queries

Forgot to include this in #7571. Also includes the changelog which I
also forgot :sadpanda:

changelog_begin

- [JSON API] Queries on the JSON API now support multiple parties just
  like the gRPC Ledger API. Single-party tokens are still
  supported. Note that command submissions are still limited to a
  single party following the restriction on the underlying ledger API.

changelog_end

* Update docs/source/json-api/index.rst

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-10-08 18:06:41 +02:00
Stephen Compall
a1d8e8dc33
replace commands-in-flight argument to trigger rule with getCommandsInFlight action (#7600)
* add getCommandsInFlight as a TriggerA action

* immediately update commandsInFlight on emitCommands

- delay until the rule had returned made sense before submitCommands was launched
  immediately; this also makes `getCommandsInFlight` more sensible

* remove commands-in-flight argument from high-level Trigger rule

CHANGELOG_BEGIN
- [Triggers] The "commands in flight" or ``Map CommandId [Command]`` argument has been
  removed from high-level trigger ``rule`` functions; instead, the current
  commands-in-flight can be retrieved with the new ``getCommandsInFlight`` function, which
  can be done immediately at the beginning of the rule's ``do`` block to preserve exact
  existing trigger behavior.
  See `issue #7600 <https://github.com/digital-asset/daml/pull/7600>`__.
CHANGELOG_END

* remove commands-in-flight argument from trigger tests

* update doc examples and copy in compatibility

- compatibility change will most likely entail another flag day in compatibility tests,
  replacing last_pre_7456_trigger_version

* update doc text for getCommandsInFlight

* test that getCommandsInFlight gets updated during the rule

* flag day for trigger compatibility tests

sdk-version: 1.7.0-snapshot.20201006.5358.0.0c1cadcf
File:     src/CopyTrigger.daml
Hidden:   no
Range:    55:11-55:19
Source:   typecheck
Severity: DsError
Message:
  src/CopyTrigger.daml:55:12: error:
  • Couldn't match type ‘TriggerA ()’ with ‘() -> TriggerA ()’
  Expected type: Party
-> DA.Next.Map.Map CommandId [Command] -> () -> TriggerA ()
  Actual type: Party -> ACS -> () -> TriggerA ()
  • In the ‘rule’ field of a record
  In the expression:
  Trigger
  {initialize = \ _acs -> (), updateState = \ _acs _message () -> (),
  rule = copyRule, registeredTemplates = AllInDar, heartbeat = None}
  In an equation for ‘copyTrigger’:
  copyTrigger
  = Trigger
  {initialize = \ _acs -> (), updateState = \ _acs _message () -> (),
  rule = copyRule, registeredTemplates = AllInDar, heartbeat = None}

* match docs on TriggerAState to current usage of these fields

* remove emittedCommands, as commandsInFlight is now kept up-to-date

* zoomed from where?

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-10-08 12:03:56 -04:00
Robin Krom
51e53ce006
language: Rebuild/redeploy on key press (#7562)
This makes the `daml start` process listen for a key-press. When 'r' is
pressed, the package is re-build, the new package uploaded to the
in-memory sandbox and the codegen re-run.

Note: While we clean previous outputs of the code generation, there is
currently no way to drop previously uploaded packages from the in-memory
sandbox. However, it will take many re-uploads until this will become a
problem.

CHANGELOG_BEGIN
[daml start] You can now press 'r' (or 'r' + 'Enter' on Windows) in the
  terminal where `daml start` is running to rebuild the DAR package and
  generate JavaScript/Java/Scala bindings and upload the new package to
  the sandbox. This frees the user from killing and restarting `daml
  start`.
CHANGELOG_END
2020-10-08 17:10:25 +02:00
Jussi Mäki
2031ae8645
Add timer to track queue delay in InstrumentedSource.queue (#7601)
* Add timer to track queue delay in InstrumentedSource.queue

and use it from TrackerImpl.

CHANGELOG_BEGIN
CHANGELOG_END

* Address code review
2020-10-08 13:18:31 +00:00
Martin Huschenbett
4b7e30219c
Update release instructions to follow newest GSG (#7595)
* Update release instructions to follow newest GSG

We've lately integrated the codegens into `daml start`, which made the GSG significantly shorter in turn. Reflect these changes in the release instructions. Also reword some parts where I found the instructions ambiguous on first reading.

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions

CHANGELOG_BEGIN
CHANGELOG_END
2020-10-08 09:00:48 +00:00
Stefano Baghino
26263b6999
Instrument command service queues [KVL-519] (#7576)
* [KVL-519] Instrument command service queues

changelog_begin
changelog_end

* Instrument max-in-flight queue

* Document inputBuffer and maxInFlight metrics

changelog_begin
[Sandbox] New metrics tracking the pending submissions and completions on the
CommandService. Check out the Metrics session in the sandbox documentation
for more details. The new metrics are input_buffer_size, input_buffer_saturation,
max_in_flight_size and max_in_flight_saturation.
changelog_end

* Fix compilations issues (1)

* Fix title underline in docs

* Refactoring of InstrumentedSource

- Rename saturation/size to length/capacity to make it more obvious what they are.

- Move the InstrumentedSource to ledger/metrics. Fits there better, with the utilities
  there already for futures. Arguable both should move into libs-scala package at some point though.

- Expand the tests and make the tests less flaky. 200 runs complete fine now.

- Inc/dec the capacity counter within InstrumentedSource.

* Add missing copyright header

* Reformat

* Update ledger/metrics/src/test/scala/com/daml/metrics/InstrumentedSourceSpec.scala

Co-authored-by: hanshoglund-da <67470727+hanshoglund-da@users.noreply.github.com>

* Fix title underline in docs (again)

Co-authored-by: Jussi Maki <jussi.maki@digitalasset.com>
Co-authored-by: hanshoglund-da <67470727+hanshoglund-da@users.noreply.github.com>
2020-10-07 11:54:23 +00:00
Richard Kapolnai
98b0f1c0c7
Fix typos (#7590)
* add missing punctuation
CHANGELOG_BEGIN
CHANGELOG_END

* fix filename in download
2020-10-07 11:27:57 +02:00
Stephen Compall
0e71a2d3d2
interpret allowed updates and other actions in a free Trigger monad, like Script (#7456)
* conservatively move daml-script, trigger SValue interpreters to common library

* introduce expect and JavaList pattern for converters

* clean up trigger Converter Command interpretation

* add Church Free monad

* add an action language for trigger updates

* add expectE to remove some of the joins

* convert more of the converters to expect

* tool for unrolling Free/Roll

* split handleStepResult up and clean up its pattern

* handleStepFreeResult to interpret TriggerF

* replace Free Church with Pure/Roll free from Script

* newtype for ActionTrigger

* replace update in low-level Trigger with Free TriggerF

* submit one Commands at a time

* boolean blindness strikes again

* log missed TriggerF steps

* comment actual Submit contents

* match #7501 fromPureSExpr sig change in 00b80b8ea3

* avoid using forwardPort in runTrigger

* push State back into DAML, so it can be excluded from the action list

* push Message back into DAML, unifying the action language for initialState and update

* bringing TriggerF into initial state

* really add TriggerF into initial state, with all ports, tested

* add ActionTrigger class, express initialState in its terms

* add all TriggerF actions to existing TriggerA

* Trigger.rule will no longer have Time argument

* rename getS, setS to get, put, matching C.M.T.State from transformers

* make high-level Rule evaluate to the underlying TriggerF sequence

* Assert's testRule doesn't have a transform yet

* move DamlTuple2 to common converter library

- suggested by @cocreature; thanks

* combine the two Frees, provide from Script

* remove time argument from integration tests

CHANGELOG_BEGIN
- [Triggers] The ``Time`` argument was removed from the trigger rule function; instead, it
  can be fetched within the ``TriggerA`` ``do`` block by ``getTime``, as with ``Update``
  and ``Scenario``.  The ``LowLevel`` trigger interface has been redesigned; such triggers
  need to be rewritten or ported to high-level triggers.
  See `issue #7456 <https://github.com/digital-asset/daml/pull/7456>`_.
CHANGELOG_END

* add trigger rule simulator to support Assert module

* missed new Free module

- left in script per @cocreature

* remove retract as we ended up using foldFree for that purpose instead

- suggested by @cocreature; thanks

* throw ConverterException instead of RuntimeException

- suggested by @cocreature; thanks

* remove Time argument from coin-upgrade-trigger

* port trigger service tests

* port trigger scenario test

* put TriggerSetup and TriggerRule into LowLevel.Trigger instead of unboxed Free

- suggested by @cocreature; thanks

* remove Time argument from trigger compatibility test

* submit commands as soon as each `emitCommands` is sequenced

- we still collect a list, but only for tracking commandsInFlight

* filter out compatibility tests for triggers before now

* remove commented imports, libraries from new shared converter

* make the TriggerF interpreter tail-recursive

* remove unused compatibility trait

* add back new state logging

* remove refactoring comment

* rewrite some LowLevel initialStates in do

* hide Daml.Script.Free from docs

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

* remove forwardPortInitialState

- suggested by @cocreature; thanks

* manually port low-level updates

- suggested by @cocreature; thanks

* remove forwardPort

- suggested by @cocreature; thanks

* fail faster on unrecognized TriggerF

- suggested by @cocreature; thanks

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-10-02 14:18:13 -04:00
Moritz Kiefer
73b38f8add
Move besu to commercially supported ledgers (#7560)
changelog_begin
changelog_end
2020-10-02 16:47:19 +00:00
Robin Krom
6a328212f2
language: automatic ts codegen for daml start (#7516)
This executes the code generations specified in the daml.yaml
configuration file on every invocation of `daml start`
and hence frees the user of doing it manually.

CHANGELOG_BEGIN
- [DAML Assistant] The `daml start` now runs all the code generators
specified in the `daml.yaml` project configuration file under the
`codegen` stanza. This frees the user of doing so manually on every
change to the DAML model.
CHANGELOG_END
2020-10-02 15:43:06 +02:00
Richard Kapolnai
3badccfb1f
Rename more contract instance (#7557)
* Replace "contract instance" with "contract" in docs folder
CHANGELOG_BEGIN
CHANGELOG_END

* remove contract instance in docs/source/concepts/glossary.rst

* Remove contract instance explanation docs/source/concepts/glossary.rst

* Update docs/source/concepts/glossary.rst

* Replace contract-contract-instance label ref with contract

* Remove redundant naming

* remove more "contract instance"
CHANGELOG_BEGIN
CHANGELOG_END

* fix comma in doc

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-10-02 15:30:53 +02:00
Richard Kapolnai
40c1cd5893
Check closing quotes (#7528)
* Missing closing quote in docs
CHANGELOG_BEGIN
CHANGELOG_END

* add Bash script to check missing quotes in docs
CHANGELOG_BEGIN
CHANGELOG_END

* add whitelist

* fix comment

* add CI job
CHANGELOG_BEGIN
CHANGELOG_END

* add CI job to azure pipeline

* use devenv in azure-pipelines.yml

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* remove unnecessary yml

* fix quotes in Bifunctor.daml

* add check to BUILD.bazel with extended whitelist

* refactor: call bash script from BUILD.bazel

* Revert "use devenv in azure-pipelines.yml"

This reverts commit 28ab2c70fb.

* Revert "add CI job to azure pipeline"

This reverts commit 0eaa5188fe.

* filter whitelist in output too

* Update docs/scripts/check-closing-quotes.sh.whitelist

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* fix Bifunctor.daml quotes

* Update docs/scripts/check-closing-quotes.sh.whitelist

Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>

* use ~ instead of ` for section titles

* rename to allowlist

* revert Bifunctor quote changes back to 3 backticks

* fix filename

* Remove line breaks in quotes (#7550)

* remove line breaks in quotes
CHANGELOG_BEGIN
CHANGELOG_END

* remove line breaks in quotes
CHANGELOG_BEGIN
CHANGELOG_END

* README: avoid line breaks

* merge rename

* revert: use triple backticks in Bifunctor

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-10-02 14:53:10 +02:00
Richard Kapolnai
70196083c3
Replace "contract instance" with "contract" in docs folder (#4873)
* Replace "contract instance" with "contract" in docs folder
CHANGELOG_BEGIN
CHANGELOG_END

* remove contract instance in docs/source/concepts/glossary.rst

* Remove contract instance explanation docs/source/concepts/glossary.rst

* Update docs/source/concepts/glossary.rst

* Replace contract-contract-instance label ref with contract

* Remove redundant naming
2020-10-02 13:55:56 +02:00
Bernhard Elsner
cfed918e40
Fix bifunctor docs (#7552)
* Fix bifunctor docs

- Remove non-implemented Haddock markup
- Fix code blocks
- Fix Lexer to accept `≡`
- Change Haskell REPL `>>>` to DAML REPL `daml>`

CHANGELOG_BEGIN
CHANGELOG_END

* Further improvements
2020-10-02 11:48:03 +00:00
Bernhard Elsner
f1e5820655
Intro to DAML Chapter 10 (#7508)
* Some minor improvements to the DAML Intro docs

CHANGELOG_BEGIN
CHANGELOG_END

* Intro to DAML Chapter 8

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback

* Update docs/source/daml/intro/8_Upgrading.rst

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

* Remove wrong statements about interface files

* Complete rework to focus on dependencies, not upgrades

* Intro to DAML Chapter 9

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

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

* Make the JS code actual JS

* Update Chapter 9 to incorporate Chapter 8 changes

* Copyright headers and feedback

* Intro to DAML Chapter 9

CHANGELOG_BEGIN
CHANGELOG_END

* Intro to DAML Chapter 10

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback

* Incorporate chapter 8 changes

* Update toctree

* Get rid of warnings

* Explain `when` short circuiting.

* Fix template

* Fix some literal-includes

* Apply suggestions from code review

Co-authored-by: anthonylusardi-da <59614480+anthonylusardi-da@users.noreply.github.com>

* Copyright headers

* Intro to DAML Chapter 11 (#7509)

* Intro to DAML Chapter 9

CHANGELOG_BEGIN
CHANGELOG_END

* Intro to DAML Chapter 10

CHANGELOG_BEGIN
CHANGELOG_END

* Intro to DAML Chapter 11

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback

* Incorporate chapter 8 changes

* Minor fixes

* Update docs/source/daml/intro/11_Testing.rst

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

* Condense the test tooling section to a minimum

* Apply suggestions from code review

Co-authored-by: anthonylusardi-da <59614480+anthonylusardi-da@users.noreply.github.com>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: anthonylusardi-da <59614480+anthonylusardi-da@users.noreply.github.com>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: anthonylusardi-da <59614480+anthonylusardi-da@users.noreply.github.com>
2020-09-29 22:24:40 +02:00
Bernhard Elsner
708e3e2543
Intro to DAML Chapter 9 (#7507)
* Some minor improvements to the DAML Intro docs

CHANGELOG_BEGIN
CHANGELOG_END

* Intro to DAML Chapter 8

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback

* Update docs/source/daml/intro/8_Upgrading.rst

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

* Remove wrong statements about interface files

* Complete rework to focus on dependencies, not upgrades

* Intro to DAML Chapter 9

CHANGELOG_BEGIN
CHANGELOG_END

* Apply suggestions from code review

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

* Make the JS code actual JS

* Update Chapter 9 to incorporate Chapter 8 changes

* Copyright headers and feedback

* Update toctree

* Get rid of warnings

* Explain `when` short circuiting.

* Fix template

* Fix some literal-includes

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-09-29 18:30:15 +00:00
Bernhard Elsner
af2607cfe5
Intro to DAML Chapter 8 (#7506)
* Some minor improvements to the DAML Intro docs

CHANGELOG_BEGIN
CHANGELOG_END

* Intro to DAML Chapter 8

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback

* Update docs/source/daml/intro/8_Upgrading.rst

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

* Remove wrong statements about interface files

* Complete rework to focus on dependencies, not upgrades

* Copyright headers and feedback

* Update toctree

* Get rid of warnings

* Fix template

* Fix tests

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-09-29 16:34:21 +00:00
Sofia Faro
e9cd92f061
Deprecate the "daml 1.2" version header. (#7513)
* changelog_begin

- [DAML] The "daml 1.2" version header is now deprecated.

changelog_end

* fix some line numbers

* fix some more locations
2020-09-29 13:14:59 +00:00
Bernhard Elsner
c6965433f4
Some minor improvements to the DAML Intro docs (#7505)
* Some minor improvements to the DAML Intro docs

CHANGELOG_BEGIN
CHANGELOG_END

* Incorporate feedback
2020-09-29 08:45:17 +00:00
Bernhard Elsner
bfc025515d
Improve Time Model docs (#7504)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-29 08:13:22 +00:00
Moritz Kiefer
0f9ae62acb
Fix link to Java bindings’s Value class (#7498)
fixes #7496

changelog_begin
changelog_end
2020-09-28 13:38:51 +02:00
Moritz Kiefer
d87d658245
Document standalone JAR for the JSON API (#7494)
fixes #7453

changelog_begin
changelog_end
2020-09-25 17:52:36 +02:00
Martin Huschenbett
afdfec53dd
Deprecate specifying the template in daml new positional (#7490)
We deprecate specifying the template when calling `daml new` via a
positional argument, as in
```sh
daml new foo skeleton
```
The new syntax is
```sh
daml new foo --template skeleton
```
Whenever the former version is used, we now print a not that it is
deprecated and that the latter version is the recommended way.

CHANGELOG_BEGIN
[DAML Assistant]
- Deprecate specifying the template for `daml new` via a positional
  argument.
CHANGELOG_END
2020-09-25 12:39:49 +00:00
Richard Kapolnai
6afa51bb47
Fix typos in doc (#7488)
* fix typo
CHANGELOG_BEGIN
CHANGELOG_END

* Missing closing quote in docs
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-25 13:23:33 +02:00
Andreas Herrmann
171ba85813
Missing closing quote in docs (#7484)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-09-25 09:11:09 +00:00
Richard Kapolnai
afa29516b6
Remove an unclear bit from JSON API documentation: no metaprogramming (#7480)
changelog_begin
changelog_end
2020-09-25 08:45:44 +02:00
Bernhard Elsner
331ee44978
Documentation of our support and compatibility framework (#7458)
* Documentation of our support and compatibility framework

CHANGELOG_BEGIN
CHANGELOG_END

* Update docs/source/daml-integration-kit/index.rst

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

* Update docs/source/support/component-statuses.rst

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

* Address feedback

* Update docs/source/support/compatibility.rst

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>

* Add Deprecations and address feedback

* Fix short title underline

* Apply suggestions from code review

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>

* Improve sentence on Integration Kit

* Imprive SemVer TLDR

* Uncapitalize release candidate

* Fix release timeline image

* Make the DAML Language Server CLI a Labs feature

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-09-24 14:40:57 +00:00
Moritz Kiefer
e53bcd90c0
Clarify some documentation around DAML triggers (#7477)
This fixes #7471 and fixes #7469.

Thanks to @lucb-da for pointing this out!

changelog_begin
changelog_end
2020-09-24 14:00:47 +02:00
Sofia Faro
20732edc32
Fix GSG environment variable setup instructions. (#7465)
* Fixes #7451 by telling users to use `$HOME/.daml/bin` instead of `~/.daml/bin` when setting up the PATH variable.

In addition, this PR streamlines the instructions a bit by not telling users to restart their computers (they only need to restart the terminal) and by verifying the variables only after setting them both up, so they only need to restart the terminal once (without jumping around the instructions).

changelog_begin
changelog_end

* reinstate some restarts

* Emphasize that it is the Terminal app from macOS
2020-09-23 15:49:31 +00:00
Moritz Kiefer
ce3d5b0b44
Extend DAML Script migration guide (#7448)
* Extend DAML Script migration guide

This PR extends the DAML Script migration guide with a few things that
have been added recently or popped up during the migration of various
refapps.

fixes #7403

changelog_begin
changelog_end

* Apply suggestions from code review

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

* Rename daml on sql to daml for postgresql

changelog_begin
changelog_end

* Update docs/source/daml-script/index.rst

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-09-21 15:23:56 +02:00
Gary Verhaegen
051b0b515e
remove mailchim popup code (#7424)
After discussion we have decided to introduce such popups through Google
Tag Manager, as the release schedule fo these sorts of JS tags does not
mesh well with the current release process of our docs site.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 16:28:38 +00:00
anthonylusardi-da
54ad2adf06
Remove hubspot mailing list popup and replace with mailchimp (#7408)
* Remove hubspot mailing list popup and replace with mailchimp

* CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 09:01:23 -04:00
Gary Verhaegen
adc0b45f5f
faster docs preview (#7383)
There is generally little need to preview the PDF version of the docs.
Also, opening up the Python server on 0.0.0.0 (the default) triggers OS
warnings on macOS.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 14:12:59 +02:00
Moritz Kiefer
c0b6851abe
Generate hoogle docs for daml script/triggers (#7371)
* Generate hoogle docs for daml script/triggers

This PR switches over the documentation generation for daml script and
daml triggers to the multi-page format we already use for the standard
library and extends it to also generate hoogle documentation.

All 3 hoogle files are combined in a single hoogle_db.tar.gz archive.

Since the location in the multi-page format is different, I’ve added
redirects.

I verified locally, that I can generate the hoogle database and that
the links point to the right places.

changelog_begin
changelog_end

* Fix baseurl for daml-stdlib

changelog_begin
changelog_end
2020-09-10 15:58:15 +02:00
Moritz Kiefer
5bee5a08df
Document ApplicativeDo restrictions (#7359)
fixes #7343

changelog_begin
changelog_end
2020-09-09 17:56:33 +02:00
Moritz Kiefer
8d66817f1d
Remove redundant --force from npm invocations (#7358)
NPM doesn’t actually need this (at least it didn’t for me locally and
hopefully CI agrees) to pick up changes and it emits a very
scary-looking warning if you do pass it.

changelog_begin
changelog_end
2020-09-09 13:28:24 +02:00
Martin Huschenbett
2236a949b6
Docs: Minor improvements to ledger structure (#7357)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 13:15:25 +02:00
anthonylusardi-da
86c637b43d
Add links to get forum badges at the end of the GSG sections (#7327)
* Add links to get forum badges at the end of the GSG sections

* CHANGELOG_BEGIN
CHANGELOG_END
2020-09-08 12:47:55 -04:00
Moritz Kiefer
d086738ac0
Migrate DAML Intro to DAML Script (#7264)
changelog_begin
changelog_end
2020-09-08 14:28:30 +02:00
Moritz Kiefer
fea21e33a6
Migrate leftover scenario in quickstart to DAML Script (#7338)
We already migrated everything in the Tests directory but forgot about
this one.

changelog_begin
changelog_end
2020-09-08 13:15:45 +02:00
Robin Krom
678a8eef71
Replace yarn with npm (#7222)
* replace yarn with npm in docs

CHANGELOG_BEGIN
CHANGELOG_END

* updating assistant and compatibility tests

* moved gitignore entry to toplevel
2020-09-08 12:07:04 +02:00
Brian Healey
e2bff87a0c
Provide configurable clock interval to cater for ledger differences with deduplication tests (#7294)
* Extend wait time for dedupe tests to 2x dedupe window

* default clock tick interval of 10s, make it optionally configurable

CHANGELOG_BEGIN
[ledger-api-test-tool] Include new attribute for configurable clock tick
interval
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>

* address review comments

* Address code review - use Duration

* Add documentation on --ledger-clock-granularity option

* Update documentation

* address review comments

* address warning: implicit numeric widening

* scalafmt

* ProtobufDuration alias rather than ProtoDuration for consistency with namespacing

* underline in docs
2020-09-04 17:19:07 -04:00
Moritz Kiefer
3171bb588a
Migrate trigger assertion library to DAML Script (#7318)
This is clearly a breaking change but triggers are still alpha so we
can get away this (confirmed with Bernhard).

changelog_begin

- [DAML Trigger] Daml.Trigger.Assert now uses DAML Script instead of scenarios.

changelog_end
2020-09-04 13:48:50 +02:00
anthonylusardi-da
b3b2a8119c
Update codegen docs to include Javascript (#6354)
* Partial update to codegen docs

* ADD: JS codegen to codegen docs

* CHANGELOG_BEGIN
ADD: JS codegen to codegen docs
CHANGELOG_END

* Make it clear we're talking about codegen

* Add extra reference to JS, JS -> TS, and mention missing Java/Scala classes

* Add placeholder for SDK version
2020-09-02 10:15:47 -04:00
Bernhard Elsner
86974d8afa
Add hints to the DAML Intro docs to encourage downloading the code. (#6839)
* Add hints to the DAML Intro docs to encourage downloading the code.

CHANGELOG_BEGIN
CHANGELOG_END

* Improve hints
2020-09-02 13:28:58 +00:00
Moritz Kiefer
f8a82ad25f
Add queryContractId to DAML Script (#7289)
* Add queryContractId to DAML Script

I’ve switched between a few different naming options and in the end
settled on this one:

- `lookupContract`, not too bad but misses the connection to `query`
- `queryCid`, we don’t abbreviate this in other places in our API so I
  don’t think we should here.
- `queryContractId`, makes the connection clear and no
  abbreviation. We could also add `queryContractKey` later

changelog_begin

- [DAML Script] Add a `queryContractId` function for querying for a
  contract with the given identifier.

changelog_end

* Fix test

changelog_begin
changelog_end
2020-09-01 10:31:34 +00:00
Andreas Herrmann
6c8964fb3b
java-quickstart replace scenarios by DAML Script (#7183)
* java-quickstart replace scenarios by DAML Script

This replaces the scenarios in the java quickstart project by DAML
script test cases.

The following changes were required
* Replace `getParty` by `allocateParty`.
* Replace `create` and `exercise` by `createCmd` and `exerciseCmd`.
* Replace the pattern of `submit ... do create ...; exercise ...`
  by `submit ... do createAndExerciseCmd ... ...`.
* Replace instances of `submit ... do fetch ...` by `query ... ...`.
  To that end I've added the following helper function.
  ```
  queryIou : Party -> ContractId Iou -> Optional Iou
  ```

changelog_begin
changelog_end

* Replace queryIou by FetchIou choice

changelog_begin
changelog_end

* Add comment explaining fetch choice

Addressing review comment
https://github.com/digital-asset/daml/pull/7183#discussion_r478918758

* Support dependencies in daml_test rule

Cherry-picked from https://github.com/digital-asset/daml/pull/7264/files
Renamed `dependencies` as `deps` to stick to Bazel conventions.

* Fix quickstart `daml_test` target

* fmt

* Quote deps in daml.yaml

To avoid issues with `:` in Windows paths.

* //docs:quickstart-java - use temp dir

This target repeatedly failed to build on Windows with
```
ERROR: D:/a/1/s/docs/BUILD.bazel:538:8: declared output
'docs/quickstart-java.tar.gz' was not created by genrule. This is
probably because the genrule actually didn't create this output, or
because the output was a directory and the genrule was run remotely
(note that only the contents of declared file outputs are copied from
genrules run remotely)
```
The genrule was operating in the current working directory and builds on
Windows are not sandboxed. Conflicting files in the current working
directory could cause this to fail.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-08-28 16:19:45 +00:00
Moritz Kiefer
6e4f101aad
Remove ref-ledger-authenticator from trigger service (#7226)
* Remove authentication service from trigger service

This rips out the integration with ref-ledger-authenticator and
together with that the weird http basic auth which doesn’t actually
work for ref-ledger-authenticator outside of its testing mode and also
includes some very sketchy stuff like storing user
passwords (encrypted but still).

While the exact details of the new approach towards auth are still not
completely clear, it is clear that it is going to be sufficiently
different from what we did before that starting from a clean slate is
easier.

changelog_begin

- [Trigger Service] Parties are now specified in request bodies as
  opposed to via HTTP Basic auth. This is done in preparation for
  running the trigger service against authenticated ledgers.

changelog_end

* Fix integration tests

changelog_begin
changelog_end
2020-08-27 15:36:59 +02:00
Leonid Shlyapnikov
1452076eee
Deprecating noop '--application-id' command-line option in JSON API (#7232)
* Deprecate noop `--application-id`

changelog_begin

[JSON API]
Hiding and deprecating `--application-id` command-line option. JSON API never used it.
It is required to instantiate LedgerClientConfiguration and was not used for any command submission.
JSON API uses Application ID specified in the JWT. See #7162

changelog_end

* removing further usage of noop applicationId

* a bit of explanation what this is for
2020-08-26 20:05:00 +00:00
anthonylusardi-da
5d1f0bf382
Improve the JSON API documentation, clarify common json-api options, update the authorization/authentication sections. (#7133)
* Clarify how to start a test ledger, and run json api with & w/o query storage

* Remove the json-api --help output and replace with a note.

* Update JSON API Authorization/Authentication sections

* Minor improvements to query section

* CHANGELOG_BEGIN
[Docs] Improve the JSON API documentation, clarify the common json-api options, and update the authorization/authentication section.
CHANGELOG_END

* Note why you would specify a Command ID in the JSON API

* Clarify how the Authorization token works

* Add warning to always run the JSON API behind a reverse proxy

* Apply suggestions from code review

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

* Change how we refer to the different access tokens used by the JSON API

* applicationId doesn't need to match --application-id

* remove reference to planned jwt library

* Update party allocation instructions/explanation

* Remove IAM references from Ledger API Auth

* Stop lying about secrets

* Auth shouldn't be party-specific

* Needed more stars

* Apply suggestions from code review

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

* Update Ledger API access token description

* Additional clarifications on the two types of tokens

* Note that each request to the JSON API can only come from a single party

* Apply suggestions from code review

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

* Clarify getting access tokens from your ledger operator

* Add link to JWT format in the sandbox

* Fix inconsistent title level

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-08-26 09:56:06 -04:00
Moritz Kiefer
d33e130f47
Enable DAML Script service by default and document it (#7229)
* Enable DAML Script service by default and document it

fixes #7193

changelog_begin

- [DAML Script] DAML Scripts are now run in DAML Studio just like
  scenarios. The functionality for inspecting the results is
  identical. If you encounter issues, please report them.

changelog_end

* fix double "is identical"

changelog_begin
changelog_end
2020-08-25 19:53:59 +02:00
Leonid Shlyapnikov
3ecfcc918c
Adding package-max-inbound-message-size (#7147)
* Adding `package-max-inbound-message-size`

this is to allow separate configuration settings for command submission
and package management ledger clients

* Fixing formatting

* Updating docs

changelog_begin

[JSON API] Adding `--package-max-inbound-message-size` command line option.
Optional max inbound message size in bytes used for uploading and downloading package updates. Defaults to the `max-inbound-message-size` setting.

changelog_end

* Addressing code review comments
2020-08-24 14:55:55 +00:00
Gary Verhaegen
f54e193df6
add visibleByKey (#7146)
Adds a Boolean check for the existence of an active contract with a
given key (that is visible with the current set of authorizations), and
explain `lookupByKey` in terms of it to hopefully clarify the relationship
between `lookupByKey` and `fetchByKey`.

Fixes #7143; see that for more information.

CHANGELOG_BEGIN

- [DAML Standard Library] Added a new function `visibleByKey`
  which, given a contract key, returns True if the current context can
  see an active contract with that key.

CHANGELOG_END
2020-08-24 15:04:05 +02:00
Andreas Herrmann
037cf11710
Add :json command to DAML REPL (#7202)
* REPL test `:json` command

changelog_begin
changelog_end

* Implement :json command in DAML REPL

changelog_begin
- [DAML REPL] You can now convert DAML expressions to JSON in the DAML
  REPL using the meta-command ``:json`` for example ``:json [1, 2, 3]``.
changelog_end

* Extend DAML REPL documentation

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-08-21 14:53:06 +00:00
anthonylusardi-da
3d067b5fa9
Fix some screen widths not showing the content menu collapse/expand icon (#7138)
* Fix some screen widths/zoom levels not showing the content menu collapse/expand icon

* CHANGELOG_BEGIN
[Docs] Fix some screen widths not showing the content menu collapse/expand icon
CHANGELOG_END
2020-08-19 16:37:47 -04:00
Gary Verhaegen
4f2bd150b9
focus SDK install page (#7131)
- Put Windows first, and add a direct link to the installer.
- Move the manual step to a separate page.
- Link to AdoptOpenJDK as they have by far the simplest download page.

CHANGELOG_BEGIN
CHANGELOG_END
2020-08-18 15:34:28 +02:00
Samir Talwar
aa9e90d7cb
ledger-api-test-tool: Upload DARs, rather than expecting them. (#7163)
* ledger-api-test-tool: Upload DARs, rather than expecting them.

This allows us to avoid knowing the DARs.

CHANGELOG_BEGIN
- [Integration Kit] When running the Ledger API Test Tool, the required
  DAR files are now uploaded to the ledger automatically before running
  the tests. You no longer need to upload these DARs before running the
  test tool.
CHANGELOG_END

* ledger-api-test-cool: Factor out configuration construction.

* ledger-api-test-tool: Upload DARs to all participants.

And don't prime Canton.

* docs: Document that the Ledger API Test Tool uploads DARs by itself now.

* ledger-api-test-tool-on-canton: Remove unused code in the runner.
2020-08-18 13:25:02 +00:00
Andreas Lochbihler
74986b9035
Causality and interoperability documentation (#6920)
CHANGELOG_BEGIN
Add documentation for the ordering guarantees on the Ledger API
and for causal consistency with interoperable ledgers
CHANGELOG_END

Co-authored-by: Ognjen Maric <ognjen.maric@digitalasset.com>
Co-authored-by: Bernhard Elsner <40762178+bame-da@users.noreply.github.com>
2020-08-17 16:15:55 +02:00
Leonid Rozenberg
2887c30c83
Stop prefacing templates, choices and controller with DAML. (#7110)
It seems redundant and breaks the reading flow.

CHANGELOG_BEGIN
CHANGELOG_END
2020-08-17 08:45:46 +02:00
Gary Verhaegen
8a96093158
update release instructions (#7118)
I tried to cut through most of the noise, and updated for the new "don't
copy release notes three times" idea.

CHANGELOG_BEGIN
CHANGELOG_END
2020-08-13 15:36:32 +02:00
Moritz Kiefer
5496127b9a
Fix redirect for app-dev/authentication.html (#7108)
https://docs.daml.com/app-dev/authentication.html currently redirects
to https://docs.daml.com/app-dev/app-dev/authorization.html which is
clearly wrong.

changelog_begin
changelog_end
2020-08-13 10:59:58 +02:00
Moritz Kiefer
f643cbfab2
Expand documentation on null offsets in the JSON API (#7105)
changelog_begin
changelog_end
2020-08-13 09:00:45 +02:00
Moritz Kiefer
27d847a0ea
Release SDK 1.4.0 (#7094)
* Release SDK 1.4.0

changelog_begin
changelog_end

* Update docs for daml on sql

changelog_begin
changelog_end

* Update highlights as well

changelog_begin
changelog_end

* Fix rst

changelog_begin
changelog_end
2020-08-12 13:12:17 +02:00
Sarah Breckenridge
3c98a49287
Correct 2 docs typeos (#7088) 2020-08-11 16:16:00 +00:00
Moritz Kiefer
e1236d42ed
Make ApplicationId in DAML Script configurable (#7074)
This is set per participant since it is similar to the token file.

fixes #7029

changelog_begin

- [DAML Script/DAML REPL] You can now configure the application id via
  `--application-id` or the `--participant-config`. This is primarily
  useful if you are working against a ledger with authentication and
  need to match the application id in your token.

changelog_end
2020-08-10 17:24:38 +02:00
Moritz Kiefer
8024e891ed
Update documentation of extractor’s JSON schema (#7039)
This changed in
a125860a9d (diff-9fda415d853bdd93df3439dadabaebdb)
to reuse the schema from the JSON API.

changelog_begin
changelog_end
2020-08-06 12:10:27 +00:00
Andreas Herrmann
cf24597e70
Factor out reproducibility flags for tar and gzip (#6884)
* Factor out tar/gzip reproducibility flags

* use mktgz in package-app

* Bazel managed tar/gzip

* Remove quiet = True

As stated in the comment this is no longer required with Bazel >= 3.0.

* Build package-app as a sh_binary

This way Bazel will manage the runtime dependencies tar, gzip, mktgz,
and patchelf.

package-app.sh changes directory so it needs to make sure that all paths
are absolute and that the runfiles tree/manifest location is forwarded
to programs called by package-app.sh.

* Avoid file path too long errors

* Fix readlink -f on MacOS

* Document abspath

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-08-05 14:27:14 +00:00
Leonid Shlyapnikov
de2fef6b10
Updating template ID references (#6988)
the format changed a while ago, we just never updated this doc

changelog_begin
changelog_end
2020-08-04 18:54:07 +00:00
Gary Verhaegen
314064d5bf
fix docs typo (#6957)
CHANGELOG_BEGIN
CHANGELOG_END
2020-08-03 10:06:43 +00:00
Andreas Herrmann
8e706a9bde
Remove vendored pkg_tar (#6934)
* Use Bazel builtin pkg_tar rule

* Use @rules_pkg//:pkg.bzl%pkg_tar

The pkg_tar rule builtin to Bazel has been deprecated.
See https://docs.bazel.build/versions/master/be/pkg.html

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-30 15:53:16 +00:00
Moritz Kiefer
e42b16dcfd
Fix example in the trigger docs. (#6919)
The docs talked about `emitCommands` while the code talked about
`dedupExercise`. I’m increasingly leaning towards recommending
`emitCommands` for everything so I’ve switched the code instead of the
docs.

changelog_begin
changelog_end
2020-07-29 15:02:57 +00:00
Stefano Baghino
c16f17a721
Remove mentions of fidelity levels from the Ledger API test tool (#6893)
* Remove mentions of fidelity levels from the Ledger API test tool

Fixes #6868

changelog_begin
[Integration Kit] The performance test names have been changed.
To learn more about the available tests, consult the documentation
for the Ledger API Test Tool and run it with --list.
Docs: https://docs.daml.com/tools/ledger-api-test-tool/index.html
changelog_end

* Update performance envelope tests

* Address https://github.com/digital-asset/daml/pull/6893#discussion_r461655325
2020-07-28 18:24:46 +00:00
Robert Autenrieth
2ac7d28ca2
Support participant node failover (#6875)
* Change error code for invalid offsets for transaction stream and completion stream requests
* Expanded application architecture docs on how to build application with ledger api failover capabilities.

Fixes #6842.

CHANGELOG_BEGIN
- [Ledger API] The error code for requesting a transaction stream
  with an offset beyond the ledger end changed from INVALID_ARGUMENT
  to OUT_OF_RANGE. This makes it easier to handle scenarios where
  an application fails over to a backup participant which hasn't
  caught up with the ledger yet.
- [Ledger API] The command completion service now validates the offset and
  returns the OUT_OF_RANGE error if the request offset is beyond the ledger end.
- [Documentation] Added a section on how to write DAML applications
  that can fail over between multiple eventually consistent Ledger API endpoints
  where command deduplication works across these Ledger API endpoints, which
  can be useful for addressing HA and/or DR scenarios.
CHANGELOG_END
2020-07-28 17:03:55 +02:00
Moritz Kiefer
a9fcf965ba
Document required nodejs version (#6891)
We’ve had a few confused users run into issues because of
this. `fsevents` (which is basically impossible to avoid as a
dependency) requires NodeJS 8.16 but for some reason Ubuntu 18.04
sticks to the unsupported 8.10.

changelog_begin
changelog_end
2020-07-28 11:27:55 +02:00
Andreas Herrmann
5481a080d7
DAML REPL :show imports (#6885)
* DAML REPL :show imports

changelog_begin
- [DAML REPL] You can now list the currently imported modules using
  the REPL command ``:show imports``.
changelog_end

* Accept \r\n on Windows.

* REPL functests use text mode file for stdin/out

So that `\r\n` will be mapped to `\n` automatically on Windows.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-07-28 10:51:48 +02:00
Moritz Kiefer
2c10c4444b
Extend daml new to accept template as an option (#6877)
* Extend `daml new` to accept template as an option

The two positional arguments keep confusing users so this PR changes
things to allow the template to be passed via `--template`. Using a
positional argument still works so this is not breaking.

I’ve updated all docs to use the less confusing syntax.

changelog_begin

- [DAML Assistant] You can now use ``daml new project-name
  --template=template-name`` instead of ``daml new project-name
  template-name``. The old CLI syntax continues to be supported.

changelog_end

* Update docs/source/getting-started/index.rst

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-07-27 16:30:48 +02:00
Andreas Herrmann
e0b9a535b3
DAML REPL :module command (#6865)
* DAML REPL help and module commands

changelog_begin
- [DAML REPL] You can now type ``:help`` at the REPL prompt to see a
  list of possible REPL commands.
- [DAML REPL] You can now add and remove module imports using
  ``:module [+-] Some.Module``.
changelog_end

* REPL :module functests

* Improve module not imported error message

* DAML REPL document REPL commands

* Update docs/source/daml-repl/index.rst

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

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-07-27 11:22:29 +00:00
Stefano Baghino
fefc72f2df
Fix references to authentication in the docs (#6858)
* Fix references to authentication in the docs

Fixes #6855

changelog_begin
changelog_end

* Fix broken links and missing references

* Address https://github.com/digital-asset/daml/pull/6858#discussion_r460675037

* Apply suggestions from code review

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>

* Removing useless anchors left over from previous pass

* Fix broken links

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-07-27 09:31:24 +00:00
Moritz Kiefer
d958db1f1d
Remove useless LibraryModules module from intro 7 (#6851)
changelog_begin
changelog_end
2020-07-24 17:01:28 +02:00
Moritz Kiefer
aac32983b7
Support let-bindings in DAML REPL (#6843)
This PR extends DAML REPL to also support `let` bindings which plays
well with the improved support for pure expressions. We support both
pattern bindings and function bindings.

changelog_begin

- [DAML REPL] DAML REPL can now run without a ledger. Take a look at
  the documentation for details.

- [DAML REPL] DAML REPL now supports ``let`` bindings to bind pure
  expressions. Take a look at the documentation for details.

changelog_end
2020-07-23 12:39:51 +00:00
Moritz Kiefer
9881ff5231
Make DAML REPL work without a ledger (#6838)
This PR makes the ``--ledger-host`` and ``--ledger-port`` parameters
optional so DAML REPL works without a ledger which is useful now that
we have better. support for pure expressions. This just piggybacks on
DAML Script’s multiparticipant support so there are no significant
changes on the service.

Docs are updated and we have a testcase.

Side note: What is still missing is `let x = …` in DAML REPL. I’ll
tackle that in a separate PR.

changelog_begin
changelog_end
2020-07-23 10:23:24 +00:00
Moritz Kiefer
ee74551642
Add previous/next buttons to the documentation (#6811)
fixes #6701

changelog_begin
changelog_end
2020-07-21 17:14:33 +02:00
Moritz Kiefer
1f54c77879
Remove outdated roadmap from the docs (#6812)
changelog_begin
changelog_end
2020-07-21 14:35:53 +00:00
Moritz Kiefer
c060febdf6
Update DAML Studio documentation (#6808)
* Update DAML Studio documentation

This updates the DAML Studio docs primarily focusing on the table view
which was completely omitted so far. This also includes the new
disclosure information.

This is probably best reviewed locally.

changelog_begin
changelog_end

* No copyright header for samples

changelog_begin
changelog_end

* Move to SDK tools section

changelog_begin
changelog_end

* fix typo

fixes #6775 

changelog_begin
changelog_end

* Update docs/source/daml/daml-studio.rst

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>

Co-authored-by: Sofia Faro <sofia.faro@digitalasset.com>
2020-07-21 13:41:39 +02:00
Moritz Kiefer
6bf1eb19ae
Print results in DAML REPL and support pure expressions (#6799)
* Print results in DAML REPL and support pure expressions

This extends DAML REPL to behave similar to GHCi in that it prints
results if the result is an instance of `Show` and it also supports
pure, non-script expressions now. We copy the same hack from GHCi and
typecheck multiple times. This doesn’t seem to have any noticeable
performance impact (which makes sense, the expressions are tiny and
the overhead of grpc is much much bigger).

Docs and tests are updated.

fixes #6780

changelog_begin
changelog_end

* windows is garbage

* but I fixed it \o/

* Rename getReplLogger to newReplLogger

changelog_begin
changelog_end
2020-07-21 09:01:18 +00:00
Robert Autenrieth
1074736316
Add time model documentation (#6705)
* Update existing docs, removing references to old time model
* Add detailed time model docs
* Rename ledger effective time to ledger time

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-17 17:54:26 +02:00
Moritz Kiefer
b12a19181e
Add a --timeout option to daml ledger commands (#6774)
* Add a --timeout option to `daml ledger` commands

At least in the compatibility tests, we see timeouts fairly regularly
in the tests for fetch-dar. If we see those timeouts in the tests, I
see no reason why our users should never see that especially on
actually distributed ledgers and hardcoded timeouts are a bad idea
anyway so now they are configurable.

I’ve also changed the timeout for the fetch tests (those are the only
once I’ve seen timeout) to 120s.

changelog_begin

- [DAML Assistant] The `daml ledger` commands now accept a `--timeout`
  option which can be used to change the timeout for API requests from
  the default of 30s.

changelog_end

* Generate parties as uuids to avoid collisions

changelog_begin
changelog_end

* Match on Deadline Exceeded as well

changelog_begin
changelog_end

* Update compatibility/bazel_tools/test_utils/DA/Test/Util.hs

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Update daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

* Add some docs

changelog_begin
changelog_end

* Better version checks

changelog_begin
changelog_end

* fix imports

changelog_begin
changelog_end

* This is not how you exception

changelog_begin
changelog_end

* Update daml-assistant/daml-helper/src/DA/Daml/Helper/Main.hs

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>

Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2020-07-17 16:35:55 +02:00
Stefano Baghino
31b8e3c661
Remove documentation to use Navigator using old assistant (#6773)
This references the old assistant and the deprecated configuration
files. The positioning for Navigator right now (correct me if I'm wrong)
is that it's a development tool, so I don't think it makes a lot of
sense publicizing it otherwise.

Closes #3237

changelog_begin
changelog_end
2020-07-17 12:24:33 +00:00
Moritz Kiefer
ebacb34caa
Release SDK 1.3.0 (#6753)
changelog_begin
changelog_end
2020-07-16 12:07:34 +02:00
Stefano Baghino
a4b666a7ee
Document Sandbox metrics (#6662)
* Document Sandbox metrics

Closes #5573

changelog_begin
changelog_end

* Selected a list of relevant metrics to document

* Provided a description of selected namespaces and metrics

* Alphabetical ordering

* Fix nested list

* Visual fixes, removing cache metrics

* No need to mock Metrics

* Update docs/source/tools/sandbox.rst

Co-authored-by: Peter Garmaz <40190826+pgarmaz-da@users.noreply.github.com>

* Adapts to recent change in metrics CLI option format

* Update docs/source/tools/sandbox.rst

Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>

* Address https://github.com/digital-asset/daml/pull/6662#discussion_r455163515

* Document the jvm metrics namespace

* Document HikariCP metrics

* Fix title underline

Co-authored-by: Peter Garmaz <40190826+pgarmaz-da@users.noreply.github.com>
Co-authored-by: Gerolf Seitz <gerolf.seitz@daml.com>
2020-07-16 09:31:49 +00:00
Moritz Kiefer
882027f9d7
Stabilize DAML REPL (#6740)
changelog_begin

- [DAML REPL] DAML REPL has moved out of early access status and is
  now a stable feature of the SDK.

changelog_end
2020-07-15 14:46:30 +00:00
Moritz Kiefer
d6e5862645
Add platform-version field to daml.yaml (#6736)
* Add `platform-version` field to `daml.yaml`

This PR adds the `platform-version` field to `daml.yaml`. Based on the
approach agreed upon in #6558, the logic for this all sits in
`daml-helper` and there are no changes to the assistant.

The details of how the logic work are in a comment so I’m not going to
repeat them here but the commands that are affected are:

- `daml sandbox`
- `daml sandbox-classic`
- `daml json-api`
- `daml start` (but only for sandbox and the JSON API, not for
  Navigator or anything else)

For tests, I’ve added a test to the compat workspace that installs two
SDKs simultaneously and tries out various combinations and verifies
that we get the correct version. Open to other ideas for testing this
but that seemed like the most sensible option that actually tests what
we run.

changelog_begin

- [DAML Assistant] You can now specify the version of Sandbox and the
  JSON API independently of your SDK version by setting
  ``platform-version`` in your ``daml.yaml``. This is useful if you
  are deploying to a ledger that is running components from a
  different SDK version. See
  https://docs.daml.com/tools/assistant.html#project-config-file-daml-yaml
  for details.

changelog_end

* Run platform-version tests

changelog_begin
changelog_end

* Fix tag globbing

changelog_begin
changelog_end

* fmt

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

* Try to fix env vars

changelog_begin
changelog_end

* Remove hardcoded references to 1.2.0

changelog_begin
changelog_end

* Rephrase doc comment

changelog_begin
changelog_end

* get things to compile

changelog_begin
changelog_end

* maybe fix things for realz

changelog_begin
changelog_end

* Remove debugging output

changelog_begin
changelog_end

* Get angry at windows

changelog_begin
changelog_end

* why is windows

changelog_begin
changelog_end

* .

changelog_begin
changelog_end
2020-07-15 16:30:01 +02:00
Leonid Shlyapnikov
9abfff0388
Fixing typo in the JSON API error response (#6735)
changelog_begin
changelog_end
2020-07-15 09:23:40 -04:00
Gary Verhaegen
8176fb0c8d
fix the the typo (#6723)
```
s/the the /the /
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-14 16:55:33 +00:00
Moritz Kiefer
a0f9eae489
Respect project name in create-daml-app (#6694)
* Respect project name in create-daml-app

Now `daml new foobar create-daml-app` creates a project called
`foobar` replacing the name everywhere. The tests now run twice once
with the original project name since that’s what we use in the GSG and
once with a modified one. I guess you could argue that only running
the second should be enough so I’m open to removing the first one.

fixes #6681

changelog_begin

- [DAML Assistant] `daml new foobar create-daml-app` now properly
  respects the project name and creates a project called `foobar`
  instead of hardcoding the name fo `create-daml-app`.

changelog_end

* .

changelog_begin
changelog_end

* Remove debugging output

changelog_begin
changelog_end
2020-07-13 17:30:21 +02:00
Moritz Kiefer
ce2a8a5086
Reduce dependencies of live-preview script (#6703)
The intention was to pull in the source for the GSG but it turns out
that the templates tarball doesn’t just bundle up files, it also
includes generated scala code for the scala quickstart which depends
on damlc. This PR splits the GSG sources including the patching into a
separate rule which does not depend on damlc and only copies that in
live-preview.

changelog_begin
changelog_end
2020-07-13 12:31:56 +00:00
Stefano Baghino
31995ee000
Ledger API Test Tool: deprecate unneeded tests and options (#6651)
* Ledger API Test Tool: deprecate unneeded tests and options

Furthermore, now all active tests are now run be default without needing
to specify --all-tests. The scheduler makes sure to run non-isolated
tests last (and sequentially).

Fixes #3747
Fixes #6518

A bit of historical context: tests in the Ledger API Test Tool used to
be the sandbox integration tests. As part of the Ledger API Test Tool
project, those tests have been ported one-to-one, with little review of
those same tests.

Examining the tests that cause #3747, it became evident that those tests
were originally put in place to verify that an isolated sandbox spun up
for a single test could withstand a number of commands slightly lower
than what at the time was the hard-coded back-pressure threshold. Hence,
implementing back-pressure on the Ledger API Test Tool would have
basically negated the usefulness of those tests. Furthermore, those
tests can be easily passed by simply raising the back-pressure
threshold. As such, they do not convey any meaningful information for
the DAML ledger implementor. This means we are retiring those tests. The
tests will be nominally kept in for a deprecation period to not break
existing build scripts, but running them explicitly will simply show
them as skipped. The documentation has been updated with the information
necessary to users to deal with retired tests.

Since all tests are now run by default --all-tests is being deprecated.
--load-scale-factor is also deprecated as it was used only by
TransactionScaleIT.

changelog_begin
[Ledger API Test Tool] The LotsOfPartiesIT and TransactionScaleIT test
suite have been deemed not providing relevant signal to DAML ledger
implementers and have been retired. The tests will be nominally kept in
but will be skipped while they are in a deprecation period. You are
advised to remove explicit references to those tests before they are
fully removed.
[Ledger API Test Tool] All tests are now run by default. The --all-tests
option is now ineffective and deprecated. You are advised to remove its
usages from your build scripts. Non-isolated tests that could affect the
global state of the ledger and interfere with other tests are now
automatically scheduled by the test tool to run sequentially at the end
of the run.
[Ledger API Test Tool] The --load-scale-factor option is now unused and
deprecated. You are advised to remove its usages from your build
scripts.
changelog_end

* Add test for deprecated CLI options

* Address https://github.com/digital-asset/daml/pull/6651#discussion_r452100158

* Address https://github.com/digital-asset/daml/pull/6651#discussion_r452126405

* Address https://github.com/digital-asset/daml/pull/6651#discussion_r452143811

* Address test failures
2020-07-09 14:01:32 +00:00
Samir Talwar
28873913d9
Bazel: Upgrade Buildifier. (#6625)
Buildifier now comes with a handy attachment to catch single `\`
characters inside strings and replace them with `\\` if the escape
sequence is invalid. Skylark/Python will do this at runtime anyway; this
just makes it clearer what the actual behavior is.

I needed to change `\` characters at the end of lines to `\\` manually
in order to stop Buildifier from simply concatenating the lines
together. Everything else was automatic.

CHANGELOG_BEGIN
CHANGELOG_END
2020-07-06 16:07:47 +00:00
Nemanja
77c0b879e6
Copy code button (#6508)
* Copy code button

Added the sphinx copy code extension (https://sphinx-copybutton.readthedocs.io/en/latest/) to the docs. Tested with  and it worked.

CHANGELOG_START
CHANGELOG_END

* Remove vendored copy of sphinx_copybutton

changelog_begin
changelog_end

* remove debugging output

changelog_begin
changelog_end

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-06-29 12:34:40 +02:00
anthonylusardi-da
95213c4e74
FIX: Tiny typo (#6176) 2020-06-26 14:31:05 +00:00
Nemanja
848a19d207
Linking the cheat-sheet to the GSG (#6398)
Added a new section in the cheat-sheet for basic DAML concepts (there's anotehr PR for it). This PR links the cheat-sheet to the GSG. This was a requirement that came out of the user tests where testers said that they would like to have a quick overview of the most important DAML concepts explained (they found jumping through the glossary and the rest of the docs too complicated).

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-26 15:43:33 +02:00
Moritz Kiefer
9a4374829d
Always include GSG snippets in preview (#6511)
They are clearly useful and building the
tarball and extracting it is quick.

changelog_begin
changelog_end
2020-06-26 12:16:59 +00:00
Bernhard Elsner
3a12162117
Contract key docs update (#6401)
* Update Contract Key docs

CHANGELOG_BEGIN
CHANGELOG_END

* Contract Keys example

* Add Keys example to contract keys docs page

* Fix header year
2020-06-26 13:20:36 +02:00
Nemanja
c7c94ab70d
Feedback button (#6500)
* 'Thumbs up/down' and 'Feedback'  button fix

Changed the position of the 'Thumbs up/down' button to be in the bottom right corner above the 'Feedback' button. Added SASS to remove both buttons for mobile (as we were getting a lot of gibberish feedback

CHANGELOG_START
CHANGELOG_END

* 'Thumbs up/down' and 'Feedback'  button fix

Changed the position of the 'Thumbs up/down' button to be in the bottom right corner above the 'Feedback' button. Added SASS to remove both buttons for mobile (as we were getting a lot of gibberish feedback

CHANGELOG_START
CHANGELOG_END

* Putting some of the blocks where they were
2020-06-26 12:33:53 +02:00
Remy
6dc056bcc4
minor change in daml script doc (#6477)
The scenario service is not a public API, it can change without notice. Better to not speak about it.
2020-06-24 12:57:33 +00:00
Moritz Kiefer
97c74d4a29
Support multiple auth tokens in DAML Script (#6473)
* Support multiple auth tokens in DAML Script

This piggy backs on top of the already existing --participant-config
feature. While you can argue that it might be slightly confusing that
you have to specify the same participant twice to specify different
auth tokens, I think this actually makes sense: In an ideal
world (ignoring any performance issues) you have one participant per
party anyway and one connection per participant specified in the
config file still seems like a very reasonable model.

changelog_begin

- [DAML Script] You can now use DAML Script with multiple auth
  tokens. This is particularly useful if you are working with the JSON
  API where you can only have one party per token or with an IAM that
  only provides single-party tokens. The tokens are specified in the
  participant configuration passed via `--participant-config` in a new
  ``access_token`` field. The existing `--acess-token-file` flag is still supported if you want to use the same token for all connections. See
  https://docs.daml.com/daml-script/index.html#running-daml-script-against-authenticated-ledgers
  for more details.

changelog_end

* I will never understand rst

changelog_begin
changelog_end
2020-06-24 14:43:29 +02:00
Brian Healey
6ad3279bbd
upgrade elliptic version to address vulnerability (#6459)
* upgrade elliptic version to address vulnerability

* Revert "upgrade elliptic version to address vulnerability"

This reverts commit dbf19c32

* upgrade elliptic version to address vulnerability

CHANGELOG_BEGIN
CHANGELOG_END
Signed-off-by: Brian Healey <brian.healey@digitalasset.com>

* Use range for elliptic rather than specific version
2020-06-23 12:00:01 -04:00
Nemanja
87c17bb4e9
Yarn install workaround for noobs (#6426)
Noobs had a problem running yarn install v1.12.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.40s. second time around when they^ve changed the code. Simply put they would way too often (almost alqways) forget to include  when calling yarn install v1.12.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.34s.. This would be a very simple workaround that woould lead to them being aware from the very first step that there's the  parameter that needs to be called.

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-23 17:38:09 +02:00
Gary Verhaegen
fc5fa4c213
granular test selection, take 3 (#6458)
This is the final bit extracted from #6314. This PR adds the capability
to filter individual test cases (for either inclusion or exclusion)
while being completely backwards compatible. It also introduces a new
cli option, `--list-all`, to list all test cases, keeping the behaviour
of the existing `--list` option unchanged, i.e. only print test suites.

Unlike #6314, this is still building upon the idea of defining test
suites as maps, preserving the known-good order of tests and thereby not
introducing flakiness into our builds.

CHANGELOG_BEGIN

- [Ledger API Test Tool] ``--exclude`` and ``--include`` now match the
  full test name as a prefix, rather than just suite names. Test name is
built by combining the suite name with a test identifier, so this change
should be fully backwards compatible. Run with ``--list-all`` to list
all tests (as opposed to just the test suites with ``--list``).

CHANGELOG_END
2020-06-23 14:27:36 +02:00
Moritz Kiefer
0a8c1eba4e
Integrate time service into DAML Script (#6417)
This integrates the time service into DAML script thereby covering the
main piece of scenarios that was missing from DAML script.

This PR does two things (they are very related and doing them together
makes it much easier to test):

1. It “fixes” `getTime` to return the ledger time in static mode by
   querying the ledger time service instead of defaulting to the Unix
   epoch which is pretty useless and I would consider the old behavior
   a bug. We keep the old behavior via the JSON API since there is no
   time service.

2. It adds `setTime` to set the ledger time via the time service. This
   is only supported in static time mode (sadbonx and other ledgers do
   not expose the time service in wallclock mode because changing time
   makes it not wallclock) or via the JSON API (no time service).

fixes #6220

changelog_begin

- [DAML Script] DAML Script’s `getTime` now correctly handles time
  changes in static time mode and returns the current time by querying
  the time service rather than defaulting to the Unix epoch. Note that
  when run via the JSON API, it still returns the Unix epoch.

- [DAML Script] Add `setTime` to DAML Script which sets the ledger
  time via the ledger API time service. Note that this is only
  supported when running over gRPC in static time mode.

changelog_end
2020-06-18 18:25:24 +02:00