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
1 Like
georg
May 15, 2020, 10:27am
2
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?
2 Likes
gaborh
May 15, 2020, 10:37am
3
I think the README is wrong in its current form. I am fixing it and getting back to you.
3 Likes
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.
georg
May 15, 2020, 1:25pm
6
According to this script , you should be copying in this commit from the finance library. Can you try that?
1 Like
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 Amvn clean package
Option Bpython ./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
.
3 Likes
Please check latest master, README is updated (hash: fa424266).
2 Likes
@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.
2 Likes
georg
May 16, 2020, 2:04pm
13
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.
2 Likes