Digital Asset
  • DAML SDK documentation

Getting started

  • Installing the SDK
    • Setting JAVA_HOME and PATH variables
    • Manually installing the SDK
  • Building Your App
  • App Architecture
  • Your First Feature
  • Testing Your App
  • Cheat Sheet

Writing DAML

  • An introduction to DAML
    • 1 Basic contracts
    • 2 Testing templates using DAML Script
    • 3 Data types
    • 4 Transforming data using choices
    • 5 Adding constraints to a contract
    • 6 Parties and authority
    • 7 Composing choices
    • 8 Working with Dependencies
    • 9 Functional Programming 101
    • 10 Intro to the DAML Standard Library
    • 11 Testing DAML Contracts
  • Language reference docs
    • Overview: template structure
    • Templates
    • Choices
    • Updates
    • Data types
    • Built-in functions
    • Expressions
    • Functions
    • Scenarios
    • File structure
    • Packages
    • Contract keys
  • The standard library
    • Prelude
    • DA.Action
    • DA.Action.State
    • DA.Assert
    • DA.Bifunctor
    • DA.Date
    • DA.Either
    • DA.Foldable
    • DA.Functor
    • DA.List
    • DA.List.Total
    • DA.Logic
    • DA.Math
    • DA.Monoid
    • DA.Next.Map
    • DA.Next.Set
    • DA.NonEmpty
    • DA.NonEmpty.Types
    • DA.Numeric
    • DA.Optional
    • DA.Optional.Total
    • DA.Record
    • DA.Semigroup
    • DA.Stack
    • DA.Text
    • DA.TextMap
    • DA.Time
    • DA.Traversable
    • DA.Tuple
    • DA.Validation
    • GHC.Stack.Types
  • Testing using scenarios
  • Troubleshooting
  • Good design patterns
    • Initiate and Accept
    • Multiple party agreement
    • Delegation
    • Authorization
    • Locking
      • Locking by archiving
      • Locking by state
      • Locking by safekeeping
    • Diagram legends

Building applications

  • Application architecture
  • JavaScript Client Libraries
    • JavaScript Code Generator
    • @daml/react
    • @daml/ledger
    • @daml/types
  • HTTP JSON API Service
    • DAML-LF JSON Encoding
    • Query language
  • DAML Script
    • DAML Script Library
      • Daml.Script
  • DAML REPL
  • Upgrading and extending DAML applications
    • Automating the Upgrade Process
  • Authorization
  • The Ledger API
    • The Ledger API services
    • gRPC
    • Ledger API Reference
    • How DAML types are translated to protobuf
    • How DAML types are translated to DAML-LF
    • Java bindings
      • Generate Java code from DAML
      • Ping Pong Example
      • Iou Quickstart Tutorial
    • Scala bindings
    • Node.js bindings
    • Creating your own bindings

Deploying to DAML ledgers

  • Overview of DAML ledgers
  • Deploying to a generic DAML ledger
  • DAML Ledger Topologies

SDK tools

  • DAML Assistant (daml)
  • DAML Studio
  • DAML Sandbox
  • Navigator
  • DAML codegen

Background concepts

  • Glossary of concepts
  • DAML Ledger Model
    • Structure
    • Integrity
    • Privacy
    • DAML: Defining Contract Models Compactly
  • Identity and Package Management
  • Time
  • Causality and Local Ledgers

Examples

  • DAML examples

Early Access Features

  • Navigator Console
    • Navigator Database
  • Extractor
  • DAML Integration Kit
    • Ledger API Test Tool
  • DAML Triggers - Off-Ledger Automation in DAML
    • DAML Trigger Library
      • Daml.Trigger
      • Daml.Trigger.Assert
      • Daml.Trigger.Internal
      • Daml.Trigger.LowLevel
  • Visualizing DAML Contracts
  • Trigger Service
  • Ledger Interoperability

DAML Ecosystem

  • DAML Ecosystem Overview
    • Status Definitions
    • Feature and Component Statuses
  • Releases and Versioning
  • Portability, Compatibility, and Support Durations
  • Getting Help
Download as PDF
DAML SDK

  • Documentation
  • Digital Asset
