daml/ledger/ledger-on-sql
Samir Talwar 8f94cffdd1
kvutils: Use VersionedOffsetBuilder where possible, and introduce VersionedOffsetMutator. [KVL-1154] (#11277)
* kvutils: Remove `VersionedOffsetBuilder.apply`.

Doesn't do anything.

* ledger-on-memory: Use `VersionedOffsetBuilder`.

* indexer-benchmark: Use `VersionedOffsetBuilder`.

* ledger-on-sql: Use `VersionedOffsetBuilder`.

* kvutils: Use `VersionedOffsetBuilder` in tests.

* kvutils: Create a case class for `VersionedOffsetBuilder#split`.

* kvutils: Delete unused methods from the offset builders.

* kvutils: Use `Bytes#startWith` to check the offset version.

* kvutils: Move offset splitting into `VersionedOffset`.

* kvutils: Extract out versioned offset generators.

* kvutils: Replace `OffsetBuilder` with `VersionedOffsetMutator`.

This takes care of the last usages of `OffsetBuilder`, which were to
modify the lowest component of the offset.

CHANGELOG_BEGIN
CHANGELOG_END

* kvutils: Randomize the offset version in testing.

To make sure we don't use a hard-coded offset version anywhere.

* kvutils: `Random.between` is not available in Scala 2.12.

* kvutils: Move offset mutation methods to `VersionedOffset`.

* kvutils: Move the versioned offset construction into `VersionedOffset`.

The `VersionedOffsetBuilder` is still useful as it remembers the
version, meaning we only need to specify it once.
2021-10-18 16:50:52 +00:00
..
src kvutils: Use VersionedOffsetBuilder where possible, and introduce VersionedOffsetMutator. [KVL-1154] (#11277) 2021-10-18 16:50:52 +00:00
BUILD.bazel DPP-463 switch conformance tests to append only (#11101) 2021-10-11 23:31:30 +02:00
hash-migrations.sh update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
README.md ledger-on-sql: Use random log entry ID allocation so we don't depend on SeedService. [KVL-1002] (#10255) 2021-07-13 17:10:30 +00:00

Ledger on SQL

This is an implementation of a ledger using kvutils on top of an SQL database. Currently, it can be run on top of H2, PostgreSQL, or SQLite.

The code under src/main implements the logic, using kvutils. This code is production-ready and used by Sandbox.

The code under src/app is a trivial application front-end to the ledger that spins it up, along with a Ledger API Server. This is not intended to be used in production, and is currently only used in testing.