Does daml supports only java maven for building ledger client app?

Hi Team,

I have written a daml smart contract and deployed it in canton participant node. To interact with daml smart contract, I am going write the ledger client app using java bindings. Does the daml supports only maven project or supports both gradle and maven? Can you please provide any reference for how to create client app and how to query the ledger api (PQS)?

Hi Manu,

Thanks for the questions, and well done on getting your contract successfully deployed. I took these to be your questions, and please find the following answers:

Questions:

  1. Does the daml supports only maven project or supports both gradle and maven?
  2. Can you please provide any reference for how to create client app
  3. How do I query the ledger api (PQS)?

Daml supports building applications with both Maven and Gradle. The SDK provides templates and instructions for both build tools.

To create a client app, you can follow the Getting Started Guides (GSG): Java and JavaScript.

These both walk through initializing a project, connecting to a ledger, and querying contracts.

To directly query the ledger API:

  1. Initialize a LedgerClient using the ledger hostname/port
  2. Build a query using LedgerQuery and the desired template filter
  3. Submit the query using LedgerClient.queries
  4. Process the results which contain contract IDs and decoded data

Please review the full querying guide here.

The LedgerClient documentation also shows query examples.

Regarding PQS, please note the following to Install and start PQS:

  • A PostgreSQL database that can be reached from the PQS.
  • Note that PQS uses the JSONB data type for storing JSON data, which requires Postgres versions 11 through 16.
  • An empty database (recommended) to avoid schema and table collisions.
  • A Daml Ledger as the source of events. m/TLS is supported for the participant node ledger API. Alternatively, it can run against the Sandbox.
  • Installation of The Daml Enterprise SDK

To install the Daml Enterprise SDK you will need an Enterprise license which can be arranged by contacting Digital Asset.

Hope this helps.

The Ledger API is exposed as GRPC (and there is a JSON variant). This means you can use any language to build applications if you want, but depending on the language, the user experience may vary. We do have some client side tooling to represent contracts as data objects within two languages: java & typescript and most of our examples are using these, as these languages are very standard.