Canton Console

Canton offers a console (REPL) where entities can be dynamically started and stopped, and a variety of administrative or debugging commands can be run.

All console commands must be valid Scala (the console is built on Ammonite - a Scala based scripting and REPL framework).

The examples/ sub-directories contain some sample scripts, with the extension .canton.

Commands are organised by thematic groups. Some commands also need to be explicitly turned on via configuration directives to be accessible.

Some operations are available on both types of nodes, whereas some operations are specific to either participant or domain nodes. For consistency, we organise the manual by node type, which means that some commands will appear twice. However, the detailed explanations are only given within the participant documentation.

Node References

To issue the command on a particular node, you must refer to it via its reference, which is a Scala variable. Named variables are created for all domain entities and participants using their configured identifiers. For example the sample examples/01-simple-topology/simple-topology.conf configuration file references the domain mydomain, and participants participant1 and participant2. These are available in the console as mydomain, participant1 and participant2. Additionally, the console provides the following generic references.

mydomain
Manage local domain 'mydomain'; type 'mydomain help' or 'mydomain help("<methodName>")' for more help
participant1
Manage participant 'participant1'; type 'participant1 help' or 'participant1 help("<methodName>")' for more help
participant2
Manage participant 'participant2'; type 'participant2 help' or 'participant2 help("<methodName>")' for more help
domains
All domain nodes
nodes
Both, domain and participant nodes
participants
All participant nodes

Help

Canton can be very helpful if you ask for help. Try to type

::
help

or

participant1.help()

to get an overview of the commands and command groups that exist. help() works on every level (e.g. participant1.domains.help()) or can be used to search for particular functions (help(“list”)) or to get detailed help explanation for each command (participant1.parties.help(“list”)).

Lifecycle Operations

These are supported by individual and sequences of domains and participants. If called on a sequence, operations will be called sequentially in the order of the sequence. For example:

nodes.local start

can be used to start all configured local domains and participants.

If the node is running with database persistence, it will support the database migration command (db.migrate). The migrations are performed automatically when the node is started for the first time. However, new migrations added as part of new versions of the software must be run manually using the command. While we technically support upgradability of the database, we are currently not testing it and are performing breaking changes on every minor release until we hit the beta stage.

Other Top-level Commands

The following commands are available for convenience:

exit
Leave the console
help
Help with console commands; type help("<command>") for detailed help for <command>
health.dump

Generate and write a dump of Canton's state for a bug report

Return type

String
health.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
health.status

Aggregate status info of all participants and domains

Return type

com.digitalasset.canton.admin.api.client.data.CantonStatus
console.command_timeout

Yields the timeout for running console commands

Return type

scala.concurrent.duration.Duration

Yields the timeout for running console commands. When the timeout has elapsed, the console stops waiting for the command result. The command will continue running in the background.

console.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
console.set_command_timeout

Sets the timeout for running console commands.

Arguments:

  • newTimeout: scala.concurrent.duration.Duration

Sets the timeout for running console commands. When the timeout has elapsed, the console stops waiting for the command result. The command will continue running in the background. The new timeout must be positive.

logging.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
logging.set_level

Dynamically change log level (TRACE, DEBUG, INFO, WARN, ERROR)

Arguments:

  • loggerName: String
  • level: String
utils.auto_close

(Testing) Register `AutoCloseable` object to be shutdown if Canton is shut down

Arguments:

  • closeable: AutoCloseable
utils.contract_data_to_instance

Convert contract data to a contract instance.

Arguments:

  • contractData: com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.ContractData
  • ledgerTime: java.time.Instant

Return type

com.digitalasset.canton.protocol.SerializableContract

The `utils.contract_data_to_instance` bridges the gap between `participant.ledger_api.acs` commands that return various pieces of "contract data" and the `participant.repair.add` command used to add "contract instances" as part of repair workflows. Such workflows (for example migrating contracts from other DAML ledgers to Canton participants) typically consist of extracting contract data using `participant.ledger_api.acs` commands, modifying the contract data, and then converting the `contractData` using this function before finally adding the resulting contract instances to Canton participants via `participant.repair.add`. Obtain the `contractData` by invoking `.toContractData` on the `WrappedCreatedEvent` returned by the corresponding `participant.ledger_api.acs.of_party` or `of_all` call. The `ledgerTime` parameter should be chosen to be a time meaningful to the domain on which you plan to subsequently invoke `participant.repair.add` on and will be retained alongside the contract instance by the `participant.repair.add` invocation.

utils.contract_instance_to_data

Convert a contract instance to contract data.

Arguments:

  • contract: com.digitalasset.canton.protocol.SerializableContract

Return type

com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.ContractData

The `utils.contract_instance_to_data` converts a Canton "contract instance" to "contract data", a format more amenable to inspection and modification as part of repair workflows. This function consumes the output of the `participant.testing` commands and can thus be employed in workflows geared at verifying the contents of contracts for diagnostic purposes and in environments in which the "parameters.enable-testing-commands" configuration can be (at least temporarily) enabled.

utils.generate_navigator_conf

Create a navigator ui-backend.conf for a participant

Arguments:

  • participant: com.digitalasset.canton.console.LocalParticipantReference
  • file: Option[java.io.File]

Return type

java.io.File
utils.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
utils.object_args

Reflective inspection of object arguments, handy to inspect case class objects

Arguments:

  • obj: T

Return type

List[String]

Return the list field names of the given object. Helpful function when inspecting the return result.

utils.retry_until_true

Wait on a condition to become true

Arguments:

  • timeout: java.time.Duration
  • started: java.time.Instant
  • condition: => Boolean
  • failure: => String

Return type

(condition: => Boolean, failure: => String)Unit
utils.type_args

Reflective inspection of type arguments, handy to inspect case class types

Return type

List[String]

Return the list of field names of the given type. Helpful function when creating new objects for requests.

ledger_api_utils.create

Build create command

Arguments:

  • packageId: String
  • module: String
  • template: String
  • arguments: Map[String,Any]

Return type

com.daml.ledger.api.v1.commands.Command
ledger_api_utils.exercise

Build exercise command from CreatedEvent

Arguments:

  • choice: String
  • arguments: Map[String,Any]
  • event: com.daml.ledger.api.v1.event.CreatedEvent

Return type

com.daml.ledger.api.v1.commands.Command
ledger_api_utils.exercise

Build exercise command

Arguments:

  • packageId: String
  • module: String
  • template: String
  • choice: String
  • arguments: Map[String,Any]
  • contractId: String

Return type

com.daml.ledger.api.v1.commands.Command
ledger_api_utils.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String

Participant Commands

config

Return participant config

Return type

com.digitalasset.canton.participant.config.ParticipantConfig
help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
id

Yields the globally unique id of this participant. Throws an exception, if the id has not yet been allocated (e.g., the participant has not yet been started).

Return type

com.digitalasset.canton.identity.ParticipantId
start
Start the instance
stop
Stop the instance
testing.acs_search

(Testing) Lookup of active contracts

Arguments:

  • domainAlias: com.digitalasset.canton.DomainAlias
  • filterId: String
  • filterPackage: String
  • filterTemplate: String
  • limit: Int

Return type

List[com.digitalasset.canton.protocol.SerializableContract]
testing.await_heartbeat

(Testing) Wait for a heartbeat on the given domain with a timestamp greater than or equal to the given timestamp

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • minTimestamp: com.digitalasset.canton.data.CantonTimestamp
  • timeout: java.time.Duration
testing.bong

(Testing) Send a bong to a set of target parties over the ledger. Levels > 0 leads to an exploding ping with exponential number of contracts. Throw a RuntimeException in case of failure.

Arguments:

  • targets: Set[com.digitalasset.canton.identity.ParticipantId]
  • timeoutMillis: Long
  • levels: Long
  • gracePeriodMillis: Long
  • workflowId: String
  • id: String

Return type

scala.concurrent.duration.Duration

initiate a racy ping to multiple participants, measuring the roundtrip time of the fasted responder, with an optional timeout. Grace-period is the time the bong will wait for a duplicate spent (which would indicate an error in the system) before exiting. If levels > 0, the ping command will lead to a binary explosion and subsequent dilation of contracts, where ``level`` determines the number of levels we will explode. As a result, the system will create (2^(L+2) - 3) contracts (where L stands for ``level``). The bong command comes handy to run a burst test against the system, leading quickly to an overloading state.

