How to fetch DAR from Canton bootstrap script?

Richard_Kapolnai
Sun, 26 Jan 2025 10:57:13 +0000
App Development

How can this Canton 2.9.4 console function be called: dars.download(string, string) ?

I am getting this error:

@ participant.dars.download(packageId, ".")
ERROR i.g.i.SerializingExecutor - Exception while executing runnable io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@631eb9e7
java.lang.IllegalArgumentException: Invalid hex string: DefaultDeserializationError(message = Invalid hash algorithm: Unknown hash algorithm for index: 101)
	at com.digitalasset.canton.crypto.Hash$.$anonfun$tryFromHexString$1(Hash.scala:197)

Same package id can be used on ledger api:

$ daml ledger fetch-dar --main-package-id $packageId --host localhost --port 6865  -o x.dar
...
DAR fetch succeeded; contains 23 packages.

This package id is valid for the builtin PingPong DAR in Canton 2.9.4.

Steps to reproduce: canton -c canton-sandbox.conf --bootstrap fetch_dar.canton with:

canton-sandbox.conf

canton {
  participants {
    participant {
      admin-api.port = 6866
      ledger-api.port = 6865
    }
  }
  domains {
    mydomain {
      public-api.port = 5018
      admin-api.port = 5019
      init.domain-parameters.protocol-version = 5
    }
  }
  features.enable-testing-commands = yes
}

fetch_dar.canton

val packageId = "65921e553a353588e950cbc87e98a127730e63295f7ad8d3adae952ef0133b3e"
nodes.local.start()
participant.domains.connect_local(mydomain)
participant.dars.download(packageId, ".")

5 posts - 2 participants