daml

Error with Starting the Sandbox for the DAML Quickstart Tutorial

感情迁移 提交于 2020-01-06 08:43:37
问题 I am getting an error when I try to launch the sandbox for the DAML SDK Quickstart tutorial. Can anyone help? Please see the error below. Cecils-MacBook-Pro:quickstart cezjah$ da run sandbox -- --port 7600 --scenario Main:setup target/daml/* ____ ____ / __/__ ____ ___/ / / ___ __ __ _\ \/ _ `/ _ \/ _ / _ \/ _ \\ \ / /___/\_,_/_//_/\_,_/_.__/\___/_\_\ Initialized sandbox version 6.0.0 with ledger-id = sandbox-e6f662a6-c492-4ca7-a3ab-5514eb897f50, port = 7600, dar file = DamlPackageContainer

Doing CRUD on the DA Ledger through a gRPC client

喜夏-厌秋 提交于 2020-01-05 08:36:12
问题 I am in the process of writing a DA Ledger client application. It's going slow because the API documentation does not explain how to combine the provided services to do simple Create, read, update, and delete on the Ledger. For example there is no simple service that allows the client to read all contacts from a given party directly. First the client needs to get the ledger id, and then (I think) the package id. etc. There is a service to read active contracts, but what about inactive

Trouble using the getTime function

若如初见. 提交于 2020-01-04 14:18:13
问题 I am using getTime inside an assert statement on a contract choice as follows: Add_Car : CarId with startCoverage: Time do -- Check for a legal start date assert ( startCoverage > getTime ) create this with datetime_vehicle_added = startCoverage, covered=True It generates an error: error: * Couldn't match expected type `Time' with actual type `m0 Time' * In the second argument of `(>)', namely `getTime' In the first argument of `assert', namely `(startCoverage > getTime)' In a stmt of a 'do'

Syntax errors in Main.daml

僤鯓⒐⒋嵵緔 提交于 2019-12-23 22:01:37
问题 My Main.daml code is as follows: daml 1.2 module Main where type CarId = ContractId Car -- for return type on controller actions template Car with dealer : Party insurer : Party vin: Text date_vehicle_added: Date daily_insurance_rate: Decimal daily_rate_APD: Decimal covered: Bool --initialize to false and set to true when added observers : [Party] where signatory dealer agreement toText dealer <> " agrees to pay " <> toText insurer <> " at daily rate of " controller dealer can Add_Car : CarId

Using the DAML Ledger API from a language other than Java or JavaScript

血红的双手。 提交于 2019-12-11 04:34:57
问题 I would like to write an application that interacts with the DAML ledger but as of the SDK 0.11.3 the only documented bindings are for Java and JavaScript. Is there a way to use the Ledger API from other languages? 回答1: The Ledger API is a set of services exposed through gRPC, which uses Protocol Buffers as its own interface definition language. The bindings documented as part of the SDK build on top of the code generated from gRPC to offer more features and a more idiomatic API. You can

How do I extract the components of a tuple in DAML?

守給你的承諾、 提交于 2019-12-10 19:24:09
问题 Given a pair in DAML, e.g. constructed by (1, "test") , how can I get the first and second components out? 回答1: Given a DAML pair x of type (Int, Text) , you can get the first component ( 1 in your example) using the selector x._1 or the fst function as fst x . You can get the second component ( "test" in your example) with x._2 or snd x . The x._1 selector works on all tuples (pairs, triples and beyond), while fst only works on pairs. The function fst3 (and snd3 , thd3 ) are available in DA