testing.crypto_api

(Testing) Return the sync crypto api provider, which provides access to all cryptographic methods

Return type

com.digitalasset.canton.crypto.SyncCryptoApiProvider
testing.event_search

(Testing) Lookup of events

Arguments:

  • domain: com.digitalasset.canton.DomainAlias

Return type

Seq[(String, com.digitalasset.canton.participant.sync.TimestampedEvent)]

Show the event logs. To select only events from a particular domain, use the domain alias. Leave the domain blank to search the combined event log.

testing.find_clean_commitments_timestamp

(Testing) The latest timestamp before or at the given one for which no commitment is outstanding

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • beforeOrAt: com.digitalasset.canton.data.CantonTimestamp

Return type

Option[com.digitalasset.canton.data.CantonTimestamp]

The latest timestamp before or at the given one for which no commitment is outstanding. Note that this doesn't imply that pruning is possible at this timestamp, as the system might require some additional data for crash recovery. Thus, this is useful for testing commitments; use the commands in the pruning group for pruning. Additionally, the result needn't fall on a "commitment tick" as specified by the reconciliation interval.

testing.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
testing.maybe_bong

(Testing) Like bong, but returns None in case of failure.

Arguments:

  • targets: Set[com.digitalasset.canton.identity.ParticipantId]
  • timeoutMillis: Long
  • levels: Long
  • gracePeriodMillis: Long
  • workflowId: String
  • id: String

Return type

Option[scala.concurrent.duration.Duration]
testing.pcs_search

(Testing) Lookup contracts in the Private Contract Store

Arguments:

  • domainAlias: com.digitalasset.canton.DomainAlias
  • filterId: String
  • filterPackage: String
  • filterTemplate: String
  • activeSet: Boolean
  • limit: Int

Return type

List[(Boolean, com.digitalasset.canton.protocol.SerializableContract)]

Get raw access to the PCS of the given domain sync controller. The filter commands will check if the target value ``contains`` the given string. The arguments can be started with ``^`` such that ``startsWith`` is used for comparision or ``!`` to use ``equals``. The ``activeSet`` argument allows to restrict the search to the active contract set.

testing.sequencer_messages

(Testing) Retrieve all sequencer messages

Arguments:

  • domain: com.digitalasset.canton.DomainAlias

Return type

Option[Iterable[com.digitalasset.canton.sequencing.SignedSequencedEvent[com.digitalasset.canton.protocol.messages.DefaultOpenEnvelope]]]
testing.transaction_search

(Testing) Lookup of accepted transactions

Arguments:

  • domain: com.digitalasset.canton.DomainAlias

Return type

Seq[(String, com.daml.ledger.participant.state.v1.CommittedTransaction)]

Show the accepted transactions as they appear in the event logs. To select only transactions from a particular domain, use the domain alias. Leave the domain blank to search the combined event log.

Database

db.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
db.migrate
Migrates the instance's database if using a database storage

Health

health.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
health.maybe_ping

(Testing) Sends a ping to the target participant over the ledger. Yields Some(duration) in case of success and None in case of failure.

Arguments:

  • participantId: com.digitalasset.canton.identity.ParticipantId
  • timeoutMillis: Long
  • workflowId: String
  • id: String

Return type

Option[scala.concurrent.duration.Duration]
health.ping

Sends a ping to the target participant over the ledger. Yields the duration in case of success and throws a RuntimeException in case of failure.

Arguments:

  • participantId: com.digitalasset.canton.identity.ParticipantId
  • timeoutMillis: Long
  • workflowId: String
  • id: String

Return type

scala.concurrent.duration.Duration
health.status

Get human readable status info

Return type

com.digitalasset.canton.admin.api.client.data.ParticipantStatus

Domain Connectivity

domains.accept_agreement

Accept the service agreement of the given domain alias

Arguments:

  • domainAlias: com.digitalasset.canton.DomainAlias
  • agreementId: String
domains.active

(Testing) Test whether a participant is connected to and permissioned on a domain reference

Arguments:

  • reference: com.digitalasset.canton.console.DomainReference

Return type

Boolean
domains.active

Test whether a participant is connected to and permissioned on a domain

Arguments:

  • domain: com.digitalasset.canton.DomainAlias

Return type

Boolean
domains.config

Returns the current configuration of a given domain

Arguments:

  • domain: com.digitalasset.canton.DomainAlias

Return type

Option[com.digitalasset.canton.participant.domain.DomainConnectionConfig]
domains.connect

Macro to connect a participant to a domain given by connection

Arguments:

  • domainAlias: String
  • connection: String
  • manualConnect: Boolean
  • essentialState: Option[com.digitalasset.canton.identity.EssentialState]
  • certificatesPath: String
  • priority: Int

Return type

com.digitalasset.canton.participant.domain.DomainConnectionConfig
domains.connect

Macro to connect a participant to a domain given by connection

Arguments:

  • config: com.digitalasset.canton.participant.domain.DomainConnectionConfig
domains.connect_local

Macro to connect a participant to a local domain given by reference

Arguments:

  • domain: com.digitalasset.canton.console.LocalDomainReference
  • manualConnect: Boolean
  • alias: Option[String]
  • waitUntilPackagesReady: Boolean

If waitUntilPackagesReady is true, the command blocks until every configured participant has finished processing package usage information.

domains.disconnect

Disconnect this participant from the given domain

Arguments:

  • domainAlias: com.digitalasset.canton.DomainAlias
domains.get_agreement

Get the service agreement of the given domain alias and if it has been accepted already.

Arguments:

  • domainAlias: com.digitalasset.canton.DomainAlias

Return type

Option[(com.digitalasset.canton.participant.admin.v0.Agreement, Boolean)]
domains.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
domains.is_connected

(Testing) Test whether a participant is connected to a domain reference

Arguments:

  • reference: com.digitalasset.canton.console.DomainReference

Return type

Boolean
domains.list_connected

List the connected domains of this participant

Return type

Seq[(com.digitalasset.canton.DomainAlias, com.digitalasset.canton.DomainId)]
domains.list_registered

List the configured domains of this participant

Return type

Seq[(com.digitalasset.canton.participant.domain.DomainConnectionConfig, Boolean)]
domains.modify

Modify existing domain connection

Arguments:

  • config: com.digitalasset.canton.participant.domain.DomainConnectionConfig
domains.reconnect
Reconnect this participant to all domains which are not marked as manual start
domains.reconnect

Connect this participant to the given domain

Arguments:

  • domainAlias: com.digitalasset.canton.DomainAlias
  • waitUntilPackagesReady: Boolean

If waitUntilPackagesReady is true, the command blocks until every configured participant has finished processing package usage information.

domains.register

Register new domain connection

Arguments:

  • config: com.digitalasset.canton.participant.domain.DomainConnectionConfig
  • waitUntilPackagesReady: Boolean

If waitUntilPackagesReady is true, the command blocks until every configured participant has finished processing package usage information.

Packages

packages.find

Return package-ids containing given modules

Arguments:

  • templateId: String

Return type

Seq[com.digitalasset.canton.participant.admin.v0.PackageDescription]
packages.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
packages.list

List packages stored on the participant

Return type

Seq[com.digitalasset.canton.participant.admin.v0.PackageDescription]
packages.list_contents

List package contents

Arguments:

  • packageId: String

Return type

Seq[com.digitalasset.canton.participant.admin.v0.ModuleDescription]
packages.upload

Upload a raw DAML-LF package

Arguments:

  • path: String
  • waitUntilPackagesReady: Boolean

If waitUntilPackagesReady is true, the command blocks until every configured participant has finished processing package usage information.

packages.wait_until_ready

Waits until packages are ready to use

Arguments:

  • timeout: scala.concurrent.duration.FiniteDuration

Package Usages

packages.usages.create

Creates a new package usage statement for the main package in a given DAR.

