daml/language-support/hs/bindings
2019-08-01 22:24:54 +01:00
..
examples improve haskell module hierarchy to be more consistent (#2319) 2019-07-29 15:55:55 +01:00
src/DA hlb, reformat all the types (#2369) 2019-08-01 22:24:28 +01:00
test hlb, cleanup daml used for tests (#2370) 2019-08-01 22:24:54 +01:00
build_packages.sh Supporting producing sdist tarballs for the HS ledger bindings (#2336) 2019-07-30 14:34:16 +02:00
BUILD.bazel hlb, cleanup daml used for tests (#2370) 2019-08-01 22:24:54 +01: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.