96624a7677
* add -Ywarn-unused to all scalac options * remove some unused arguments * remove some unused definitions * remove some unused variable names * suppress some unused variable names * changeExtension doesn't use baseName * no changelog CHANGELOG_BEGIN CHANGELOG_END * work around no plugins in scenario interpreter perf tests * remove many more unused things * remove more unused things, restore some used things * remove more unused things, restore a couple signature mistakes * missed import * unused argument * remove more unused loggingContexts * some unused code in triggers * some unused code in sandbox and kvutils * some unused code in repl-service and daml-script * some unused code in bindings-rxjava tests * some unused code in triggers runner * more comments on silent usages - suggested by @cocreature; thanks * fix missing reference in TestCommands * more unused in triggers * more unused in sandbox * more unused in daml-script * more unused in ledger-client tests * more unused in triggers * more unused in kvutils * more unused in daml-script * more unused in sandbox * remove unused in ledger-api-test-tool * suppress final special case for codegen unused warnings .../com/daml/sample/mymain/ContractIdNT.scala:24: warning: parameter value ev 0 in method ContractIdNT Value is never used implicit def `ContractIdNT Value`[a_a1dk](implicit `ev 0`: ` lfdomainapi`.Value[a_a1dk]): ` lfdomainapi`.Value[_root_.com.daml.sample.MyMain.ContractIdNT[a_a1dk]] = { ^ .../com/daml/sample/mymain/ContractIdNT.scala:41: warning: parameter value eva_a1dk in method ContractIdNT LfEncodable is never used implicit def `ContractIdNT LfEncodable`[a_a1dk](implicit eva_a1dk: ` lfdomainapi`.encoding.LfEncodable[a_a1dk]): ` lfdomainapi`.encoding.LfEncodable[_root_.com.daml.sample.MyMain.ContractIdNT[a_a1dk]] = { ^ * one more unused in daml-script * special scaladoc rules may need silencer, too * unused in compatibility/sandbox-migration * more commas, a different way to `find` - suggested by @remyhaemmerle-da; thanks |
||
---|---|---|
.. | ||
backend | ||
docs | ||
frontend | ||
integration-test | ||
.gitignore | ||
BUILD.bazel | ||
Makefile | ||
README.md |
Navigator
The Navigator is a web-app that connects to any Digital Asset ledger and allows the user to inspect contracts, create contracts, and exercise choices.
The Navigator can be used in development mode (see below) or packaged into a "fat" JAR that includes the compiled frontend assets for distribution.
Navigator architecture
To learn more about developing the different parts of the Navigator see:
Building Navigator
To build a "fat" JAR of the Navigator that includes the pre-compiled front-end assets, run:
bazel build //navigator/backend:navigator-binary_deploy.jar
This produces a "fat" JAR bazel-bin/navigator/backend/navigator-binary_deploy.jar
which can be run with:
java -jar bazel-bin/navigator/backend/navigator-binary_deploy.jar
Notable things in the Navigator build:
backend/src/test/resources/schema.graphql
Manually written, must be consistent with backend/src/main/scala/com/digitalasset/navigator/graphql/GraphQLSchema.scala
. Consistency is checked in a test.
frontend/src/**/api/Queries.ts
Generated from backend/src/test/resources/schema.graphql
with an external codegen tool.
Currently, these files are checked in and updated with make update-graphql-types
.
frontend bundled code
Code from frontend/src/**/*.ts*
, compiled using TypeScript, and bundled with Webpack.
Output includes:
bundle-[hash].js
: bundled frontend code, name uses content hasing.browsercheck-[hash].js
: tiny module for checking browser compatibility, name uses content hasing.- Several image and font files, referenced by the above modules. File names use content hashing.
index.html
: Single page application main entry, references the above modules.
Note: Browsers are instructed never to cache index.html
, and indefinitely cache all other files. This is why content hashing is used.
backend binary
Scala binary, compiled as a fat JAR.
Code from backend/src/**/*.scala
, bundled frontend code is copied to backend/src/main/resources/frontend
.
backend version
The version is included as resource files in the Navigator fat jar. This is to reduce rebuild times when the version changes.
frontend development build
For developing frontend code, webpack-dev-server
is used. This serves the current frontend code on a separate port, and does:
- Watch
*.ts
files for changes - Perform incremental builds
- Send a push notification to the browser, automatically reloading the page when the build is finished.
- Forward network requests to a different port, where a Navigator backend is expected to run.
This is orders of magnitude faster than what the current Bazel build offers, so it is desirable to keep the webpack-dev-server
setup working.
Note, the browser is instructed to cache assets based on the SDK version. During development this is too aggressive and you will need to manually refresh to see updates to the front-end.