Arguments:

  • darPath: String
  • domainReference: com.digitalasset.canton.console.DomainReference
  • observers: Seq[com.digitalasset.canton.identity.ParticipantId]

Return type

com.digitalasset.canton.console.commands.ParticipantAdministration.packages.usages.PackageUsageStatement
packages.usages.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
packages.usages.list

Lists all packages usage statements known to this participant.

Arguments:

  • filterMainPackage: Option[com.daml.lf.data.Ref.PackageId]
  • filterPackage: Option[com.daml.lf.data.Ref.PackageId]
  • filterDomainId: Option[com.digitalasset.canton.DomainId]
  • filterUsers: Option[Set[com.digitalasset.canton.identity.ParticipantId]]
  • filterObservers: Option[Set[com.digitalasset.canton.identity.ParticipantId]]

Return type

Seq[com.digitalasset.canton.console.commands.ParticipantAdministration.packages.usages.PackageUsageStatement]
packages.usages.PackageUsageStatement.invite

Creates a new statement with additional observers.

Arguments:

  • newObservers: Set[com.digitalasset.canton.identity.ParticipantId]

Return type

com.digitalasset.canton.console.commands.ParticipantAdministration.packages.usages.PackageUsageStatement

Ignores new observers that are already users or observers. Fails if the underlying participant is not a user.

packages.usages.PackageUsageStatement.join

Creates a new statement with the submitting participant as user.

Return type

com.digitalasset.canton.console.commands.ParticipantAdministration.packages.usages.PackageUsageStatement

Has no effect, if the submitting participant is not an observer.

packages.usages.PackageUsageStatement.leave

Creates a new statement without the submitting participant as user or observer.

Has no effect, if the submitting participant is not a user or observer.

DAR Management

dars.download

Downloads the DAR file with the given hash to the given directory

Arguments:

  • darHash: String
  • directory: String
dars.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
dars.list

List installed DAR files

Return type

Seq[com.digitalasset.canton.participant.admin.v0.DarDescription]
dars.upload

Upload a DAR

Arguments:

  • path: String
  • strongConsistency: Boolean
  • waitUntilPackagesReady: Boolean

Return type

String

Uploads a DAR to Canton. If strongConsistency is set to true, we'll also upload to the ledger-api server, ensuring that there is no race condition when subsequently using the packages. If waitUntilPackagesReady is true, the command blocks until every configured participant has finished processing package usage information.

DAR Sharing

dars.sharing.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
dars.sharing.requests.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
dars.sharing.requests.list

List pending requests to share a DAR with others

Return type

Seq[com.digitalasset.canton.participant.admin.v0.ListShareRequestsResponse.Item]
dars.sharing.requests.propose

Share a DAR with other participants

Arguments:

  • darHash: String
  • participantId: com.digitalasset.canton.identity.ParticipantId
dars.sharing.offers.accept

Accept the offer to share a DAR

Arguments:

  • shareId: String
dars.sharing.offers.list

List received DAR sharing offers

Return type

Seq[com.digitalasset.canton.participant.admin.v0.ListShareOffersResponse.Item]
dars.sharing.offers.reject

Reject the offer to share a DAR

Arguments:

  • shareId: String
  • reason: String
dars.sharing.whitelist.add

Add party to my DAR sharing whitelist

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
dars.sharing.whitelist.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
dars.sharing.whitelist.list
List parties that are currently whitelisted to share DARs with me
dars.sharing.whitelist.remove

Remove party from my DAR sharing whitelist

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId

Party Management

The party management commands allow to conveniently enable and disable parties on the local node. Under the hood, they use the more complicated but feature-richer identity management commands.

parties.await_topology_heartbeat

(Preview) Waits for topology heartbeat

Arguments:

  • partyAssignment: Set[(com.digitalasset.canton.identity.PartyId, T)]
  • timeout: java.time.Duration

Will throw an exception if the heartbeat has not been observed within the given timeout.

parties.disable

Disable party on participant

Arguments:

  • name: String
parties.enable

Enable/add party to participant

Arguments:

  • name: String
  • displayName: Option[String]
  • waitForDomain: com.digitalasset.canton.console.commands.DomainChoice

Return type

com.digitalasset.canton.identity.PartyId
parties.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
parties.hosted

List parties managed by this participant

Arguments:

  • filterParty: String
  • filterStore: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListPartiesResult]

The filterStore command expects the id of the store which is either the `DomainId` or the term `Authorized` for the identity managers store. Inactive participants hosting the party are not shown in the result.

parties.list

List active parties, their active participants, and the participants' permissions on domains.

Arguments:

  • filterParty: String
  • filterParticipant: String
  • filterStore: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListPartiesResult]

This command allows to deeply inspect the identity state used for synchronisation. The response is built from the timestamped identity transactions of each domain. The filterStore command expects the id of the store which is either the `DomainId` or the term `Authorized` for the identity managers store.

parties.set_display_name

Set party display name

Arguments:

  • party: com.digitalasset.canton.identity.PartyId
  • displayName: String

Locally set the party display name (shown on the ledger-api) to the given value

Key Administration

keys.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
keys.public.export

Export public key

Arguments:

  • fingerprint: com.digitalasset.canton.crypto.Fingerprint
  • outputFile: Option[String]

Return type

com.digitalasset.canton.crypto.KeyEntry
keys.public.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
keys.public.list

List public keys in registry

Arguments:

  • filterFingerprint: String
  • filterContext: String

Return type

Seq[com.digitalasset.canton.crypto.KeyEntry]

Returns all public keys that have been added to the key registry. Optional arguments can be used for filtering.

keys.public.list_by_owner

List keys for given keyOwner.

Arguments:

  • keyOwner: com.digitalasset.canton.identity.KeyOwner
  • filterDomain: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListKeyOwnersResult]

This command is a convenience wrapper for `list_key_owners`, taking an explicit keyOwner as search argument. The response includes the public keys.

keys.public.list_owners

List active owners with keys for given search arguments.

Arguments:

  • filterKeyOwnerUid: String
  • filterKeyOwnerType: Option[com.digitalasset.canton.identity.KeyOwnerCode]
  • filterDomain: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListKeyOwnersResult]

This command allows deep inspection of the identity state. The response includes the public keys. Optional filterKeyOwnerType type can be 'ParticipantId.Code' , 'MediatorId.Code','SequencerId.Code', 'DomainIdentityManagerId.Code'.

keys.public.load

Load a public key from file a file and import it

Arguments:

  • filename: String
  • context: String

Return type

com.digitalasset.canton.crypto.Fingerprint
keys.public.load

Import public key

Arguments:

  • key: com.digitalasset.canton.crypto.PublicKey
  • context: String

Return type

com.digitalasset.canton.crypto.Fingerprint

Import a public key and store it together with a string used to provide some context to that key.

keys.secret.delete

Delete private key

Arguments:

  • fingerprint: com.digitalasset.canton.crypto.Fingerprint
  • force: Boolean
keys.secret.export

Export private key

Arguments:

  • fingerprint: com.digitalasset.canton.crypto.Fingerprint
  • outputFile: Option[String]

Return type

com.digitalasset.canton.admin.api.client.data.SerializedPrivateKey
keys.secret.generate

Generate new public/private key pair and store it in the vault

Arguments:

  • purposes: Set[com.digitalasset.canton.crypto.KeyPurpose]
  • context: String
  • scheme: Option[com.digitalasset.canton.crypto.KeyScheme]

Return type

com.digitalasset.canton.crypto.KeyEntry

The context argument allows you to store an associated string for your convenience. The scheme can be used to select a key scheme. Only use this if you need to create 'EcDsaP384Raw' keys for X509 certificates. Otherwise, let the system select the scheme.

keys.secret.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
keys.secret.list

List keys in private vault

Arguments:

  • filterFingerprint: String
  • filterContext: String
  • purpose: Set[com.digitalasset.canton.crypto.KeyPurpose]

Return type

Seq[com.digitalasset.canton.crypto.KeyEntry]

Returns all public keys to the corresponding private keys in the key vault. Optional arguments can be used for filtering.

keys.secret.load

Import private key

Arguments:

  • key: com.digitalasset.canton.admin.api.client.data.SerializedPrivateKey
  • context: String
keys.secret.load

Load and import private key from file

Arguments:

  • filename: String
  • context: String
certs.generate

(Preview) Generate a self-signed certificate

Arguments:

  • uid: com.digitalasset.canton.identity.UniqueIdentifier
  • certificateKey: com.digitalasset.canton.crypto.Fingerprint
  • subject: String
  • subjectAlternativeNames: Seq[String]

Return type

com.digitalasset.canton.admin.api.client.data.CertificateResult
certs.list

(Preview) List locally stored certificates

Arguments:

  • filterUid: String

Return type

List[com.digitalasset.canton.admin.api.client.data.CertificateResult]
certs.load

(Preview) Import X509 certificate in PEM format

Arguments:

  • x509Pem: String

Return type

String

Identity Administration

The identity commands can be used to manipulate and inspect the identity state. In all commands, we use fingerprints to refer to public keys. Internally, these fingerprints are resolved using the key registry (which is a map of Fingerprint -> PublicKey). Any key can be added to the key registry using the keys.public.load commands.

identity.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.init_id

Initialize the node with a unique identifier

Arguments:

  • identifier: com.digitalasset.canton.identity.Identifier
  • fingerprint: com.digitalasset.canton.crypto.Fingerprint

Return type

com.digitalasset.canton.identity.UniqueIdentifier
identity.initialized

Returns true if a unique identifier has been assigned to this node

Return type

Boolean
identity.load_transaction

Upload signed identity transaction

Arguments:

  • bytes: com.google.protobuf.ByteString

Upload previously exported identity transaction into authorized store

identity.stores.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.stores.list

List available identity stores

Return type

Seq[String]
identity.namespace_delegations.authorize

Change namespace delegation

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • namespace: com.digitalasset.canton.crypto.Fingerprint
  • authorizedKey: com.digitalasset.canton.crypto.Fingerprint
  • isRootDelegation: Boolean

Return type

com.google.protobuf.ByteString

Delegates the authority to authorize identity transactions in a certain namespace to a certain key. The keys are referred to using their fingerprints. They need to be either locally generated or have been previously imported. ops: Either Add or Remove the delegation. signedBy: Optional fingerprint of the authorizing key. The authorizing key needs to be either the authorizedKey for root certificates. Otherwise, the signedBy key needs to refer to a previously authorized key, which means that we use the signedBy key to refer to a locally available CA. authorizedKey: Fingerprint of the key to be authorized. If signedBy equals authorizedKey, then this transaction corresponds to a self-signed root certificate. If the keys differ, then we get an intermediate CA. isRootDelegation: If set to true (default = false), the authorized key will be allowed to issue NamespaceDelegations.

identity.namespace_delegations.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.namespace_delegations.list

List namespace delegation transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListNamespaceDelegationResult]
identity.identifier_delegations.authorize

Change identifier delegation

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • identifier: com.digitalasset.canton.identity.UniqueIdentifier
  • authorizedKey: com.digitalasset.canton.crypto.Fingerprint

Return type

com.google.protobuf.ByteString

Delegates the authority of a certain identifier to a certain key. This corresponds to a normal certificate which binds identifier to a key. The keys are referred to using their fingerprints. They need to be either locally generated or have been previously imported. ops: Either Add or Remove the delegation. signedBy: Refers to the optional fingerprint of the authorizing key which in turn refers to a specific, locally existing certificate. authorizedKey: Fingerprint of the key to be authorized.

identity.identifier_delegations.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.identifier_delegations.list

List identifier delegation transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListIdentifierDelegationResult]
identity.owner_to_key_mappings.authorize

Change an owner to key mapping

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • keyOwner: com.digitalasset.canton.identity.KeyOwner
  • key: com.digitalasset.canton.crypto.Fingerprint
  • purposes: Set[com.digitalasset.canton.crypto.KeyPurpose]

Return type

com.google.protobuf.ByteString

Change a owner to key mapping. A key owner is anyone in the system that needs a key-pair known to all members (participants, mediator, sequencer, identity manager) of a domain. ops: Either Add or Remove the key mapping update. signedBy: Optional fingerprint of the authorizing key which in turn refers to a specific, locally existing certificate. ownerType: Role of the following owner (Participant, Sequencer, Mediator, DomainIdentityManager) owner: Unique identifier of the owner. key: Fingerprint of key purposes: The purposes of the owner to key mapping.

identity.owner_to_key_mappings.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.owner_to_key_mappings.list

List owner to key mapping transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterKeyOwnerType: Option[com.digitalasset.canton.identity.KeyOwnerCode]
  • filterKeyOwnerUid: String
  • filterKeyPurpose: Option[com.digitalasset.canton.crypto.KeyPurpose]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListOwnerToKeyMappingResult]
identity.party_to_participant_mappings.authorize

Change party to participant mapping

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • party: com.digitalasset.canton.identity.PartyId
  • participant: com.digitalasset.canton.identity.ParticipantId
  • side: com.digitalasset.canton.identity.RequestSide
  • permission: com.digitalasset.canton.identity.ParticipantPermission

Return type

com.google.protobuf.ByteString

Change the association of a party to a participant. If both identifiers are in the same namespace, then the request-side is Both. If they differ, then we need to say whether the request comes from the party (RequestSide.From) or from the participant (RequestSide.To). And, we need the matching request of the other side. ops: Either Add or Remove the mapping signedBy: Refers to the optional fingerprint of the authorizing key which in turn refers to a specific, locally existing certificate. party: The unique identifier of the party we want to map to a participant. participant: The unique identifier of the participant to which the party is supposed to be mapped. side: The request side (RequestSide.From if we the transaction is from the perspective of the party, RequestSide.To from the participant.) privilege: The privilege of the given participant which allows us to restrict an association (e.g. Confirmation or Observation).

identity.party_to_participant_mappings.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.party_to_participant_mappings.list

List party to participant mapping transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterParty: String
  • filterParticipant: String
  • filterRequestSide: Option[com.digitalasset.canton.identity.RequestSide]
  • filterPermission: Option[com.digitalasset.canton.identity.ParticipantPermission]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListPartyToParticipantResult]

Return a list of party to participant mappings matching the provided optional filter arguments.

identity.participants.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.participants.list

List participant states

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • activeOnly: Boolean
  • filterParticipant: String

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListParticipantStateResult]
identity.legal_identities.authorize

Authorize a legal identity claim transaction

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • claim: com.digitalasset.canton.identity.SignedLegalIdentityClaim

Return type

com.google.protobuf.ByteString
identity.legal_identities.generate

Generate a signed legal identity claim

Arguments:

  • claim: com.digitalasset.canton.identity.LegalIdentityClaim

Return type

com.digitalasset.canton.identity.SignedLegalIdentityClaim
identity.legal_identities.generate_x509

Generate a signed legal identity claim for a specific X509 certificate

Arguments:

  • uid: com.digitalasset.canton.identity.UniqueIdentifier
  • certificateId: com.digitalasset.canton.crypto.tink.CertificateId

Return type

com.digitalasset.canton.identity.SignedLegalIdentityClaim
identity.legal_identities.list

List legal identities

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterUid: String

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListSignedLegalIdentityClaimResult]
identity.legal_identities.list_x509

List legal identities with X509 certificates

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterUid: String

Return type

Seq[(com.digitalasset.canton.identity.UniqueIdentifier, com.digitalasset.canton.crypto.tink.X509Certificate)]

Ledger API Access

The following commands on a participant reference provide access to the participant’s Ledger API services.

ledger_api.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.ledger_id

Get ledger id

Return type

String

Transaction Service

ledger_api.transactions.by_id

Get a (tree) transaction by its ID

Arguments:

  • parties: Set[com.digitalasset.canton.identity.PartyId]
  • id: String

Return type

Option[com.daml.ledger.api.v1.transaction.TransactionTree]

Get a transaction tree from the transaction stream by its ID. Returns None if the transaction is not (yet) known at the participant or if the transaction has been pruned via `pruning.prune_by_time`.

ledger_api.transactions.domain_of

Get the domain that a transaction was committed over.

Arguments:

  • transactionId: String

