Inspect daml packages using the grpc/json API
App Development2 posts302 views1 likesLast activity Dec 2021
ME
meetOP
Dec 2021Hello, we are looking to use Java/JavaScript code to fetch and inspect a dar file provided as input, combine it with certain annotations in a separate yaml file and output an OpenAPI spec. To do this, we need to be able to fetch a package and iterate over the various modules in the package, the various templates in the module, and the choices and data types defined in the templates, similar to how the Java reflection API allows us to inspect Java functions, classes etc. How do we do this? Is there any reference/sample code we can refer to, in order to achieve this?
LU
Luciano
Dec 2021There are a couple of existing posts that talk about inspecting dar files - perhaps you can start here:
Given a DAR file, is there a way from the command line to get a list of the templates (including package ID’s) defined within that DAR file? Alternatively, can damlc produce such a list while building a DAR? I’m using DAZL and looking for a way to more easily bind symbolic template names to fully qualified (with package ID) template names.
Hi team, So I’m interacting with a remote ledger and wish to download all the deployed packages on the remote node. Then I wish to run Java Codegen locally using the downloaded package. Then I wish to be able to upload that package again and interact with it using my Java Codegen/Bindings. I’ve used the PackageClient to receive the GetPackageResponse. However, I’m unsure as to how I can convert this to a local dar file. I tried writing the GetPackageResponse.archivePayload byte array to a loca…