Repository navigation
Check your Daml DAR decoder against the JVM reference, without a JVM in your runtime #127
monsieurleberre
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
If you are writing a Canton SDK in Rust, Go, TypeScript or anything else, you need to read DAR files. The easy way to get that wrong is to never compare your decoder with something trustworthy.
The SDK ships a reference for exactly that. Its JVM tool,
daml-dar-to-proto, wraps Digital Asset'sdaml-lf-archivelibrary (the decoder the official Daml SDK tooling uses) and writes a protobuf message, the Intermediate DAR, describing the DAR's type surface. Your decoder writes the same message, and the two are compared as canonical JSON. The JVM stays in CI, out of your production runtime.Since 0.7.1 a composite GitHub Action does the comparison for you:
Pin the Action to a release tag and set
versionto the same release. The Action then:produceronce per DAR in the SDK's conformance corpus, withDAR,OUTandTIERin its environment, and expects an Intermediate DAR (.binpb) in$OUTbuf convert, thenjq -S), prints the JSON diff for every DAR that differs, and fails the step if any doesSHA256SUMS, or from a local jar if you setoracle-jarmismatchesandsplice-commitas outputsfullis the plain decode, the only tier that catches a wrong static/dynamic verdict on signatories, observers and controllers.shapeis the schema-only decode, an entry tier for an SDK that only decodes types.Set
splice(latest, a version such as0.9.1, or a commit) to also run the newest DAR of eachsplice-*family; the Action sets up the JDK that path needs. It runs on Linux x64 runners.The Intermediate DAR page has the compatibility policy and a plain-CI recipe for running the jar yourself. The Action definition is short.
If you point it at a decoder, tell us how it went and anything you'd improve. Bugs are easiest to track as issues.
All reactions