Improve wording for the active contracts service description (#10880)

* Improve wording for the active contracts service description

This should eliminate sources of confusion as mentioned here: https://discuss.daml.com/t/offset-is-null-while-getting-active-contracts/3118

changelog_begin
[Docs] Improved description of the purpose and usage of the active contracts service
changelog_end

* Address https://github.com/digital-asset/daml/pull/10880#pullrequestreview-754078207

* Remove sand-which.
This commit is contained in:
Stefano Baghino 2021-09-15 10:27:40 +02:00 committed by GitHub
parent c12f546774
commit 9093c6c7b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,9 +157,9 @@ You can get these included in requests related to Transactions by setting the ``
Active contracts service
========================
Use the **active contracts service** to obtain a party-specific view of all contracts currently active on the ledger.
Use the **active contracts service** to obtain a party-specific view of all contracts that are active on the ledger at the time of the request.
The active contracts service returns the current contract set as a set of created events that would re-create the state being reported. Each created event has a ledger offset where it occurs. You can infer the ledger offset of the contract set from the ledger offset of the last event you receive.
The active contracts service returns its response as a stream of batches of the created events that would re-create the state being reported (the size of these batches is left to the ledger implementation). As part of the last message message, the offset at which the reported active contract set was valid is included. This offset can be used to subscribe to the "flat transactions" stream to keep a consistent view of the active contract set without querying the active contract service further.
This is most important at application start, if the application needs to synchronize its initial state with a known view of the ledger. Without this service, the only way to do this would be to read the Transaction Stream from the beginning of the ledger, which can be prohibitively expensive with a large ledger.