Daml Repl With Finance Library

Hello everybody!

Today I’m trying to run daml repl tool against the ledger with Finance Library inside. Here is my command:

daml repl /canton/csd/models-0.0.1.dar --ledger-host ledger --ledger-port 5011 

I run it inside container (image: digitalasset/daml-sdk:2.5.0-snapshot.20221010.10736.0.2f453a14). My ledger is running inside another one (image: digitalasset/canton-open-source:dev). Here is what I receive:
Targeted LF version 1.14 but dependencies have newer LF versions: 3e8e24958c0a9edcb2ed680cc234ea4538b10ae16cb98241096fe2488bd3c724 (daml-finance-interface-types-0.1.3): 1.15, 412c6a4b9f09b267e8c19c7191c5d3a2823e46c35b2b261c9f993d7c377f7723 (daml-prim-412c6a4b9f09b267e8c19c7191c5d3a2823e46c35b2b261c9f993d7c377f7723): 1.15, 48c2aab4fba8dd64c1e4655a515eddce649851c92a508f0f43a062d1fe34ce0a (models-0.0.1): 1.15, 4a092204ceb039248e1117f8e7bb943dabcf565e189bb137322714977b1fb173 (daml-stdlib-4a092204ceb039248e1117f8e7bb943dabcf565e189bb137322714977b1fb173): 1.15, 80730c99080e1324ebc6bfce5b5df66e6bbfc05858631852ae971c4f623bf41f (daml-finance-interface-holding-0.1.3): 1.15, a389340273a0dee2ebfbd64e15446add5d87719f910da325a2d9c6c537dceb41 (daml-stdlib-a389340273a0dee2ebfbd64e15446add5d87719f910da325a2d9c6c537dceb41): 1.15, b07797b054870e3b4e527efb44610e40c8420ce7d8876925779b99ecbd89f156 (daml-script-2.4.0): 1.15, c3158fcc90f657fc9fd25bd848d79cfdbd7d03e0a5177883f28a6f6de6f94258 (daml-finance-interface-util-0.1.3): 1.15, df4a971347f2b054af9b74cdf9014ae78d3273b1e4aa153dacf4bc2a0faaa652 (daml-finance-interface-settlement-0.1.3): 1.15, fc7e83c7a3ddcc01c2d7a77fa18f607de0e1fe91a0df7071e822454e3bab2fc6 (daml-finance-interface-instrument-base-0.1.3): 1.15

I see that daml repl has --ghc-option parameter. But I didn’t find a way to solve the problem with it.

What I want to do is to inspect the ledger with Daml Script commands. Is it possible with Fin Lib inside the ledger? I can inspect it with Canton console directly - it is working fine.

Thanks!

1 Like

Hi @VictorShneer,

Daml Finance compiles to Daml LF 1.15, which will be marked stable with the 2.5.0 release.

Projects (in this case models-0.0.1) are still using LF 1.14 by default, which should explain the error message you see.

Could you try to add the following to your daml.yaml file?

build-options:
  - --target=1.15

Matteo

@Matteo_Limberto hmm. The thing is that I have this line in daml.yaml

build-options:
  - --target=1.15

So when I test my models with the Sandbox it is working fine. Then I load the same dar file to the Canton participant and for some reason, this line doesn’t take action. I’ll investigate more and come back! Thanks! :thinking:

Hi, Matteo!

I still have this problem.
I have this line in my daml.yaml

build-options:
  - --target=1.15

So when I build dar and then upload
daml ledger upload-dar /canton/csd/models-0.0.1.dar --host ledger --port 5011

It is working fine. But when I try to run daml repl:
daml repl /canton/csd/models-0.0.1.dar --ledger-host ledger --ledger-port 5011

