daml/language-support/hs/bindings
Moritz Kiefer 8f587dc456
Use per-test parties in HS ledger bindings tests (#2481)
* Use per-test parties in HS ledger bindings tests

This should hopefully solve the flakiness issues caused by the reset
service. For now, there is a very small number of tests that we run on
an isolated sandbox namely the tests for party management and package
management.

* shut up hlint

* Disable reset tests
2019-08-12 12:56:18 +02:00
..
examples Hlb apps package discovery (#2455) 2019-08-08 16:50:17 +01:00
src/DA Hlb apps package discovery (#2455) 2019-08-08 16:50:17 +01:00
test Use per-test parties in HS ledger bindings tests (#2481) 2019-08-12 12:56:18 +02:00
build_packages.sh Supporting producing sdist tarballs for the HS ledger bindings (#2336) 2019-07-30 14:34:16 +02:00
BUILD.bazel Use per-test parties in HS ledger bindings tests (#2481) 2019-08-12 12:56:18 +02:00
daml-ledger.cabal Supporting producing sdist tarballs for the HS ledger bindings (#2336) 2019-07-30 14:34:16 +02:00
README.md hs-bindings readme: fix link (#2349) 2019-07-31 14:22:01 +01:00

Usage

There is currently no separate documentation for the haskell ledger bindings, over and above the existing ledger API doc.

The .proto files are the best primary source of truth for the API. The Haskell bindings match closely the names of the services and RPCs, but of course you get much better types.

The entry point is at DA.Ledger.

To use the bindings in this repo, you need the following BUILD dep:

"//language-support/hs/bindings:hs-ledger",

And then you can import the DA.Ledger module in your Haskell code.

You can find some usage examples here and here.

Using these bindings outside of this repository can be a bit tricky since there are quite a few packages required that are not published to Hackage at the moment.

To make things a bit easier there is a build_packages.sh script in this directory that you can run as follows: ./build_packages.sh TARGET_DIR. This will build the tarballs for all cabal packages and put them in TARGET_DIR. If TARGET_DIR does not already contain a cabal.project file, it will also create a cabal.project file that references the created tarballs so all dependencies should be resolved properly. You will also need to install gRPC 1.22, see https://github.com/grpc/grpc/blob/master/BUILDING.md for installation instructions. If you install it in a non-standard location, you need to adjust extra-lib-dirs and extra-include-dirs for grpc-haskell-core. The default cabal.project file contains an example of how to do this.

The main package for the ledger bindings is called daml-ledger.