Skip to content
Discussions/App Development/Cannot find dependency for refapp ex-bond-issuance in the lib-finance libraryForum ↗

Cannot find dependency for refapp ex-bond-issuance in the lib-finance library

App Development14 posts371 views16 likesLast activity Jun 2020
GY
gyorgybalazsiOP
May 2020

I would like to check out the ex-bond-issuance refapp (GitHub - digital-asset/ex-bond-issuance: Reference DAML application demonstrating a bond issuance use case.).

Some dependencies are supposed to be in the lib-finance library (GitHub - digital-asset/lib-finance).

I have copied the lib-finance library into the project as instructed in the README.

In this way, this import instruction is OK:

import DA.Finance.Types

But other dependencies cannot be found:

import DA.Finance.Fact.Asset
import DA.Finance.Rule.Asset

Where are these?

Thanks

GE
georg
May 2020

The bond reference app was built against an older version of the Finance Library. It seems the instructions are outdated. @gaborh can you maybe help?

GA
gaborh
May 2020

I think the README is wrong in its current form. I am fixing it and getting back to you.

GY
gyorgybalazsi
May 2020

Thank you!

GY
gyorgybalazsi
May 2020

Or maybe in the /ex-bond-issuance/src/main/daml/DA/RefApps/Bond/Roles/CentralBankRole.daml file these two imports

import DA.Finance.Fact.Asset
import DA.Finance.Rule.Asset

should be replaced by one import

import DA.Finance.Asset ?

In the root folder of the lib-finance library, there is an Asset.daml file.

GE
georg
May 2020

According to this script, you should be copying in this commit from the finance library. Can you try that?

TA
Tamas_Kalcza
May 2020

As @gaborh mentioned, the README was not up-to-date, apologies for that. A PR is on the way to fix it.

In the meantime You can fix this issue by doing any of the following:

  1. Option A
    mvn clean package
    
  2. Option B
    python ./scripts/getfinlib.py 1.1.1
    

After running one of these you should have the necessary finlib in place, i.e. target/finlib-master-sdk-1.1.1.dar.

After that you should be able to start app in standalone mode or using docker-compose up --build.

GA
gaborh
May 2020

Please check latest master, README is updated (hash: fa424266).

GY
gyorgybalazsi
May 2020

Thanks!

GY
gyorgybalazsi
May 2020

Yes, thank you!

GY
gyorgybalazsi
May 2020

@georg what do you think is the best way to include the lib-finance library if I wat to create a new project using it?

Using this script or copying the folder into my project?

CO
cocreature
May 2020

I would recommend to check in the DAR and reference that via a relative path in dependencies / data-dependencies. Then daml build works without any extra steps and you also don’t accidentally recompile your dependency which can change the package id and thereby invalidate all references to old templates.

GE
georg
May 2020

Yep, what @cocreature said. For now best is to check out the lib-finance repo, compile once, and check in the DAR into your repo. We’re working towards being able to pull this in in a nicer way.

GY
gyorgybalazsi
Jun 2020

Thank you!

← Back to Discussions