Cannot find dependency for refapp ex-bond-issuance in the lib-finance library
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
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?
I think the README is wrong in its current form. I am fixing it and getting back to you.
Thank you!
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.
According to this script, you should be copying in this commit from the finance library. Can you try that?
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:
- Option A
mvn clean package - 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.
Please check latest master, README is updated (hash: fa424266).
Thanks!
Yes, thank you!
@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?
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.
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.
Thank you!