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 clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. 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."""
    )
  8. 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."""
    )
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. 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"""
    )
  12. 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
    |"""
    )
  13. 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)
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. 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"))
  17. def help()(implicit consoleEnvironment: ConsoleEnvironment): Unit
    Definition Classes
    Helpful
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. 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.")
  23. 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.")
  24. 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.")
  25. 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.")
  26. 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."""
    )
  27. 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()
  28. 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."""
    )
  29. 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)
  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. 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.")
  33. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. 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)
  37. 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)
  38. 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