Version 
Please enter at least 3 letters.
In This Section
  • Navigator
    • Navigator functionality
    • Installing and starting Navigator
    • Choosing a party / changing the party
    • Logging out
    • Viewing templates or contracts
      • Listing templates
      • Listing contracts
      • Viewing contracts based on a template
      • Viewing template and contract details
    • Using Navigator
      • Creating contracts
      • Exercising choices
      • Advancing time
    • Authorizing Navigator
    • Advanced usage
      • Customizable table views
      • Using Navigator with a DAML Ledger

Navigator¶

The Navigator is a front-end that you can use to connect to any DAML Ledger and inspect and modify the ledger. You can use it during DAML development to explore the flow and implications of the DAML models.

The first sections of this guide cover use of the Navigator with the DAML SDK. Refer to Advanced usage for information on using Navigator outside the context of the SDK.

Navigator functionality¶

Connect Navigator to any DAML Ledger and use it to:

  • View templates
  • View active and archived contracts
  • Exercise choices on contracts
  • Advance time (This option applies only when using Navigator with the DAML Sandbox ledger.)

Installing and starting Navigator¶

Navigator ships with the DAML SDK. To launch it:

  1. Start Navigator via a terminal window running SDK Assistant by typing daml start
  2. The Navigator web-app is automatically started in your browser. If it fails to start, open a browser window and point it to the Navigator URL
When running daml start you will see the Navigator URL. By default it will be http://localhost:7500/.

Note

Navigator is compatible with these browsers: Safari, Chrome, or Firefox.

For information on how to launch and use Navigator outside of the SDK, see Advanced usage below.

Choosing a party / changing the party¶

The ledger is a record of transactions between authorized participants on the distributed network. Before you can interact with the ledger, you must assume the role of a particular party. This determines the contracts that you can access and the actions you are permitted to perform on the ledger. The first step in using Navigator is to use the drop-down list on the Navigator home screen to select from the available parties.

../../_images/choose-party.png

Note

The party choices are configured on startup. (Refer to DAML Assistant (daml) or Advanced usage for more instructions.)

The main Navigator screen will be displayed, with contracts that this party is entitled to view in the main pane and the option to switch from contracts to templates in the pane at the left. Other options allow you to filter the display, include or exclude archived contracts, and exercise choices as described below.

../../_images/example.png

To change the active party:

  1. Click the name of the current party in the top right corner of the screen.
  2. On the home screen, select a different party.
../../_images/sign-out.png

You can act as different parties in different browser windows. Use Chrome’s profile feature https://support.google.com/chrome/answer/2364824 and sign in as a different party for each Chrome profile.

Logging out¶

To log out, click the name of the current party in the top-right corner of the screen.

Viewing templates or contracts¶

DAML contract ​templates are ​models ​that contain ​the ​agreement ​statement, ​all ​the ​applicable parameters, ​and ​the ​choices ​that ​can ​be ​made ​in ​acting ​on ​that ​data. They ​specify ​acceptable input ​and ​the ​resulting ​output. ​A ​contract ​template ​contains ​placeholders ​rather ​than ​actual names, ​amounts, ​dates, ​and ​so ​on. In ​a contract ​instance, ​the ​placeholders ​have ​been ​replaced ​with ​actual ​data.

The Navigator allows you to list templates or contracts, view contracts based on a template, and view template and contract details.

Listing templates¶

To see what contract templates are available on the ledger you are connected to, choose Templates in the left pane of the main Navigator screen.

../../_images/templates.png

Use the Filter field at the top right to select template IDs that include the text you enter.

Listing contracts¶

To view a list of available contracts, choose Contracts in the left pane.

../../_images/contracts2.png

In the Contracts list:

  • Changes to the ledger are automatically reflected in the list of contracts. To avoid the automatic updates, select the Frozen checkbox. Contracts will still be marked as archived, but the contracts list will not change.
  • Filter the displayed contracts by entering text in the Filter field at the top right.
  • Use the Include Archived checkbox at the top to include or exclude archived contracts.

Viewing contracts based on a template¶

You can also view the list of contracts that are based on a particular template.

  1. You will see icons to the right of template IDs in the template list with a number indicating how many contracts are based on this template.
  2. Click the number to display a list of contracts based on that template.

