daml/navigator/backend/scenarios
Gary Verhaegen a925f0174c
update copyright notices for 2021 (#8257)
* update copyright notices for 2021

To be merged on 2021-01-01.

CHANGELOG_BEGIN
CHANGELOG_END

* patch-bazel-windows & da-ghc-lib
2021-01-01 19:49:51 +01:00
..
rental update copyright notices for 2021 (#8257) 2021-01-01 19:49:51 +01:00
.gitignore Add contract key support to Scala bindings and navigator (#1950) 2019-06-30 20:57:55 +02:00
README.md Split sandbox code into separate packages (#6695) 2020-07-17 17:06:06 +02:00

Navigator Testing Scenarios

The scenario(s) contained in this directory are useful to quickly spin up the sandbox and navigator from HEAD and visually inspect the navigator UI or perform other tests.

As an example, assuming your current working directory is the project root, you can:

  1. open a terminal

  2. change your working directory to navigator/backend/scenarios/rental

  3. build the project

    daml build
    
  4. start the sandbox and run a scenario

    bazel run --run_under="cd $PWD && " \
    //ledger/sandbox-classic:sandbox-classic-binary -- --scenario Main:example dist/rental.dar
    
  5. open another terminal

  6. change your working directory to navigator/backend/scenarios/rental

  7. start the navigator

    bazel run --run_under="cd $PWD && " \
    //navigator/backend:navigator-binary -- server
    
  8. open a browser

  9. go to localhost:4000

  10. play around

Usage with TLS

If you want to use a secure channel (e.g.: to test against an authenticated sandbox), you can use the test certificates in //ledger/test-common/test-certificates.

To use them, run the sandbox as follows:

   bazel build //ledger/test-common/test-certificates
   bazel run --run_under="cd $PWD && " \
   //ledger/sandbox-classic:sandbox-classic-binary -- --scenario Main:example dist/rental.dar
   --pem $PWD/bazel-bin/ledger/test-common/test-certificates/server.pem --crt $PWD/bazel-bin/ledger/test-common/test-certificates/server.crt --cacrt $PWD/bazel-bin/ledger/test-common/test-certificates/ca.crt

And run navigator as follows:

   bazel run --run_under="cd $PWD && " \
   //navigator/backend:navigator-binary -- server \
   --pem $PWD/bazel-bin/ledger/test-common/test-certificates/client.pem --crt $PWD/bazel-bin/ledger/test-common/test-certificates/client.crt --cacrt $PWD/bazel-bin/ledger/test-common/test-certificates/ca.crt