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 local file in the form ‘xxxx.dar’, however, when I ran daml damlc inspect-dar on the file, I got the error:
daml damlc inspect-dar 2264eb088eb6fc740e11241b2bf06.dar
damlc: Data.Binary.Get.runGet at position 4: Did not find end of central directory signature
CallStack (from HasCallStack):
error, called at libraries\\binary\\src\\Data\\Binary\\Get.hs:351:5 in binary-0.8.8.0:Data.Binary.Get
I guess this means that I must also be writing the GetPackageResponse.hashFunction and GetPackageResponse.hash, however, I’m unsure as to the appropriate way to convert these to bytes and write these to the local file.
Thank you!
Regards,
Zoraiz
ps. don’t forget my badges <3 @anthony