Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record Nick's comments on hs ledger bindings #2340

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion language-support/hs/bindings/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# Usage

Using the ledger bindings outside of this repository can be a bit
There is currently no separate documentation for the haskell ledger bindings,
over and above the existing ledger API doc.

The [.proto files](/ledger-api/grpc-definitions/com/digitalasset/ledger/api/v1)
are the best primary source of truth for the API. The [Haskell
bindings](/language-support/hs/bindings/src/DA/Ledger/Services) match closely
the names of the services and RPCs, but of course you get much better
[types](/language-support/hs/bindings/src/DA/Ledger/Types.hs).

The entry point is at [DA.Ledger](/language-support/hs/bindings/src/DA/Ledger.hs).

To use the bindings **in this repo**, you need the following `BUILD` dep:
```
"//language-support/hs/bindings:hs-ledger",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make the in this repo part bold and maybe point out explicitly that this is only for this repo since I don’t expect that most people will use it in the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I've also switched the order, which I believe reads better as a logical sequence: how the code is structured, how to use in repo, how to use out of repo. (As opposed to previous commit which had how to use outside, how code is structured, how to use inside.)

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

You can find some usage examples
[here](/language-support/hs/bindings/test/DA/Ledger/Tests.hs) and
[here](/language-support/hs/bindings/examples/chat/src/DA/Chat/ChatLedger.hs).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link is broken for me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be /language-support/hs/bindings/examples/chat/src/DA/Ledger/App/Chat/ChatLedger.hs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #2349.


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.

Expand Down