It is failing with this:
Targeted LF version 1.14 but dependencies have newer LF versions: 039aa24eacce8fc1108f77fe814d9336ab2dcf2e35c41932cc66c5f86fc99548 (daml-finance-interface-types-date-1.0.0): 1.15, 30e810720119f9c9790bfcf623aab3f1fb9d3206b7c19ba26485a67f14b12c0c (daml-finance-interface-instrument-token-1.0.0): 1.15, 361a5742b581d2d0dc1378f905a7f0ff692d3eb0d79b9fde51e34390813cf7d4 (daml-finance-interface-types-common-1.0.0): 1.15, 3622d3c3f5a78a06457a2811ebd4efac21a8f79842f951e92460294b5339658a (daml-stdlib-3622d3c3f5a78a06457a2811ebd4efac21a8f79842f951e92460294b5339658a): 1.15, 373828d61ed38318304f35dbd2cf6c49d498c48c7baeea31cfa5f30cabef018a (daml-finance-account-1.0.0): 1.15, 3d252b7c54065188ec34d1ae7051d1e65fc13040eb88dde68db22699bcb91a2c (daml-finance-util-1.0.0): 1.15, 4a7548db0fc06e49f7ea5d667f6a7fb690ab1db28cc67042b2b0d51dc009b9f4 (daml-script-2.5.0): 1.15, 4b5bf7a6465e5e11800a03c131a5759565edd3ff9cfc43f41d1f7fbc72255587 (daml-finance-interface-settlement-1.0.0): 1.15, 615590cf0b4e5ea01cb08ef577e43d6cfcd816be060ac7a540a100c3f00b11b2 (daml-finance-interface-account-1.0.0): 1.15, 69c351297fe13bd63fefc797a1d7829032e60caf06fc37bec5869900e44020e8 (daml-finance-instrument-token-1.0.0): 1.15, 6df2d1fd8ea994ed048a79587b2722e3a887ac7592abf31ecf46fe09ac02d689 (daml-stdlib-DA-Internal-Interface-AnyView-Types-1.0.0): 1.15, 85c092c959ff4d406a48690b2f61805ecfdb56c2a586bdca6331ce6e1bb0521c (daml-finance-settlement-1.0.0): 1.15, 95644d5c6ff8c9a433820d694916d86d5e94e1418880b66bf0b3e5103dbc0e09 (daml-finance-interface-holding-1.0.0): 1.15, 9e0b0b245207257617d2a345f960be47a5a046ff26f4227bbd237f5019ea1b2e (daml-finance-interface-util-1.0.0): 1.15, bc6f0d4beb56842807de1918a96984c79e3cdad37dccda3db95c41b2fa5fce0b (models-0.0.1): 1.15, cb031d99fc7c026d55f770378a6c7368584e53867b4134e476cc26a4b6afd42e (daml-finance-holding-1.0.0): 1.15, e05767016083cf623599817f0076123c1a00bf8a0bfbb237101eeab70efd2091 (daml-prim-e05767016083cf623599817f0076123c1a00bf8a0bfbb237101eeab70efd2091): 1.15, e42b454a2dc8f6726d45e36ee2b59e73d2cac95bded3be60ae3de9ac5a783e66 (daml-finance-interface-instrument-base-1.0.0): 1.15

What can be wrong here? Maybe you have something on the top of your mind?

I run upload-dar and repl from a docker container
image: digitalasset/daml-sdk:2.5.0
My ledger is spinning inside another one:
image: digitalasset/canton-open-source:latest

The ledger itself is fine. I can create contracts and inspect them from the Canton console.

Hi @VictorShneer

You’ve found a bug in daml repl, thank you! You’re working with the right assumption, a build-option in daml.yaml should be picked up by daml repl, but it seems we missed that. We’re now tracking this as issue #15956.

As a temporary workaround, explicitly giving daml repl the flag --target=1.15 (giving you daml repl --target=1.15 /canton/csd/models-0.0.1.dar --ledger-host ledger --ledger-port 5011) should give you a working repl, could you please try that?

5 Likes

Yeap! This fixes the problem!

Thanks!

1 Like

I encounter the same problem from the document Daml REPL — Daml SDK 2.7.6 documentation
Would be good if we can fix there as well.

Kim

Hi Kim,

Thanks for the feedback.

The fix to the issue will be shipped with the Daml SDK 2.6. Once the fix is out, the --target flag will no longer be necessary.

Matteo