Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart tutorial #802

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Quickstart tutorial #802

wants to merge 4 commits into from

Conversation

TheChronicMonster
Copy link
Collaborator

The single-domain quickstart tutorial to guide enterprise developers through an introduction of the daml-app-template.

Copy link
Contributor

@carrielaben-da carrielaben-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small changes. Thanks!


*Ignore these substeps if Gradle builds successfully.*

If you possess a Daml enterprise license and the output returns errors such as:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you possess a Daml enterprise license and the output returns errors such as:
If you have a Daml enterprise license and the output returns errors like:

Forbidden for user.
Could not resolve all files for configuration.

Then email [email protected] with your Artifactory username and the error message.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then email [email protected] with your Artifactory username and the error message.
Email [email protected] with your Artifactory username and the error message.

.. image:: images/daml-scribe-assemble-gradlew-error.png
:alt: Gradle could not get resource example

You can verify your Artifactory username and password have been correctly integrated into the app with a credential request command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can verify your Artifactory username and password have been correctly integrated into the app with a credential request command:
You can verify that your Artifactory username and password have been correctly integrated into the app with a credential request command:

.. image:: images/failed-to-connect-messages.png
:alt: Bootrun running output

The backend is now operational! You're ready to build the frontend!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The backend is now operational! You're ready to build the frontend!
The backend is now operational! You are ready to build the frontend!

.. note::
Incognito mode is recommended to avoid browser caching issues.

For convenience, split the browsers side by side, either horizontally or vertically, based on your preference.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For convenience, split the browsers side by side, either horizontally or vertically, based on your preference.
Split the browsers side by side, horizontally or vertically, for convenience.

import { ContractId } from '@daml/types';
import useLedgerApiClient from '../queries/useLedgerApiClient';

The ``useLedgerApiClient`` import calls the query hook by the same name to access the Daml ledger API client. The client enables the React hook to update the Daml :doc:`ledger state </getting-started/app-architecture>`. In this event, to exercise the ``RejectWithReason`` choice in the Daml model.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``useLedgerApiClient`` import calls the query hook by the same name to access the Daml ledger API client. The client enables the React hook to update the Daml :doc:`ledger state </getting-started/app-architecture>`. In this event, to exercise the ``RejectWithReason`` choice in the Daml model.
The ``useLedgerApiClient`` import calls the query hook by the same name to access the Daml ledger API client. The client enables the React hook to update the Daml :doc:`ledger state </getting-started/app-architecture>` - in this event, to exercise the ``RejectWithReason`` choice in the Daml model.

daml-app-template ~ % daml studio

.. note::
``daml studio`` should automatically install the :doc:`Daml Studio </daml/daml-studio>` extension in Visual Studio. The extension assists Daml app development. You can double-check that the extension is installed by opening the extension menu and searching for "Daml studio."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``daml studio`` should automatically install the :doc:`Daml Studio </daml/daml-studio>` extension in Visual Studio. The extension assists Daml app development. You can double-check that the extension is installed by opening the extension menu and searching for "Daml studio."
``daml studio`` should automatically install the :doc:`Daml Studio </daml/daml-studio>` extension in Visual Studio. The extension assists Daml app development. You can double-check that the extension is installed by opening the extension menu and searching for "Daml Studio."

unlockedCid <- unlockAndRemoveObservers (S.fromList [provider, sender]) receiver lockedTransferableCid
return (rejectedOfferCid, unlockedCid)

This choice takes a reason for the rejection, and ensures that the receiver controls the choice and that the transfer offer contract has not expired. When the choice is exercised a new "RejectedTransferOffer" contract is created that subsequently unlocks the assets that were to be transferred, and removes the provider and sender as observers. This choice contains a handful of interesting Daml-specific items:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This choice takes a reason for the rejection, and ensures that the receiver controls the choice and that the transfer offer contract has not expired. When the choice is exercised a new "RejectedTransferOffer" contract is created that subsequently unlocks the assets that were to be transferred, and removes the provider and sender as observers. This choice contains a handful of interesting Daml-specific items:
This choice takes a reason for the rejection and ensures that the receiver controls the choice and that the transfer offer contract has not expired. When the choice is exercised a new "RejectedTransferOffer" contract is created that then unlocks the assets that were to be transferred and removes the provider and sender as observers. This choice contains a handful of Daml-specific items:

Extend the Application
======================

Alice can accept a transfer offer from the provider. However, it's possible that Alice, or any other user, may want to reject a transfer offer. For example, the provider may offer an incorrect amount, or the user may decide to reject the transfer for another reason. The remainder of this guide demonstrates how to extend the single-domain Daml application using an example scenario.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Alice can accept a transfer offer from the provider. However, it's possible that Alice, or any other user, may want to reject a transfer offer. For example, the provider may offer an incorrect amount, or the user may decide to reject the transfer for another reason. The remainder of this guide demonstrates how to extend the single-domain Daml application using an example scenario.
Alice can accept a transfer offer from the provider. However, Alice, or any other user, may want to reject a transfer offer. For example, the provider may offer an incorrect amount, or the user may reject the transfer for another reason. The remainder of this guide demonstrates how to extend the single-domain Daml application to reject a transfer offer and record the reason for the rejection.

.. image:: images/DAML_SDK_RELEASE_VERSION.png
:alt: Daml SDK version example

2. After installation, add Daml to your PATH in your shell configuration file (``.zshrc`` or ``.bashrc`` depending on your system) if it wasn't added automatically:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. After installation, add Daml to your PATH in your shell configuration file (``.zshrc`` or ``.bashrc`` depending on your system) if it wasn't added automatically:
2. After installation, add Daml to your PATH in your shell configuration file (``.zshrc`` or ``.bashrc`` depending on your system) if it was not added automatically:

@yves-da
Copy link
Contributor

yves-da commented Oct 18, 2024

Hi @TheChronicMonster
Can you please merge your PR, if it's done? Thanks!

@hrischuk-da
Copy link
Contributor

This needs to be released when the ref app template goes public. Working through the OSS checklist. Could use some help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants