Packages

object utils extends Helpful

Annotations
@Summary(s = "Console utilities", flag = console.this.Help.Summary.<init>$default$2) @Group(name = "Utilities")
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. utils
  2. Helpful
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def auto_close(closeable: AutoCloseable)(implicit environment: ConsoleEnvironment): Unit
    Annotations
    @Summary(s = "Register `AutoCloseable` object to be shutdown if Canton is shut down", flag = FeatureFlag.Testing)
  6. def change_contracts_party_ids(partiesOldToPartiesNew: Map[PartyId, PartyId], acs: Seq[WrappedCreatedEvent], domainId: DomainId, ledgerCreateTime: Instant, targetProtocolVersion: ProtocolVersion)(implicit env: ConsoleEnvironment): Seq[VersionedMessage[Nothing]]
    Annotations
    @Summary(s = "Change the party ids referenced by a sequence of contracts.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """The `utils.change_contracts_party_ids` changes the party ids of multiple contracts based on a map
    |of old party ids to new party ids. This is typically used during an ACS migration when the
    |reference party ids have changed (e.g. due to them being recreated in another participant in a different
    |namespace). This function also requires the selection of a specific ledger create time
    |according to the domain's clock. It is also possible to modify the domain and protocol version for
    |those contracts, which can be useful when contracts are being migrated to a participant
    |connected to a domain and/or protocol version."""
    )
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  8. def contract_data_to_instance(contractData: ContractData, ledgerTime: Instant)(implicit env: ConsoleEnvironment): SerializableContract
    Annotations
    @Summary(s = "Convert contract data to a contract instance.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """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."""
    )
  9. def contract_instance_to_data(contract: SerializableContract)(implicit env: ConsoleEnvironment): ContractData
    Annotations
    @Summary(s = "Convert a contract instance to contract data.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """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 "features.enable-testing-commands"
    |configuration can be (at least temporarily) enabled."""
    )
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def generate_contract_id(cryptoPureApi: CryptoPureApi, rawContract: SerializableRawContractInstance, createdAt: CantonTimestamp, discriminator: LfHash, contractSalt: Salt, metadata: ContractMetadata, protocolVersion: ProtocolVersion): V1
    Annotations
    @Summary(s = "Generate authenticated contract id.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """The `utils.generate_contract_id` generates "contract id" of a contract. Starting from protocol version 4,
    |Canton uses the so called authenticated contract ids which depend on the details of the associated contracts.
    |When aspects of a contract such as the parties involved change as part of repair or export/import procedure,
    |the corresponding contract id must be recomputed. This function can be used as a tool to generate an id for
    |an arbitrary contract content"""
    )
  13. def generate_daml_script_participants_conf(file: Option[String] = None, useParticipantAlias: Boolean = true, defaultParticipant: Option[ParticipantReference] = None)(implicit env: ConsoleEnvironment): File
    Annotations
    @Summary(s = "Create a participants config for Daml script", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """The generated config can be passed to `daml script` via the `participant-config` parameter.
    |More information about the file format can be found in the `documentation <https://docs.daml.com/daml-script/index.html#using-daml-script-in-distributed-topologies>`_:
    |It takes three arguments:
    |- file (default to "participant-config.json")
    |- useParticipantAlias (default to true): participant aliases are used instead of UIDs
    |- defaultParticipant (default to None): adds a default participant if provided
    |"""
    )
  14. def generate_navigator_conf(participant: LocalParticipantReference, file: Option[String] = None): File
    Annotations
    @Summary(s = "Create a navigator ui-backend.conf for a participant", flag = console.this.Help.Summary.<init>$default$2)
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  17. def help(methodName: String)(implicit consoleEnvironment: ConsoleEnvironment): Unit
    Definition Classes
    Helpful
    Annotations
    @Summary(s = "Help for specific commands (use help() or help(\"method\") for more information)", flag = console.this.Help.Summary.<init>$default$2) @Topic(t = Seq("Top-level Commands"))
  18. def help()(implicit consoleEnvironment: ConsoleEnvironment): Unit
    Definition Classes
    Helpful
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def migrate_dars(participantOld: ParticipantReference, participantNew: ParticipantReference): Unit
    Annotations
    @Summary(s = "Migrates dars from one participant to another.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """The `utils.migrate_dars` copies all dars (not part of the AdminWorkflows) from a participant,
    |saves them in a temporary file and then uploads them to another participant."""
    )
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  24. def object_args[T](obj: T)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): List[String]
    Annotations
    @Summary(s = "Reflective inspection of object arguments, handy to inspect case class objects", flag = console.this.Help.Summary.<init>$default$2) @Description(s = "Return the list field names of the given object. Helpful function when inspecting the return result.")
  25. def read_all_messages_from_file[A <: GeneratedMessage](fileName: String)(implicit companion: GeneratedMessageCompanion[A]): Seq[A]
    Annotations
    @Summary(s = "Reads several Protobuf messages from a file.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = "Fails with an exception, if the file can't be read or parsed.")
  26. def read_byte_string_from_file(fileName: String)(implicit env: ConsoleEnvironment): ByteString
    Annotations
    @Summary(s = "Reads a ByteString from a file.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = "Fails with an exception, if the file can't be read.")
  27. def read_first_message_from_file[A <: GeneratedMessage](fileName: String)(implicit companion: GeneratedMessageCompanion[A]): A
    Annotations
    @Summary(s = "Reads a single Protobuf message from a file.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = "Fails with an exception, if the file can't be read or parsed.")
  28. def recompute_contract_ids(participant: LocalParticipantReference, acs: Seq[SerializableContract], protocolVersion: ProtocolVersion): (Seq[SerializableContract], Map[LfContractId, LfContractId])
    Annotations
    @Summary(s = "Recompute authenticated contract ids.", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """The `utils.recompute_contract_ids` regenerates "contract ids" of multiple contracts after their contents have
    |changed. Starting from protocol version 4, Canton uses the so called authenticated contract ids which depend
    |on the details of the associated contracts. When aspects of a contract such as the parties involved change as
    |part of repair or export/import procedure, the corresponding contract id must be recomputed."""
    )
  29. final def retry_until_true(timeout: NonNegativeDuration, maxWaitPeriod: NonNegativeDuration = 10.seconds)(condition: => Boolean, failure: => String = "Condition never became true within ".+(timeout)): Unit
    Annotations
    @Summary(s = "Wait for a condition to become true", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """Wait `timeout` duration until `condition` becomes true.
    | Retry evaluating `condition` with an exponentially increasing back-off up to `maxWaitPeriod` duration between retries.
    |"""
    )
    @SuppressWarnings()
  30. final def retry_until_true(condition: => Boolean)(implicit env: ConsoleEnvironment): Unit
    Annotations
    @Summary(s = "Wait for a condition to become true, using default timeouts", flag = console.this.Help.Summary.<init>$default$2) @Description(s = """
    |Wait until condition becomes true, with a timeout taken from the parameters.timeouts.console.bounded
    |configuration parameter."""
    )
  31. def synchronize_topology(timeoutO: Option[NonNegativeDuration] = None)(implicit env: ConsoleEnvironment): Unit
    Annotations
    @Summary(s = "Wait until all topology changes have been effected on all accessible nodes", flag = console.this.Help.Summary.<init>$default$2)
  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    AnyRef → Any
  34. def type_args[T](implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): List[String]
    Annotations
    @Summary(s = "Reflective inspection of type arguments, handy to inspect case class types", flag = console.this.Help.Summary.<init>$default$2) @Description(s = "Return the list of field names of the given type. Helpful function when creating new objects for requests.")
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. def write_to_file(data: ByteString, fileName: String): Unit
    Annotations
    @Summary(s = "Writes a ByteString to a file.", flag = console.this.Help.Summary.<init>$default$2)
  39. def write_to_file(data: GeneratedMessage, fileName: String): Unit
    Annotations
    @Summary(s = "Writes a Protobuf message to a file.", flag = console.this.Help.Summary.<init>$default$2)
  40. def write_to_file(data: Seq[GeneratedMessage], fileName: String): Unit
    Annotations
    @Summary(s = "Writes several Protobuf messages to a file.", flag = console.this.Help.Summary.<init>$default$2)

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated

Inherited from Helpful

Inherited from AnyRef

Inherited from Any

Ungrouped