Number of Contracts

../../_images/template-contracts-icon.png

List of Contracts

../../_images/template-contracts.png

Viewing template and contract details¶

To view template or contract details, click on a template or contract in the list. The template or contracts detail page is displayed.

Template Details

../../_images/template-details.png

Contract Details

../../_images/contract-details.png

Using Navigator¶

Creating contracts¶

Contracts in a ledger are created automatically when you exercise choices. In some cases, you create a contract directly from a template. This feature can be particularly useful for testing and experimenting during development.

To create a contract based on a template:

  1. Navigate to the template detail page as described above.
  2. Complete the values in the form
  3. Choose the Submit button.
../../_images/create-contract.png

When the command has been committed to the ledger, the loading indicator in the navbar at the top will display a tick mark.

While loading…

../../_images/command-loading-new.png

When committed to the ledger…

../../_images/command-confirmed-new.png

Exercising choices¶

To exercise a choice:

  1. Navigate to the contract details page (see above).
  2. Click the choice you want to exercise in the choice list.
  3. Complete the form.
  4. Choose the Submit button.
../../_images/choice-exercise.png

Or

  1. Navigate to the choice form by clicking the wrench icon in a contract list.
  2. Select a choice.
../../_images/choice-select.png

You will see the loading and confirmation indicators, as pictured above in Creating Contracts.

Advancing time¶

It is possible to advance time against the DAML Sandbox. (This is not true of all DAML Ledgers.) This advance-time functionality can be useful when testing, for example, when entering a trade on one date and settling it on a later date.

To advance time:

  1. Click on the ledger time indicator in the navbar at the top of the screen.
  2. Select a new date / time.
  3. Choose the Set button.
../../_images/advance-time.png

Authorizing Navigator¶

If you are running Navigator against a Ledger API server that verifies authorization, you must provide the access token when you start the Navigator server.

The access token retrieval depends on the specific DAML setup you are working with: please refer to the ledger operator to learn how.

Once you have retrieved your access token, you can provide it to Navigator by storing it in a file and provide the path to it using the --access-token-file command line option.

If the access token cannot be retrieved, is missing or wrong, you’ll be unable to move past the Navigator’s frontend login screen and see the following:

../../_images/access-denied.png

Advanced usage¶

Customizable table views¶

Customizable table views is an advanced rapid-prototyping feature, intended for DAML developers who wish to customize the Navigator UI without developing a custom application.

To use customized table views:

  1. Create a file frontend-config.js in your project root folder (or the folder from which you run Navigator) with the content below:

    import { DamlLfValue } from '@da/ui-core';
    
    export const version = {
      schema: 'navigator-config',
      major: 2,
      minor: 0,
    };
    
    export const customViews = (userId, party, role) => ({
      customview1: {
        type: "table-view",
        title: "Filtered contracts",
        source: {
          type: "contracts",
          filter: [
            {
              field: "id",
              value: "1",
            }
          ],
          search: "",
          sort: [
            {
              field: "id",
              direction: "ASCENDING"
            }
          ]
        },
        columns: [
          {
            key: "id",
            title: "Contract ID",
            createCell: ({rowData}) => ({
              type: "text",
              value: rowData.id
            }),
            sortable: true,
            width: 80,
            weight: 0,
            alignment: "left"
          },
          {
            key: "template.id",
            title: "Template ID",
            createCell: ({rowData}) => ({
              type: "text",
              value: rowData.template.id
            }),
            sortable: true,
            width: 200,
            weight: 3,
            alignment: "left"
          }
        ]
      }
    })
    
  2. Reload your Navigator browser tab. You should now see a sidebar item titled “Filtered contracts” that links to a table with contracts filtered and sorted by ID.

To debug config file errors and learn more about the config file API, open the Navigator /config page in your browser (e.g., http://localhost:7500/config).

Using Navigator with a DAML Ledger¶

By default, Navigator is configured to use an unencrypted connection to the ledger. To run Navigator against a secured DAML Ledger, configure TLS certificates using the --pem, --crt, and --cacrt command line parameters. Details of these parameters are explained in the command line help:

daml navigator --help
Next Previous