Return type

com.digitalasset.canton.DomainId

Get the domain that a transaction was committed over. Throws an error if the transaction is not (yet) known to the participant or if the transaction has been pruned via `pruning.prune_by_time`.

ledger_api.transactions.end

(Testing) Get ledger end

Return type

com.daml.ledger.api.v1.ledger_offset.LedgerOffset
ledger_api.transactions.flat

(Testing) Get flat transactions

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
  • atLeastNumTransactions: Int
  • beginOffset: com.daml.ledger.api.v1.ledger_offset.LedgerOffset
  • verbose: Boolean
  • timeout: scala.concurrent.duration.FiniteDuration

Return type

Seq[com.daml.ledger.api.v1.transaction.Transaction]

This function will connect to the transaction stream and read a number of transactions either until the threshold has been reached or the timeout (default two seconds) exceeded. By default, all transactions from the ledger beginning are read. If the participant has been pruned via `pruning.prune_by_time` and if `beginOffset` is lower than or equal to the pruning offset, this command fails with a `NOT_FOUND` error.

ledger_api.transactions.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.transactions.trees

(Testing) Get transaction trees

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
  • atLeastNumTransactions: Int
  • beginOffset: com.daml.ledger.api.v1.ledger_offset.LedgerOffset
  • verbose: Boolean
  • timeout: scala.concurrent.duration.FiniteDuration

Return type

Seq[com.daml.ledger.api.v1.transaction.TransactionTree]

This function will connect to the transaction stream and read a number of transaction trees either until the threshold has been reached or the timeout (default two seconds) exceeded. By default, all transaction trees from the ledger beginning are read. If the participant has been pruned via `pruning.prune_by_time` and if `beginOffset` is lower than or equal to the pruning offset, this command fails with a `NOT_FOUND` error.

Command Service

ledger_api.commands.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.commands.submit

Submit command and wait for the resulting transaction, returning the transaction tree or failing otherwise

Arguments:

  • party: com.digitalasset.canton.identity.PartyId
  • commands: Seq[com.daml.ledger.api.v1.commands.Command]
  • workflowId: String
  • commandId: String
  • optTimeout: Option[java.time.Duration]
  • minLedgerTimeAbs: Option[java.time.Instant]

Return type

com.daml.ledger.api.v1.transaction.TransactionTree

Submits a command, waits for the resulting transaction to commit and returns it. If the timeout is set, it also waits for the transaction to appear at all other configured participants who were involved in the transaction. The call blocks until the transaction commits or fails; the timeout only specifies how long to wait at the other participants. Fails if the transaction doesn't commit, or if it doesn't become visible to the involved participants in the allotted time. Note that if the optTimeout is set and the involved parties are concurrently enabled/disabled or their participants are connected/disconnected, the command may currently result in spurious timeouts or may return before the transaction appears at all the involved participants.

ledger_api.commands.submit_async

Submit command asynchronously

Arguments:

  • party: com.digitalasset.canton.identity.PartyId
  • commands: Seq[com.daml.ledger.api.v1.commands.Command]
  • workflowId: String
  • commandId: String
ledger_api.commands.submit_flat

Submit command and wait for the resulting transaction, returning the flattened transaction or failing otherwise

Arguments:

  • party: com.digitalasset.canton.identity.PartyId
  • commands: Seq[com.daml.ledger.api.v1.commands.Command]
  • workflowId: String
  • commandId: String
  • optTimeout: Option[java.time.Duration]
  • minLedgerTimeAbs: Option[java.time.Instant]

Return type

com.daml.ledger.api.v1.transaction.Transaction

Submits a command, waits for the resulting transaction to commit, and return the "flattened" transaction. If the timeout is set, it also waits for the transaction to appear at all other configured participants who were involved in the transaction. The call blocks until the transaction commits or fails; the timeout only specifies how long to wait at the other participants. Fails if the transaction doesn't commit, or if it doesn't become visible to the involved participants in the allotted time. Note that if the optTimeout is set and the involved parties are concurrently enabled/disabled or their participants are connected/disconnected, the command may currently result in spurious timeouts or may return before the transaction appears at all the involved participants.

Command Completion Service

ledger_api.completions.end

(Testing) Read the current command completion offset

Return type

com.daml.ledger.api.v1.ledger_offset.LedgerOffset
ledger_api.completions.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.completions.list

(Testing) Lists command completions from the specified offset

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
  • atLeastNumCompletions: Int
  • offset: com.daml.ledger.api.v1.ledger_offset.LedgerOffset
  • applicationId: String
  • timeout: scala.concurrent.duration.FiniteDuration
  • filter: com.daml.ledger.api.v1.completion.Completion => Boolean

Return type

Seq[com.daml.ledger.api.v1.completion.Completion]

