Commit Graph

150 Commits

Author SHA1 Message Date
Leonid Shlyapnikov
acb41c5829
Fetch by parties endpoint to use new getParties gRPC call (#5027)
* fetch by parties endpoint to use new getParties gRPC call

changelog_begin
changelog_end

* addressing code review comments, thanks @S11001001 and @SamirTalwar-DA

* Update ledger/ledger-api-client/src/main/scala/com/digitalasset/ledger/client/services/admin/PartyManagementClient.scala

thanks @S11001001

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

* addressing code review comments, thanks @S11001001 and @SamirTalwar-DA

* addressing code review comments, thanks @S11001001 and @SamirTalwar-DA

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-03-16 16:42:01 -04: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
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
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
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
Gary Verhaegen
75c7d48d5b
bind localhost for json-api and scenarios (#4576)
Both were previously binding 0.0.0.0, which is inherently insecure. More
importantly to me, that meant running `bazel test //...` essentially
rendered my computer unusable for however long it took (which is
_long_), as it kept popping up focus-stealing dialogs about whether or
not I wanted to trust "java" to open an incoming network connection.

The ScenarioService does not seem to have an existing setup for CLI args
and my Scala-fu is not good enough to add one, so I just changed the
hard-coded path.

The JSON API already had an option, just with the wrong default. This is
technically a breaking change, but I'm hoping to pass it under the
"experimental" flag we still have on the JSON API.

CHANGELOG_BEGIN
- [JSON API - Experimental] As a security improvement, the JSON API
server will now bind on ``127.0.0.1`` by default. Previous behaviour was
to bind on ``0.0.0.0``; you can get that behaviour back by passing in
the (existing) flag ``--address 0.0.0.0``.

- [DAML SDK] The Scenario Service will now bind on ``127.0.0.1``. Previous
behaviour was to bind on ``0.0.0.0``.

CHANGELOG_END
2020-03-05 17:10:49 +01:00
Leonid Shlyapnikov
f9057bea19
handle dual LiveBegin case (#4815)
* make append of two liveness markers proper with respect to offsets

- never happens in a real stream, but satisfying some random tests
- test randomly harder

CHANGELOG_BEGIN
CHANGELOG_END

* move Monoid and Semigroup instances for Steps to main code

- suggested by @leo-da; thanks

* stray empty InsertDeleteStep
2020-03-04 14:59:26 -05:00
mergify[bot]
a40190d695
minor cleanup, using Option.exists instead of cata. (#4812)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-04 18:10:04 +00:00
mergify[bot]
c001b4f22c
test that ContractStreamStep#append preserves data sensibly (#4809)
* test that ContractStreamStep#append preserves data sensibly

CHANGELOG_BEGIN
CHANGELOG_END

* (C) header

* test more general associativity
2020-03-04 17:59:02 +00:00
Leonid Shlyapnikov
e80cda53ab
Fix for unknown template ID received from gRPC streaming API (#4800)
* Filter out contracts received from gRPC stream, if template IDs is unknown (pending package reload).

* minor cleanup

CHANGELOG_BEGIN

[JSON API - Experimental] Fix ``java.util.NoSuchElementException: key not found: TemplateId(xxx,yyy,zzz)`` error in the log for query and fetch endpoints. See #4761

CHANGELOG_END
2020-03-04 08:21:06 +00:00
Leonid Shlyapnikov
a3228bcea8
A few more map query tests (#4798)
CHANGELOG_BEGIN
CHANGELOG_END
2020-03-03 18:02:58 +00:00
Samir Talwar
a99156252d
libs-scala/ports: Wrap socket ports in a type, Port. (#4784)
* libs-scala/ports: Wrap socket ports in a type, `Port`.

* sandbox: Use `Port` for the API server port, and propagate.

CHANGELOG_BEGIN
CHANGELOG_END

* extractor: Use `Port` for the server port.

* ports: Make Port a compile-time class only.

* ports: Allow port 0; it can be specified by a user.

* ports: Publish to Maven Central.
2020-03-03 08:59:15 +00:00
Leonid Shlyapnikov
93329ac81d
Add create-and-exercise JSON API endpoint (#4754)
* CreateAndExerciseCommand JSON decoding

* create-and-exercise endpoint WIP

* create-and-exercise endpoint + test, WIP

* create-and-exercise test

* Update docs

CHANGELOG_BEGIN

[JSON API - Experimental]
Add ``/v1/create-and-exercise`` JSON API endpoint. See #4507.

CHANGELOG_END

* Cleaning up domain JSON encoder/decoder, trying to get rid of HasTemplate

* Cleaning up domain JSON encoder/decoder, trying to get rid of HasTemplate

* Addressing code review comments
2020-03-02 20:43:58 +00:00
Leonid Shlyapnikov
d93e4382f6
Extract ErrorOps, use liftErr instead of leftMap (#4730)
* Extract ErrorOps, use liftErr instead of leftMap
JSON error formatting cleanup

CHANGELOG_BEGIN
CHANGELOG_END

* Good we have tests for this stuff

* Apply https://github.com/scala/bug/issues/3664 work-around,

so JsonError can be used instead of JsonError.apply

* error formatting
2020-02-26 20:06:26 +00:00
Shayne Fletcher
66dd112960
Remove pragma 'daml 1.2' (#4702)
changelog_begin
- The pragma 'daml 1.2' is now optional.
changelog_end
2020-02-26 13:17:45 -05:00
Stephen Compall
79c6ee7339
add offset to live events; remove liveness marker (#4593)
* move BeginBookmark to util

* adding offsets to steps

* offsetAfter belongs in Txn, not InsertDeleteStep

* make transaction stream a ContractStreamStep.Txn stream

* add several ContractStreamStep append cases

* rewrite 'render' to emit offset in the right places

* make ContractStreamStep#append total again

* check for offset in a few tests

* revert useless whitespace changes

* missed argument

* simpler mapPreservingIds

* rewrite states for new "live" format

* remove invalidated "events" block structure assertions

* make shutdown in withHttpService deterministic, to try to catch race condition

* exhaustiveness checking somehow disabled; fixed fetch flow and all is well

* documentation and changelog

CHANGELOG_BEGIN
- [JSON API - Experimental] Remove ``{"live": true}`` marker from websocket streams;
  instead, live data is indicated by the presence of an "offset".
  See `issue #4593 <https://github.com/digital-asset/daml/pull/4593>`_.
CHANGELOG_END

* be more specific about what liveness marker may be in docs

* fix daml2ts websocket tests

* mention type rules for all cases in offset documentation
2020-02-26 10:17:21 -08:00
Leonid Shlyapnikov
d58bb4597e
Extend /v1/parties endpoint to support fetch by party IDs (#4680)
* Extend /party endpoint to allow specifying party ids

* Extend /party endpoint to allow specifying party ids

* Update docs

CHANGELOG_BEGIN

[JSON API - Experimental] Fetch Parties by their Identifiers. See #4512
``/v1/parties`` endpoint supports POST method now, which expects
a JSON array of party identifiers as an input.

CHANGELOG_END

* minor update

* minor update

* Use type alias

* Add warnings to the sync response

* test cases

* update docs, add test case for an empty input

* cleanup

* cleanup

* Addressing code review comments
2020-02-26 15:24:01 +00:00
Samir Talwar
9bdfbb0534
Avoid opening a server to the world when finding a free port. (#4683)
* Avoid opening a server to the world when finding a free port.

This is very annoying on macOS because we get a focus-stealing popup for
a split second, asking for permission to allow the server through the
firewall. The popup pretty much always disappears before it can even be
read, when the server is closed.

This is almost certainly not an attack vector, because:
  - we only do this in tests,
  - the server is open for only a few milliseconds,
  - nothing is served,
  - and finding the port is tricky, because it's effectively random.

Nevertheless, it's very annoying.

CHANGELOG_BEGIN
CHANGELOG_END

* Extract a Bazel package for finding free ports.

We seem to do it in 4 different places, which I think is enough to
remove the duplication.
2020-02-25 13:09:28 +00:00
Samir Talwar
f231ebc1b3
Sandbox-Next: Re-establish static time support. (#4581)
* kvutils: Extract a committer from the uses of `SubmissionValidator`.

This makes the clock injectable too.

* kvutils: Provide logging contexts in the `Runner`.

* sandbox: Remove the `StaticAllowBackwards` time provider type.

It's not used anywhere.

* sandbox: Fix warnings in CliSpec.

* sandbox: Ensure that we cannot specify both static and wall-clock time.

* sandbox-next: Crash if wall clock time is not specified.

* sandbox-next: Document more known issues in the new Sandbox.

* sandbox: Add a Clock (and some tests) to TimeServiceBackend.

* sandbox-next: Support static time.

CHANGELOG_BEGIN
- [Sandbox Next] Re-establish static time mode.
CHANGELOG_END

* ledger-on-(memory|sql): Expect a `() => Instant`, not a `Clock`.
2020-02-18 17:03:15 +00:00
Stephen Compall
eee815d3c3
json-api: add live-data boundary marker to WS contract streams (#4465)
* Inserts alias

* ContractStreamStep, extending InsertDeleteStep with a boundary

* partitionBimap, an IDS utility for partitionMap on both inserts and deletes

* make the flow setup of acsFollowingAndBoundary a little clearer

* use partitionBimap to simplify websocket response stream

* make the flow setup of transactionsFollowingBoundary a little clearer

* acsFollowingAndBoundary becoming a ContractStreamStep producer

* insertDeleteStepSource also becomes a ContractStreamStep producer

* porting StepAndErrors to ContractStreamStep

* remove Acs constructor of ContractStreamStep

- it's an interesting idea for future potential features, but not useful
  right now so just a needless complication

* adapt convertFilterContracts to presence of LiveBegin marker

* adapt removePhantomArchives to presence of LiveBegin marker

* test that live marker is emitted in the right place

* document liveness marker

* add changelog

CHANGELOG_BEGIN
- [JSON API - Experimental] Add ``{"live": true}`` to WebSocket streams
  to mark the beginning of "live" data.  See `issue #4461
  <https://github.com/digital-asset/daml/issues/4461>`_.

  This marker is a placeholder feature; `issue #4509 bookmarks in query
  streams <https://github.com/digital-asset/daml/issues/4509>`_ will
  obsolete this marker, after which it will no longer be emitted.  When
  building features on the marker, be aware of this forthcoming
  replacement.
CHANGELOG_END

* be a little more prepared for offsets
2020-02-14 10:41:41 -05:00
Samir Talwar
a589f4af0b
sandbox: Move more resource acquisition into the owner. (#4501)
* sandbox: Move more resource acquisition into the `owner`.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Reimplement SandboxClientResource as a resources.Resource.

* codegen: Use resources in TestUtil.

* sandbox: Manage PostgreSQL in tests with ResourceOwners.
2020-02-14 13:52:45 +00:00
Leonid Shlyapnikov
53b95ecb20
Expose total functions behind the endpoint mappings for DABL to re-use (#4462)
* Extract partial functions for DABL to re-use

CHANGELOG_BEGIN
CHANGELOG_END

* Actually DABL needs total functions,

they will map them to different endpoints
2020-02-10 15:00:03 -05:00
Leonid Shlyapnikov
a194ce2a34
Wrap streaming API events in JSON object (#4453)
* Wrap streaming API events in json object

CHANGELOG_BEGIN

[JSON API - Experimental] wrap Streaming API events in JSON object:
   ``{ "events": [ E1, E2, ... ] }``
   See: 4384

CHANGELOG_END

* cleanup
2020-02-07 17:17:42 -05:00
Leonid Shlyapnikov
98ab189e3e
Encode tuples as records in the JSON API docs, add a new test (#4452)
tuples are formatted as records in the response, so this way input format
matches the output

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-07 13:46:36 -05:00
Stephen Compall
8710673e71
with archived responses from WS streams, include template ID alongside contract ID (#4439)
* move InsertDeleteStep to util

* turn append cid argument into a typeclass

* use Cid for appendForgettingDeletes as well

* add secondary data to the deletes in InsertDeleteStep with new covariant tparam

* make StepAndErrors hold ArchivedContracts so ws archives look like exercise archives

* add changelog

CHANGELOG_BEGIN
- [JSON API - Experimental] The format of ``archived`` responses from WebSocket endpoints
  has changed to include template IDs, similar to exercise responses.
  See `issue #4383 <https://github.com/digital-asset/daml/issues/4383>`_.
CHANGELOG_END
2020-02-07 11:24:15 -05:00
Leonid Shlyapnikov
fcc2545a23
Make WebsocketConfig public, so DABL can use it (#4446)
WebSocketService is already public. This does not mean that the interfaces
are stabilized.

CHANGELOG_BEGIN
CHANGELOG_END
2020-02-07 15:56:21 +00:00
Leonid Shlyapnikov
fb6d8afd1f
Rename JSON API endpoints, add version prefix (#4440)
* Rename JSON API endpoints, add version prefix. Combining two breaking changes.

CHANGELOG_BEGIN

[JSON API - Experimental] Rename JSON API endpoints. See #4289 and #3145
    /command/create => /v1/create
    /command/exercise => /v1/exercise
    /contracts/lookup => /v1/fetch
    /contracts/search => /v1/query
    /contracts/searchForever => /v1/stream/query
    /contracts/lookupForever => /v1/stream/fetch
    /parties => /v1/parties

CHANGELOG_END

* minor update

* fix typo in the logging

* experimental disclosure update

* experimental disclosure update

* experimental disclosure update
2020-02-06 16:30:47 -05:00
Stephen Compall
2a2479a3fd
rename "contracts" to "events" in JSON API exercise response (#4436)
* rename "contracts" to "events" in JSON API exercise response

CHANGELOG_BEGIN
- [JSON API - Experimental] Exercise response field "contracts" renamed to "events".
  See `issue #4385 <https://github.com/digital-asset/daml/issues/4385>`_.
CHANGELOG_END

* more events in doc

- pointed out by @leo-da; thanks
2020-02-06 20:13:46 +00:00
Leonid Shlyapnikov
0583f57de6
Fetch by key stream test and doc (#4393)
* Remove phantom archive when streaming events filtered by contract key

* Add fetch test cases, WIP

* Add fetch test cases, WIP

* Add fetch test cases, WIP

* Add fetch test cases, WIP

* Test case to validate phantom archive filter for stream/fetch

* Use `scan` instead of `statefulMapConcat` to filter out phantom archives

advantage(???) immutable state vs mutable

* make `com.digitalasset.http.WebsocketEndpoints.handleWebsocketRequest` public

so DABL can call it directly, `private[http]` does not work since DABL
is under com.projectdabl, see #4190

* Fixing typos

* Scalafmt

* Scalafmt

* Removing unused function

* Update docs

* Remove unused type alias

* CHANGELOG_BEGIN

[JSON API - Experimental]
- Added streaming version of fetch by key: ``/stream/fetch``. See #4075.

CHANGELOG_END

* Address code review comments

* Add test case with todo to address consistent handling of empty requests

* Fixing merge conflicts

* Addressing code review comments

* Addressing code review comments

Use `partition` instead of consecutive intersect and diff
2020-02-06 18:45:53 +00:00
Leonid Shlyapnikov
c15cf3457e
CHANGELOG_BEGIN (#4434)
[JSON API - Experimental]
Added a command line option to allow overriding default TTL.
``--default-ttl <value>`` Optional Time to Live interval to set if not provided in the command. Examples: 30s, 1min, 1h. Defaults to 30 seconds

CHANGELOG_END
2020-02-06 12:36:36 -05:00
Stephen Compall
b85637115f
accept a list of {templateIds, query} as input to searchForever (#4363)
* add SearchForeverRequest with one-or-many JSON model

* the least structured way to flatten a query union into a single stream

* add somewhere for indices to go in StreamQuery

* unzipMap utility

* doc Positive

* collect indices for SearchForever predicate, and use only one Map

* interface for rendering positions

* finish propagating positives from the predicate to the rendering phase

* add matchedQueries to every `created` in the searchForever results

* test that matchedQueries indices are included in query stream blocks

* document query union

* add changelog

CHANGELOG_BEGIN
- [JSON API - Experimental] ``/contracts/searchForever`` accepts multiple queries,
  and includes with each ``created`` result the ``matchedQueries`` indicating which
  queries matched.
  See `issue #4363 <https://github.com/digital-asset/daml/pull/4363>`_.
CHANGELOG_END

* remove unused unzipMap
2020-02-06 10:23:38 -05:00
Stephen Compall
1c8bb9968a
ensure archive of a key happens to left of create of same key in each WebSocket result block (#4390)
* ensure archive of a key happens to left of create of same key in each WebSocket result block

CHANGELOG_BEGIN
- [JSON API - Experimental] In websocket endpoints, if a 'created' and 'archived' contract
  in the same result array share a contract key, the 'archived' is guaranteed to occur
  earlier in the array than the 'created'.
  See `issue #4354 <https://github.com/digital-asset/daml/issues/4354>`_.
CHANGELOG_END

* by key I mean contract key

- suggested by @hurryabit; thanks
2020-02-04 15:59:13 -05:00
Leonid Shlyapnikov
a754a2aa22
Add fetch by key websocket stream, part 1 of 2 (#4212)
* Add fetch by key stream websocket stream, WIP

* Add fetch by key stream websocket stream, WIP

* new formatting rules

* minor documentation cleanup

* refactoring required for the `lookupForever` stream

* Extracted `StreamQuery` typeclass

* Extracted `StreamQuery` typeclass

* Fix typo

* minor cleanup

* Using polymorphic `A: WebSocketService.StreamQuery` to get `lookupForever` functionality

* Remove unused methods

* Cleanup

* cleanup

* cleanup

* Merge remote-tracking branch 'origin/master' into leo-4075-fetch-by-key-stream

# Conflicts:
#	ledger-service/http-json/src/main/scala/com/digitalasset/http/WebSocketService.scala

* Rename the endpoint so it is compliant with #4289

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-31 21:49:45 +00:00
Stephen Compall
7882080207
warn on unknown template IDs in searchForever (#4312)
* in searchForever, warn on unknown template IDs as long as at least one is known

* remove unused resolveTemplateId

* factor out WS request parts in WS integration test

* factor out IOU create

* test early template ID warning in searchForever stream

* document warnings case for searchForever

CHANGELOG_BEGIN
- [JSON API - Experimental] Precede stream with warnings of unknown template IDs, if any,
  rather than failing outright.
  See `issue #4290 <https://github.com/digital-asset/daml/issues/4290>`_.
CHANGELOG_END
2020-01-30 16:13:40 -05:00
Leonid Shlyapnikov
9f57994f2d
Fix the case when start offset > end offset (#4283)
* Fix the case when start offset > end offset

Actually skip the call completely, all needed data supposed to be
already in the query-store, fetched by a concurrent thread/client.
Moving the check into the `getCreatesAndArchivesSince` call

CHANGELOG_BEGIN
CHANGELOG_END

* Remove flaky, want to see the test failing.

* reformat

* Add AbsoluteOffsetOrdering so we can handle both offset formats

* Code review comments

* generators WIP

* generators WIP

* testing the laws

* remove `implicitly` call
2020-01-30 15:35:59 -05:00
Stephen Compall
ca5c646406
test that step conflation yields consistent results with unconflated streams (#4253)
* test that step conflation yields consistent results with unconflated streams

CHANGELOG_BEGIN
CHANGELOG_END

* check that relevant right deletes are definitely included

* use a smaller set of potential Cids to have better overlap testing
2020-01-30 12:55:40 -05:00
Leonid Shlyapnikov
cb465837ef
Fixing package reload scheduling, thanks @lima-da for providing the fix (#4254)
CHANGELOG_BEGIN

[JSON API - Experimental]
Fixing package reload scheduling. The bug was introduced when upgraded
to the most recent Akka library. Also using `scheduleWithFixedDelay` and
awaiting for the reload future to complete. This is to guarantee that we
don't trigger multiple reloads simultaneously. Package reload is
thread-safe though.

CHANGELOG_END
2020-01-30 10:46:38 -05:00
Andreas Herrmann
87b84772ab
Mark //ledger-service/http-json:tests as flaky (#4282)
Latest failure
https://dev.azure.com/digitalasset/daml/_build/results?buildId=30191&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=f58be928-45a1-58e7-c1ad-04869565b3f4&l=6805

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-30 13:22:32 +00:00
Leonid Shlyapnikov
4be77fd889
Temporary work-around, can't reproduce locally: LedgerBegin > LedgerEnd (#4271)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-29 15:29:17 -05:00
Samir Talwar
4d324f6aaf
Run scalafmt on all files and fix the errors. (#4260)
Unfortunately, downgrading `scalafmt` resulted in files that would be
reformatted to invalid code, because lines would be merged but trailing
commas would be left in.

I've manually run it everywhere and fixed these issues so people don't
have to fix them as they go.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-01-29 16:15:49 +00:00
Stephen Compall
d6a20cba34
Avoid ending at different ledger ends for multi-template-ID queries (#4153)
* make searchInMemory do only one transaction stream

* drop unneeded deletes from memory while doing searchInMemory

* remove unused functions

* rename OffsetBookmark to BeginBookmark

* add AtAbsolute option to GetCreatesAndArchivesSince

* add GetTermination raw command

* propagate GetTermination to ContractsFetch

* remove fetching from searchDbOneTpId_

* fetch multiple contract IDs for DB persistence always to a fixed offset

* bugfix and cleanup; no changelog relevant

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-28 17:50:18 -05:00
Leonid Shlyapnikov
231b9c6394 Change Exercise by Key to send ExerciseByKeyCommand (#4209)
instead of lookup by key + ExerciseCommand with retrieved contract ID.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-24 17:59:47 +00:00
Samir Talwar
f3f7def5d2
postgresql-testing: Extract PostgresAround from the Sandbox t… (#4197)
* postgresql-testing: Extract `PostgresAround` from the Sandbox tests.

CHANGELOG_BEGIN
CHANGELOG_END

* postgresql-testing: Split into several files.

* postgresql-testing: Pull out the host and database names into variables.

* postgresql-testing: Don't publish to Maven.

I have no idea why the build wasn't failing before.

* postgresql-testing: Assimilate the `@postgresql_dev_env` dependency.
2020-01-24 12:48:36 +01:00
Leonid Shlyapnikov
9ab419f96b CHANGELOG_BEGIN (#4192)
[JSON API - Experimental] Rename ``argument`` field to ``payload`` in the ``command/create`` request. See #4189.

CHANGELOG_END
2020-01-24 09:04:03 +01:00
Leonid Shlyapnikov
78b29852d3
JSON API documentation update (#4173)
Document error handling

Document query store

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 14:54:12 -05:00
Robert Autenrieth
3f95c2ec13
Change sandbox JWT format (#4070)
* Introduce new JWT payload format
... the reader still supports old formats

CHANGELOG_BEGIN
[Sandbox] The sandbox uses a new payload format for authentication tokens (JWTs).
          The old format is deprecated, but still works.
[JSON API] The HTTP JSON API now uses the same payload format for authentication tokens as the sandbox.
           The old format is deprecated, but still works.
CHANGELOG_END

* Add helper function for getting token party

* Support sandbox tokens in JSON API

* Add warning for deprecated formats

* Update documentation

* Add explicit test for new format

* Update JSON API documentation

* Fix test
2020-01-22 14:26:57 +01:00
Leonid Shlyapnikov
c8c55c4408
Exercise by key (#4049)
* Implement exercise by key

ExerciseCommand got a new required element: `reference` of polymorphic type.

* Add test case: exercise Archive by contractKey

* Add test case for ExerciseCommand JSON protocol

* flatten contract reference in ExerciseCommand JSON protocol

* formatting

* Update exercise by key

* Update documentation

CHANGELOG_BEGIN

- [JSON API - Experimental] Support Exercise by Key. See #4009.

CHANGELOG_END

* Address code review comments
2020-01-18 09:06:52 -05:00
Stephen Compall
3d183b7f3e
for searchForever, use a similar response format to exercise results (#4078)
* for searchForever, use a similar response format to exercise results

CHANGELOG_BEGIN
- [JSON API - Experimental] Response format in ``searchForever`` changed to be more like ``exercise``.
  See `issue #4072 <https://github.com/digital-asset/daml/issues/4072>`__.
CHANGELOG_END

* typo left from add->created replacement

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-01-17 15:44:25 -05:00
Stephen Compall
0520fdfa84
in query argument, rename %templates to templateIds, and nest query under 'query' field (#4082)
* in query argument, rename %templates to templateIds, and nest query under 'query' field

CHANGELOG_BEGIN
- [JSON API - Experimental] In 'search' endpoint arguments, %templates is now templateIds.
  Additionally, all contract query fields must occur under 'query'.
  See `issue #3450 <https://github.com/digital-asset/daml/issues/3450>`__.
CHANGELOG_END

* fix other old query format usages
2020-01-17 14:34:27 -05:00