From c446e384586487d9bf9695ab48898a39ceb601a0 Mon Sep 17 00:00:00 2001 From: Beth Aitman Date: Thu, 4 Apr 2019 15:56:38 +0200 Subject: [PATCH 1/2] Update instructions to use new repository --- docs/source/app-dev/ledger-api-introduction/index.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/source/app-dev/ledger-api-introduction/index.rst b/docs/source/app-dev/ledger-api-introduction/index.rst index e97157846fdd..6cef75161cc6 100644 --- a/docs/source/app-dev/ledger-api-introduction/index.rst +++ b/docs/source/app-dev/ledger-api-introduction/index.rst @@ -62,10 +62,11 @@ Example project - Ping Pong The SDK provides an example project demonstrating the use of the Ledger API. Read :ref:`setup-maven-project` to configure your machine to use the examples. -1. Start a new project with ``da new example-ping-pong-grpc-java ping-pong-java``. This creates a new SDK project in the folder ``./ping-pong-java`` that is comprised of a DAML model in ``daml/PingPong.daml`` and Java source code. -2. Run ``mvn compile`` to build the Java code with `Maven `__. -3. Run ``da sandbox`` to start the sandbox. -4. Run ``mvn exec:java`` to run the application. +To get the example project: + +1. Clone the `example project from GitHub `__. + +2. Follow the `setup instructions in the README `__. Use ``examples.pingpong.grpc.PingPongGrpcMain`` as the main class. The DAML model contains two contract templates ``Ping`` and ``Pong`` to showcase how two parties can interact via the ledger. Party ``Alice`` creates a ``Ping`` contract @@ -75,7 +76,7 @@ who can choose to exercise the ``RespondPing`` choice on that contract. This cre effectively starting a new ping pong cycle, until this has happened a number of times, as defined within the DAML model. -The entry point for the Java code is the main class ``src/main/java/examples/pingpong/PingPongMain.java``. +The entry point for the Java code is the main class ``src/main/java/examples/pingpong/grpc/PingPongGrpcMain.java``. It shows how to connect to and interact with the DML Ledger via the gRPC API. The code is augmented with comments that describe the various parts of the code. Each party will connect to the ledger, subscribe to the transaction stream, and send initial ``Ping`` contracts. From 4f674c08f5e98e549ee87b9e1a7080c01e1c69f1 Mon Sep 17 00:00:00 2001 From: Beth Aitman Date: Thu, 4 Apr 2019 16:23:30 +0200 Subject: [PATCH 2/2] Update instructions on second page as well --- docs/source/app-dev/bindings-java/index.rst | 8 ++++---- docs/source/app-dev/ledger-api-introduction/index.rst | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/app-dev/bindings-java/index.rst b/docs/source/app-dev/bindings-java/index.rst index 68fee9d6dfbb..eccfeed13920 100644 --- a/docs/source/app-dev/bindings-java/index.rst +++ b/docs/source/app-dev/bindings-java/index.rst @@ -179,9 +179,9 @@ Sometimes the default settings for gRPC connections/channels are not suitable fo Example ======= -To try out the Java Binding library, use one of the two example projects. +To try out the Java Binding library, use the `examples on GitHub `__: ``PingPongReactive`` or ``PingPongComponents``. -There's one with and one without the Reactive Components. +The former example does not use the Reactive Components, and the latter example does. Both examples implement the ``PingPong`` application, which consists of: - a DAML model with two contract templates, ``Ping`` and ``Pong`` @@ -200,8 +200,8 @@ The logic of the application is the following: Setting up the example projects =============================== -To set up the examples project, clone the public GitHub repository at: https://github.com/digital-asset/ex-java-bindings -and follow the setup instruction in the README file. This project contains three examples of the PingPong application, built +To set up the example projects, clone the public GitHub repository at `github.com/digital-asset/ex-java-bindings `__ +and follow the setup instruction in the `README file `__. This project contains three examples of the PingPong application, built with gRPC (non-Reactive), Reactive and Reactive Component bindings respectively. Example project -- Ping Pong without reactive components diff --git a/docs/source/app-dev/ledger-api-introduction/index.rst b/docs/source/app-dev/ledger-api-introduction/index.rst index 6cef75161cc6..3645c622d4bc 100644 --- a/docs/source/app-dev/ledger-api-introduction/index.rst +++ b/docs/source/app-dev/ledger-api-introduction/index.rst @@ -52,19 +52,19 @@ can be added to an existing SDK project by running a wide range of programming languages, the DAML SDK provides pre-compiled client bindings for the Ledger API for Java. If you are using a different programming language, please see the -`Quickstart `__ -and `Tutorials `__ +`gRPC quickstart `__ +and `gRPC tutorials `__ section in the official gRPC documentation. Example project - Ping Pong =========================== -The SDK provides an example project demonstrating the use of the Ledger API. +The SDK provides an example project demonstrating the use of the Ledger API with gRPC. Read :ref:`setup-maven-project` to configure your machine to use the examples. -To get the example project: +To get the example project, ``PingPongGrpc``: -1. Clone the `example project from GitHub `__. +1. Clone the `repository from GitHub `__. 2. Follow the `setup instructions in the README `__. Use ``examples.pingpong.grpc.PingPongGrpcMain`` as the main class.