Using Daml Navigator with Canton in Docker (Part II)

In the previous post, we created a simple Canton ledger in Docker using the default settings.

Next, let’s connect the Daml Navigator UI to our ledger. We’ll run the Navigator on our host machine, so this needs to have the Daml SDK installed. To connect the Navigator, we need to expose the ledger API port from a participant so that the Docker host can see it.

We also need to make a change to the simple-topology.conf file described in the previous blog. The change we need is to add the address 0.0.0.0 to the ledger API configuration. We’ll do this by creating a new Docker image with a modified simple-topology.conf.

To do this, create a new directory, and within that directory, create two files. The first file is “simple-topology.conf” with the following content (note there is one new line added specifying the ledger API address for participant1):

The second file is named “Dockerfile” and has the following content:

Now, from the command line, we can build the new image as follows:

Also from the command line, we can run our new image, exposing port 5011 on the container to port 5011 on the host. This is the port on which participant1 is running the ledger API. It is this API to which we will connect the Navigator.

 

Remember that once the container starts, we need to connect our participants to the domain:

Next, on the Docker host, we need to start the Navigator. You will need to have downloaded and installed the Daml SDK on the host. Open a new terminal window and type the following:

Note that the “feature-user-management” switch is used to tell Navigator to display parties on the login page, rather than users (which have not been set up in this simple demo).

Open a browser on the Docker host and browse to:

http://localhost:4000

If all has gone well, we should see the Navigator login page:

unnamed-85

Finally, we can add additional parties using the Canton console in the Docker container:

If we refresh the Navigator window, we can see that the new party is available.

CHECK OUT OUR NEW LEARNING CENTER