If the participant has been pruned via `pruning.prune_by_time and if `offset` is lower than or equal to the pruning offset, this command fails with a `NOT_FOUND` error.

Active Contract Service

ledger_api.acs.await

Wait until a contract becomes available

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
  • companion: com.daml.ledger.client.binding.TemplateCompanion[T]
  • predicate: com.daml.ledger.client.binding.Contract[T] => Boolean
  • timeout: java.time.Duration

Return type

(partyId: com.digitalasset.canton.identity.PartyId, companion: com.daml.ledger.client.binding.TemplateCompanion[T], predicate: com.daml.ledger.client.binding.Contract[T] => Boolean, timeout: java.time.Duration)com.daml.ledger.client.binding.Contract[T]

This function can be used for contracts with a code-generated Scala model. You can refine your search using the `filter` function argument. The command will wait until the contract appears or throw an exception once it times out.

ledger_api.acs.await_active_contract

(Testing) Wait until the party sees the given contract in the active contract service

Arguments:

  • party: com.digitalasset.canton.identity.PartyId
  • contractId: com.digitalasset.canton.protocol.LfContractId
  • timeout: java.time.Duration

Will throw an exception if the contract is not found to be active within the given timeout

ledger_api.acs.filter

Filter the ACS for contracts of a particular Scala code-generated template

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
  • templateCompanion: com.daml.ledger.client.binding.TemplateCompanion[T]
  • predicate: com.daml.ledger.client.binding.Contract[T] => Boolean

Return type

(partyId: com.digitalasset.canton.identity.PartyId, templateCompanion: com.daml.ledger.client.binding.TemplateCompanion[T], predicate: com.daml.ledger.client.binding.Contract[T] => Boolean)Seq[com.daml.ledger.client.binding.Contract[T]]

To use this function, ensure a code-generated Scala model for the target template exists. You can refine your search using the `predicate` function argument.

ledger_api.acs.find_generic

Generic search for contracts

Arguments:

  • partyId: com.digitalasset.canton.identity.PartyId
  • filter: com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.WrappedCreatedEvent => Boolean
  • timeout: java.time.Duration

Return type

com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.WrappedCreatedEvent

This search function returns an untyped ledger-api event. The find will wait until the contract appears or throw an exception once it times out.

ledger_api.acs.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.acs.of_all

List the set of active contracts for all parties hosted on this participant

Arguments:

  • verbose: Boolean

Return type

Seq[com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.WrappedCreatedEvent]
ledger_api.acs.of_party

List the set of active contracts of a given party

Arguments:

  • party: com.digitalasset.canton.identity.PartyId
  • verbose: Boolean

Return type

Seq[com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.WrappedCreatedEvent]

Package Service

ledger_api.packages.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.packages.list

(Preview) List DAML Packages

Return type

Seq[com.daml.ledger.api.v1.admin.package_management_service.PackageDetails]
ledger_api.packages.upload_dar

(Preview) Upload packages from DAR file

Arguments:

  • darPath: String
  • waitUntilPackagesReady: Boolean

If waitUntilPackagesReady is true, the command blocks until every configured participant has finished processing package usage information.

Party Management Service

ledger_api.parties.allocate

(Preview) Allocate new party

Arguments:

  • party: String
  • displayName: String

Return type

com.daml.ledger.api.v1.admin.party_management_service.PartyDetails
ledger_api.parties.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
ledger_api.parties.list

(Preview) List parties known by the ledger API server

Return type

Seq[com.daml.ledger.api.v1.admin.party_management_service.PartyDetails]

Composability

transfer.execute

Transfer the contract from the origin domain to the target domain

Arguments:

  • submittingParty: com.digitalasset.canton.identity.PartyId
  • contractId: com.digitalasset.canton.protocol.LfContractId
  • originDomain: com.digitalasset.canton.DomainAlias
  • targetDomain: com.digitalasset.canton.DomainAlias

Macro that first calls transfer_out and then transfer_in. No error handling is done.

transfer.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
transfer.in

Transfer-in a contract in transit to the target domain

Arguments:

  • submittingParty: com.digitalasset.canton.identity.PartyId
  • transferId: com.digitalasset.canton.protocol.TransferId
  • targetDomain: com.digitalasset.canton.DomainAlias

Manually transfers a contract in transit into the target domain. The command returns when the transfer-in has completed successfully. If the transferExclusivityTimeout in the target domain's parameters is set to a positive value, all participants of all stakeholders connected to both origin and target domain will attempt to transfer-in the contract automatically after the exclusivity timeout has elapsed.

transfer.lookup_contract_domain

Lookup the active domain for the provided contracts

Arguments:

  • contractIds: com.digitalasset.canton.protocol.LfContractId*

Return type

Map[com.digitalasset.canton.protocol.LfContractId,String]
transfer.out

Transfer-out a contract from the origin domain with destination target domain

Arguments:

  • submittingParty: com.digitalasset.canton.identity.PartyId
  • contractId: com.digitalasset.canton.protocol.LfContractId
  • originDomain: com.digitalasset.canton.DomainAlias
  • targetDomain: com.digitalasset.canton.DomainAlias

Return type

com.digitalasset.canton.protocol.TransferId

Transfers the given contract out of the origin domain with destination target domain. The command returns the ID of the transfer when the transfer-out has completed successfully. The contract is in transit until the transfer-in has completed on the target domain. The submitting party must be a stakeholder of the contract and the participant must have submission rights for the submitting party on the origin domain. It must also be connected to the target domain.

transfer.search

Search the currently in-flight transfers

Arguments:

  • targetDomain: com.digitalasset.canton.DomainAlias
  • filterOriginDomain: Option[com.digitalasset.canton.DomainAlias]
  • filterTimestamp: Option[java.time.Instant]
  • filterSubmittingParty: Option[com.digitalasset.canton.identity.PartyId]
  • limit: Int

Return type

Seq[com.digitalasset.canton.participant.admin.grpc.TransferSearchResult]

Returns all in-flight transfers with the given target domain that match the filters, but no more than the limit specifies.

Ledger Pruning

pruning.find_safe_timestamp

(Preview) Return the highest timestamp (if any), before the given one, at which pruning is safely possible on the given domain

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • beforeOrAt: java.time.Instant

Return type

Option[java.time.Instant]

Return the highest timestamp (if any), before the given one, at which pruning is safely possible on the given domain. If a timestamp is returned, it is guaranteed to fall at a "commitment tick" as specified by the reconciliation interval.

pruning.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
pruning.prune_by_time

Prune the ledger roughly at the specified time.

Arguments:

  • pruneBefore: java.time.Instant

Return type

com.digitalasset.canton.admin.api.client.commands.LedgerApiTypeWrappers.ParticipantPrunedAt

Returns the participant ledger offset up to which the participant ledger has been pruned inclusively. Note that subsequent attempts to read transactions or command completions by specifying an offset lower than or equal to this offset will result in a `NOT_FOUND` error. This happens if the offset parameters to the `ledger_api.transactions.flat`, `ledger_api.transactions.trees`, and `ledger_api.completions.list` are too low and thus attempt to read pruned state. Optionally the `prune_by_time` call returns a second ledger offset in case the ledger has chosen to internally retain any older, archived portion of the participant ledger thus enabling the caller to make a determination up to what point a "right-to-be-forgotten" request has been complied with.

Bilateral Commitments

commitments.computed

Lookup ACS commitments locally computed as part of the reconciliation protocol

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • start: java.time.Instant
  • end: java.time.Instant
  • counterParticipant: Option[com.digitalasset.canton.identity.ParticipantId]

Return type

Iterable[(com.digitalasset.canton.protocol.messages.CommitmentPeriod, com.digitalasset.canton.identity.ParticipantId, com.digitalasset.canton.protocol.messages.AcsCommitment.CommitmentType)]
commitments.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
commitments.received

Lookup ACS commitments received from other participants as part of the reconciliation protocol

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • start: java.time.Instant
  • end: java.time.Instant
  • counterParticipant: Option[com.digitalasset.canton.identity.ParticipantId]

Return type

Iterable[com.digitalasset.canton.protocol.messages.SignedProtocolMessage[com.digitalasset.canton.protocol.messages.AcsCommitment]]

Participant Repair

repair.add

Add specified contracts to specific domain on local participant.

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • contractsToAdd: Seq[com.digitalasset.canton.protocol.SerializableContractWithWitnesses]
  • ignoreAlreadyAdded: Boolean

Return type

Either[String,Unit]

This is a last resort command to recover from data corruption, e.g. in scenarios in which participant contracts have somehow gotten out of sync and need to be manually created. The participant needs to be disconnected from the specified "domain" at the time of the call, and as of now the domain needs to be empty and healthy. For each "contractsToAdd", specify "witnesses", local parties, in case no local party is a stakeholder. The "ignoreAlreadyAdded" flag makes it possible to invoke the command multiple times with the same parameters in case an earlier command invocation has failed. As repair commands are powerful tools to recover from unforeseen data corruption, but dangerous under normal operation, use of this command requires (temporarily) enabling the "parameters.enable-repair-commands" configuration. In addition repair commands can run for an unbounded time depending on the number of contracts passed in. Be sure to not connect the participant to the domain until the call returns.

repair.change_domain

Move contracts with specified Contract IDs from one domain to another.

Arguments:

  • contractIds: Seq[com.digitalasset.canton.protocol.LfContractId]
  • sourceDomain: com.digitalasset.canton.DomainAlias
  • targetDomain: com.digitalasset.canton.DomainAlias
  • skipArchived: Boolean

Return type

Either[String,Unit]

This is a last resort command to recover from data corruption in scenarios in which a domain is irreparably broken and formerly connected participants need to move contracts to another, healthy domain. The participant needs to be disconnected from both the "sourceDomain" and the "targetDomain". Also as of now the target domain needs to be empty and healthy. Contracts already present in the target domain will be skipped, and this makes it possible to invoke this command in an "idempotent" fashion in case an earlier attempt had resulted in an error. The "skipArchived" flag makes it possible to only move contracts not archived in the "sourceDomain". As repair commands are powerful tools to recover from unforeseen data corruption, but dangerous under normal operation, use of this command requires (temporarily) enabling the "parameters.enable-repair-commands" configuration. In addition repair commands can run for an unbounded time depending on the number of contract ids passed in. Be sure to not connect the participant to either domain until the call returns.

repair.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
repair.purge

Purge contracts with specified Contract IDs from local participant.

Arguments:

  • domain: com.digitalasset.canton.DomainAlias
  • contractIds: Seq[com.digitalasset.canton.protocol.LfContractId]
  • ignoreAlreadyPurged: Boolean

Return type

Either[String,Unit]

This is a last resort command to recover from data corruption, e.g. in scenarios in which participant contracts have somehow gotten out of sync and need to be manually purged, or in situations in which stakeholders are no longer available to agree to their archival. The participant needs to be disconnected from the domain on which the contracts with "contractIds" reside at the time of the call. The "ignoreAlreadyPurged" flag makes it possible to invoke the command multiple times with the same parameters in case an earlier command invocation has failed. As repair commands are powerful tools to recover from unforeseen data corruption, but dangerous under normal operation, use of this command requires (temporarily) enabling the "parameters.enable-repair-commands" configuration. In addition repair commands can run for an unbounded time depending on the number of contract ids passed in. Be sure to not connect the participant to the domain until the call returns.

Domain Administration Commands

clear_cache

(Testing) Clear locally cached variables

Some commands cache values on the client side. Use this command to explicitly clear the caches of these values.

config

Returns the domain configuration

Return type

com.digitalasset.canton.domain.config.DomainConfig
help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
id

Yields the globally unique id of this domain. Throws an exception, if the id has not yet been allocated (e.g., the domain has not yet been started).

Return type

com.digitalasset.canton.DomainId
start
Start the instance
stop
Stop the instance

Health

health.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
health.status

Get human readable status info

Return type

com.digitalasset.canton.admin.api.client.data.DomainStatus

Database

db.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
db.migrate
Migrates the instance's database if using a database storage

Participants

participants.active

Test whether a participant is permissioned on this domain

Arguments:

  • participantId: com.digitalasset.canton.identity.ParticipantId

Return type

Boolean
participants.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
participants.list

List participant states

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListParticipantStateResult]

This command will list the currently valid state as stored in the authorized store. For a deep inspection of the identity management history, use the `identity.participants.list` command.

participants.set_state

Change state and trust level of participant

Arguments:

  • participant: com.digitalasset.canton.identity.ParticipantId
  • state: com.digitalasset.canton.identity.ParticipantPermission
  • trustLevel: com.digitalasset.canton.identity.TrustLevel

Set the state of the participant within the domain. Valid states are 'Active', 'Confirming', 'Disabled'. Valid trust levels are 'Vip' and 'Ordinary'.

Sequencer Members

members.delete

(Preview) Permanently delete a member and their events from the sequencer. WARNING: Dangerous method.

Arguments:

  • member: com.digitalasset.canton.identity.Member
  • force: Boolean

Will check that a participant is stale before deleting (use `force = true` to override checks). WARNING: Can easily break a domain or registered participants if used incorrectly.

members.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
members.list

List all registered sequencer members

Return type

Seq[com.digitalasset.canton.identity.Member]
members.member_details

Fetch details on the latest message available and the latest message acknowledged for a member

Arguments:

  • member: com.digitalasset.canton.identity.Member

Return type

com.digitalasset.canton.domain.sequencing.sequencer.store.MemberDetails
members.stale_participants

List participants who haven't been active for a while (defaults to '10 days')

Arguments:

  • durationS: String

Return type

Seq[com.digitalasset.canton.identity.ParticipantId]
members.truncate

(Preview) Truncate acknowledged events for a member

Arguments:

  • member: com.digitalasset.canton.identity.Member

Key Administration

keys.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
keys.public.export

Export public key

Arguments:

  • fingerprint: com.digitalasset.canton.crypto.Fingerprint
  • outputFile: Option[String]

Return type

com.digitalasset.canton.crypto.KeyEntry
keys.public.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
keys.public.list

List public keys in registry

Arguments:

  • filterFingerprint: String
  • filterContext: String

Return type

Seq[com.digitalasset.canton.crypto.KeyEntry]

Returns all public keys that have been added to the key registry. Optional arguments can be used for filtering.

keys.public.list_by_owner

List keys for given keyOwner.

Arguments:

  • keyOwner: com.digitalasset.canton.identity.KeyOwner
  • filterDomain: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListKeyOwnersResult]

This command is a convenience wrapper for `list_key_owners`, taking an explicit keyOwner as search argument. The response includes the public keys.

keys.public.list_owners

List active owners with keys for given search arguments.

Arguments:

  • filterKeyOwnerUid: String
  • filterKeyOwnerType: Option[com.digitalasset.canton.identity.KeyOwnerCode]
  • filterDomain: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListKeyOwnersResult]

This command allows deep inspection of the identity state. The response includes the public keys. Optional filterKeyOwnerType type can be 'ParticipantId.Code' , 'MediatorId.Code','SequencerId.Code', 'DomainIdentityManagerId.Code'.

keys.public.load

Load a public key from file a file and import it

Arguments:

  • filename: String
  • context: String

Return type

com.digitalasset.canton.crypto.Fingerprint
keys.public.load

Import public key

Arguments:

  • key: com.digitalasset.canton.crypto.PublicKey
  • context: String

Return type

com.digitalasset.canton.crypto.Fingerprint

Import a public key and store it together with a string used to provide some context to that key.

keys.secret.delete

Delete private key

Arguments:

  • fingerprint: com.digitalasset.canton.crypto.Fingerprint
  • force: Boolean
keys.secret.export

Export private key

Arguments:

  • fingerprint: com.digitalasset.canton.crypto.Fingerprint
  • outputFile: Option[String]

Return type

com.digitalasset.canton.admin.api.client.data.SerializedPrivateKey
keys.secret.generate

Generate new public/private key pair and store it in the vault

Arguments:

  • purposes: Set[com.digitalasset.canton.crypto.KeyPurpose]
  • context: String
  • scheme: Option[com.digitalasset.canton.crypto.KeyScheme]

Return type

com.digitalasset.canton.crypto.KeyEntry

The context argument allows you to store an associated string for your convenience. The scheme can be used to select a key scheme. Only use this if you need to create 'EcDsaP384Raw' keys for X509 certificates. Otherwise, let the system select the scheme.

keys.secret.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
keys.secret.list

List keys in private vault

Arguments:

  • filterFingerprint: String
  • filterContext: String
  • purpose: Set[com.digitalasset.canton.crypto.KeyPurpose]

Return type

Seq[com.digitalasset.canton.crypto.KeyEntry]

Returns all public keys to the corresponding private keys in the key vault. Optional arguments can be used for filtering.

keys.secret.load

Import private key

Arguments:

  • key: com.digitalasset.canton.admin.api.client.data.SerializedPrivateKey
  • context: String
keys.secret.load

Load and import private key from file

Arguments:

  • filename: String
  • context: String
certs.generate

(Preview) Generate a self-signed certificate

Arguments:

  • uid: com.digitalasset.canton.identity.UniqueIdentifier
  • certificateKey: com.digitalasset.canton.crypto.Fingerprint
  • subject: String
  • subjectAlternativeNames: Seq[String]

Return type

com.digitalasset.canton.admin.api.client.data.CertificateResult
certs.list

(Preview) List locally stored certificates

Arguments:

  • filterUid: String

Return type

List[com.digitalasset.canton.admin.api.client.data.CertificateResult]
certs.load

(Preview) Import X509 certificate in PEM format

Arguments:

  • x509Pem: String

Return type

String

Parties

parties.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
parties.list

List active parties, their active participants, and the participants' permissions on domains.

Arguments:

  • filterParty: String
  • filterParticipant: String
  • filterStore: String
  • asOf: Option[java.time.Instant]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListPartiesResult]

This command allows to deeply inspect the identity state used for synchronisation. The response is built from the timestamped identity transactions of each domain. The filterStore command expects the id of the store which is either the `DomainId` or the term `Authorized` for the identity managers store.

Identity Administration

Identity commands run on the domain identity manager immediately affect the identity state of the domain, which means that all changes are immediately pushed to the connected participants.

identity.export_essential_state

Download and optionally export essential state to file

Arguments:

  • outputFile: Option[String]

Return type

com.digitalasset.canton.identity.EssentialState

The essential state represents the root of trust for a Canton domain (equivalent to a root certificate). You can read more in the Canton architecture documentation. Use this command to download the state to a file, such that it can be shipped to a participant via a secure channel.

identity.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.init_id

Initialize the node with a unique identifier

Arguments:

  • identifier: com.digitalasset.canton.identity.Identifier
  • fingerprint: com.digitalasset.canton.crypto.Fingerprint

Return type

com.digitalasset.canton.identity.UniqueIdentifier
identity.initialized

Returns true if a unique identifier has been assigned to this node

Return type

Boolean
identity.load_transaction

Upload signed identity transaction

Arguments:

  • bytes: com.google.protobuf.ByteString

Upload previously exported identity transaction into authorized store

identity.stores.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.stores.list

List available identity stores

Return type

Seq[String]
identity.namespace_delegations.authorize

Change namespace delegation

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • namespace: com.digitalasset.canton.crypto.Fingerprint
  • authorizedKey: com.digitalasset.canton.crypto.Fingerprint
  • isRootDelegation: Boolean

Return type

com.google.protobuf.ByteString

Delegates the authority to authorize identity transactions in a certain namespace to a certain key. The keys are referred to using their fingerprints. They need to be either locally generated or have been previously imported. ops: Either Add or Remove the delegation. signedBy: Optional fingerprint of the authorizing key. The authorizing key needs to be either the authorizedKey for root certificates. Otherwise, the signedBy key needs to refer to a previously authorized key, which means that we use the signedBy key to refer to a locally available CA. authorizedKey: Fingerprint of the key to be authorized. If signedBy equals authorizedKey, then this transaction corresponds to a self-signed root certificate. If the keys differ, then we get an intermediate CA. isRootDelegation: If set to true (default = false), the authorized key will be allowed to issue NamespaceDelegations.

identity.namespace_delegations.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.namespace_delegations.list

List namespace delegation transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListNamespaceDelegationResult]
identity.identifier_delegations.authorize

Change identifier delegation

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • identifier: com.digitalasset.canton.identity.UniqueIdentifier
  • authorizedKey: com.digitalasset.canton.crypto.Fingerprint

Return type

com.google.protobuf.ByteString

Delegates the authority of a certain identifier to a certain key. This corresponds to a normal certificate which binds identifier to a key. The keys are referred to using their fingerprints. They need to be either locally generated or have been previously imported. ops: Either Add or Remove the delegation. signedBy: Refers to the optional fingerprint of the authorizing key which in turn refers to a specific, locally existing certificate. authorizedKey: Fingerprint of the key to be authorized.

identity.identifier_delegations.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.identifier_delegations.list

List identifier delegation transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListIdentifierDelegationResult]
identity.owner_to_key_mappings.authorize

Change an owner to key mapping

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • keyOwner: com.digitalasset.canton.identity.KeyOwner
  • key: com.digitalasset.canton.crypto.Fingerprint
  • purposes: Set[com.digitalasset.canton.crypto.KeyPurpose]

Return type

com.google.protobuf.ByteString

Change a owner to key mapping. A key owner is anyone in the system that needs a key-pair known to all members (participants, mediator, sequencer, identity manager) of a domain. ops: Either Add or Remove the key mapping update. signedBy: Optional fingerprint of the authorizing key which in turn refers to a specific, locally existing certificate. ownerType: Role of the following owner (Participant, Sequencer, Mediator, DomainIdentityManager) owner: Unique identifier of the owner. key: Fingerprint of key purposes: The purposes of the owner to key mapping.

identity.owner_to_key_mappings.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.owner_to_key_mappings.list

List owner to key mapping transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterKeyOwnerType: Option[com.digitalasset.canton.identity.KeyOwnerCode]
  • filterKeyOwnerUid: String
  • filterKeyPurpose: Option[com.digitalasset.canton.crypto.KeyPurpose]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListOwnerToKeyMappingResult]
identity.party_to_participant_mappings.authorize

Change party to participant mapping

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • party: com.digitalasset.canton.identity.PartyId
  • participant: com.digitalasset.canton.identity.ParticipantId
  • side: com.digitalasset.canton.identity.RequestSide
  • permission: com.digitalasset.canton.identity.ParticipantPermission

Return type

com.google.protobuf.ByteString

Change the association of a party to a participant. If both identifiers are in the same namespace, then the request-side is Both. If they differ, then we need to say whether the request comes from the party (RequestSide.From) or from the participant (RequestSide.To). And, we need the matching request of the other side. ops: Either Add or Remove the mapping signedBy: Refers to the optional fingerprint of the authorizing key which in turn refers to a specific, locally existing certificate. party: The unique identifier of the party we want to map to a participant. participant: The unique identifier of the participant to which the party is supposed to be mapped. side: The request side (RequestSide.From if we the transaction is from the perspective of the party, RequestSide.To from the participant.) privilege: The privilege of the given participant which allows us to restrict an association (e.g. Confirmation or Observation).

identity.party_to_participant_mappings.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.party_to_participant_mappings.list

List party to participant mapping transactions

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterParty: String
  • filterParticipant: String
  • filterRequestSide: Option[com.digitalasset.canton.identity.RequestSide]
  • filterPermission: Option[com.digitalasset.canton.identity.ParticipantPermission]

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListPartyToParticipantResult]

Return a list of party to participant mappings matching the provided optional filter arguments.

identity.participants.help

Help for specific commands (use help() or help("method") for more information)

Arguments:

  • methodName: String
identity.participants.list

List participant states

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • activeOnly: Boolean
  • filterParticipant: String

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListParticipantStateResult]
identity.legal_identities.authorize

Authorize a legal identity claim transaction

Arguments:

  • ops: com.digitalasset.canton.identity.IdentityChangeOp
  • signedBy: Option[com.digitalasset.canton.crypto.Fingerprint]
  • claim: com.digitalasset.canton.identity.SignedLegalIdentityClaim

Return type

com.google.protobuf.ByteString
identity.legal_identities.generate

Generate a signed legal identity claim

Arguments:

  • claim: com.digitalasset.canton.identity.LegalIdentityClaim

Return type

com.digitalasset.canton.identity.SignedLegalIdentityClaim
identity.legal_identities.generate_x509

Generate a signed legal identity claim for a specific X509 certificate

Arguments:

  • uid: com.digitalasset.canton.identity.UniqueIdentifier
  • certificateId: com.digitalasset.canton.crypto.tink.CertificateId

Return type

com.digitalasset.canton.identity.SignedLegalIdentityClaim
identity.legal_identities.list

List legal identities

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterUid: String

Return type

Seq[com.digitalasset.canton.admin.api.client.data.ListSignedLegalIdentityClaimResult]
identity.legal_identities.list_x509

List legal identities with X509 certificates

Arguments:

  • filterStore: String
  • from: Option[java.time.Instant]
  • until: Option[java.time.Instant]
  • resultType: com.digitalasset.canton.admin.api.client.data.ResultType
  • filterUid: String

Return type

Seq[(com.digitalasset.canton.identity.UniqueIdentifier, com.digitalasset.canton.crypto.tink.X509Certificate)]

Code-Generation in Console

The DAML SDK provides code-generation utilities which create Scala bindings for DAML models. These bindings are a convenient way to interact with the ledger from the console in a typed fashion. The linked documentation explains how to create these bindings as scala code using the daml command. If you are using sbt, you can build and package the resulting scala code based on the following simple build.sbt

ThisBuild / scalaVersion := "2.12.7"
ThisBuild / organization := "com.digitalasset"

lazy val codegen = (project in file("codegen"))
  .settings(
    name := "codegen",
    libraryDependencies ++= Seq(
     "com.daml" %% "bindings-scala" % "1.0.1"
    )
)

You can then load the resulting jar into the Canton console using the magic Ammonite import trick within console scripts:

interp.load.cp(os.Path("codegen.jar", base = os.pwd))

@ // the at triggers the compilation such that we can use the imports subsequently

import ...

FAQ

  • Why do you have an additional new line between each line in your example scripts?
    • When we write participant1 start the scala compiler translates this into participant1.start(). This works great in the console when each line is parsed independently. However with a script all of it’s content is parsed at once, and in which case if there is anything on the line following participant1 start it will assume it is an argument for start and fail. An additional newline prevents this. Adding parenthesis would also work.
  • How can I use nested import statements to split my script into multiple files?
    • Ammonite supports splitting scripts into several files using two mechanisms. The old one is interp.load.module(..). The new one is import $file.<fname>. The former will compile the module as a whole, which means that variables defined in one module can not be used in another one as they are not available during compilation. The import $file. syntax however will make all variables accessible in the importing script. However, it only works with relative paths as e.g. ../path/to/foo/bar.sc needs to be converted into import $file.^.path.to.foo.bar and it only works if the script file is named with suffix .sc.
  • How do I read or write ByteString’s from or to a file?
    • Canton uses Protobuf for serialization and de-serialization and we dump serialized binary data into ByteString. In some cases you need to read or write byte strings from or to a file. For convenience, you can use com.digitalasset.canton.util.BinaryFileUtil.writeByteStringToFile(outputFile: String, bytes: ByteString) and the corresponding readByteStringFromFile(inputFile: String) in your console script.