I just started learning DAML 2 weeks ago and went through the private NFT example created by Levente Barczy.
I encountered various problems at different steps like: starting up navigator, linking DAML with React UI and lastly staring the depolyment zip on DAML hub. I circumvented first two issues but in order to do that I needed to compile everything with DAML version 1.3.1 (as used in tutorial). Otherwise things simply don’t work with 2.0.0 and I think you need an update of tutorials since old ones are not compatible with 2.0.0. and can create a lot of headaches for new developers.
However the last problem starting the deployment zip on DAML hub I cannot solve. I did everything as Levente and tried starting the deployed UI (basically last step of the private NFT tutiroal) and it goes to this address: https://cghiveu9q9h7iy5i.daml.app/#/login. Then there is an option to “Log in with DABL”.
When I click the button however I get the message:
This sounds like a problem at the application level. It seems like the app UI is relying on the legacy log-in endpoint which will not work with the new *.daml.app application domains. There are more details about this change here: https://hub.daml.com/docs/app-domains/
The UI code must be updated to hit the new login endpoint /.hub/v1/login rather than login.projectdabl.com/...
You should reach out to the application author to patch this, or, if you have access to the source code, you can try patching it yourself. It should be a relatively simple fix.
If I recall correctly Navigator displays contracts if compiled with SDK 2.0.0. only if yaml.daml doesn’t contain parties but that they are created inside main.daml with the syntax needed for 2.0.0 (I cannot remember exact syntax because I had to rollback to 1.3.1 to make it work but I know it has to do with creating unique IDs as part of the party names - for example Alice:LONG_ID).
Otherwise no contracts are displayed if it’s done as in tutorial + SDK 2.0.0.
Episode 5.2 - Frontend UI with React.
I was receiving this error:
Module not found: Can’t resolve ‘@daml.js/40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7’ in 'C:\Users\bogs\Projects\private-nft\nft\daml.js\nft-0.0.1\lib\Token
When trying npm start after npm install --force. Then I realized that I should drop using npm alltogether and should use yarn. Also I avoided updating packages and used obsolete packages as in github package.json because I think updates break things.
Last but not least I had to use SDK 1.3.1 again because 2.0.0. I think also adds to the linking problem. I’m not absolutley sure which of these things helped me fixe the issue (maybe even only using yarn instead of npm and keeping same packages). I’m coming from Vue ecosystem so I’m very new to React as well and I’m not sure if React dependencies are installed correctly via npm or yarn is native for React.
There might have been some other minor issues, such as not showing all the changes made in all the files from the template ones for example but I circumvented those by comparing file by file from the template code vs the private nft one