Class FreezeTransaction


public final class FreezeTransaction extends Transaction<FreezeTransaction>
A transaction body for all five freeze transactions. Combining five different transactions into a single message, this transaction body MUST support options to schedule a freeze, abort a scheduled freeze, prepare a software upgrade, prepare a telemetry upgrade, or initiate a software upgrade. For a scheduled freeze, at the scheduled time, according to network consensus time - A freeze (`FREEZE_ONLY`) causes the network nodes to stop creating events or accepting transactions, and enter a persistent maintenance state. - A freeze upgrade (`FREEZE_UPGRADE`) causes the network nodes to stop creating events or accepting transactions, and upgrade the node software from a previously prepared upgrade package. The network nodes then restart and rejoin the network after upgrading. For other freeze types, immediately upon processing the freeze transaction - A Freeze Abort (`FREEZE_ABORT`) cancels any pending scheduled freeze. - A prepare upgrade (`PREPARE_UPGRADE`) begins to extract the contents of the specified upgrade file to the local filesystem. - A telemetry upgrade (`TELEMETRY_UPGRADE`) causes the network nodes to extract a telemetry upgrade package to the local filesystem and signal other software on the machine to upgrade, without impacting the node or network processing. ### Block Stream Effects Unknown
  • Constructor Details

    • FreezeTransaction

      public FreezeTransaction()
      Constructor.
    • FreezeTransaction

      FreezeTransaction(LinkedHashMap<TransactionId,LinkedHashMap<AccountId,Transaction>> txs) throws com.google.protobuf.InvalidProtocolBufferException
      Constructor.
      Parameters:
      txs - Compound list of transaction id's list of (AccountId, Transaction) records
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • FreezeTransaction

      FreezeTransaction(TransactionBody txBody)
      Constructor.
      Parameters:
      txBody - protobuf TransactionBody
  • Method Details

    • getStartTime

      public Instant getStartTime()
      Extract the start time.
      Returns:
      the start time
    • setStartTime

      public FreezeTransaction setStartTime(Instant startTime)
      A start time for the freeze.

      If this field is REQUIRED for the specified `freeze_type`, then when the network consensus time reaches this instant

      1. The network SHALL stop accepting transactions.
      2. The network SHALL gossip a freeze state.
      3. The nodes SHALL, in coordinated order, disconnect and shut down.
      4. The nodes SHALL halt or perform a software upgrade, depending on `freeze_type`.
      5. If the `freeze_type` is `FREEZE_UPGRADE`, the nodes SHALL restart and rejoin the network upon completion of the software upgrade.
      If the `freeze_type` is `TELEMETRY_UPGRADE`, the start time is required, but the network SHALL NOT stop, halt, or interrupt transaction processing. The required field is an historical anomaly and SHOULD change in a future release.
      Parameters:
      startTime - the start time
      Returns:
      this
    • setStartTime

      @Deprecated public FreezeTransaction setStartTime(int hour, int minute)
      Deprecated.
      Parameters:
      hour - The hour to be set
      minute - The minute to be set
      Returns:
      this
    • getEndTime

      @Deprecated public Instant getEndTime()
      Deprecated.
      with no replacement
      Returns:
      the end time
    • setEndTime

      @Deprecated public FreezeTransaction setEndTime(int hour, int minute)
      Deprecated.
      with no replacement
      Sets the end time (in UTC).
      Parameters:
      hour - The hour to be set
      minute - The minute to be set
      Returns:
      this
    • getUpdateFileId

      @Deprecated @Nullable public FileId getUpdateFileId()
      Deprecated.
      Use getFileId() instead.
      Returns:
      the fileId
    • setUpdateFileId

      @Deprecated public FreezeTransaction setUpdateFileId(FileId updateFileId)
      Deprecated.
      Use setFileId(FileId) instead.
      Parameters:
      updateFileId - the new fileId
      Returns:
      this
    • getUpdateFileHash

      @Deprecated public byte[] getUpdateFileHash()
      Deprecated.
      Use getFileHash() instead.
      Returns:
      the fileHash
    • setUpdateFileHash

      @Deprecated public FreezeTransaction setUpdateFileHash(byte[] updateFileHash)
      Deprecated.
      Use setFileHash(byte[]) instead.
      Parameters:
      updateFileHash - fileHash to set
      Returns:
      this
    • getFileId

      @Nullable public FileId getFileId()
      Extract the file id.
      Returns:
      the file id
    • setFileId

      public FreezeTransaction setFileId(FileId fileId)
      Assign the file id.
      Parameters:
      fileId - the file id
      Returns:
      this
    • getFileHash

      public byte[] getFileHash()
      The expected hash of the contents of the update file (used to verify the update)
      Returns:
      the file's hash
    • setFileHash

      public FreezeTransaction setFileHash(byte[] fileHash)
      A SHA384 hash of file content.
      This is a hash of the file identified by `update_file`.

      This MUST be set if `update_file` is set, and MUST match the SHA384 hash of the contents of that file.

      Parameters:
      fileHash - the fileHash to set
      Returns:
      this
    • getFreezeType

      public FreezeType getFreezeType()
      Extract the freeze type.
      Returns:
      the freeze type
    • setFreezeType

      public FreezeTransaction setFreezeType(FreezeType freezeType)
      The type of freeze.

      This REQUIRED field effectively selects between five quite different transactions in the same transaction body. Depending on this value the service may schedule a freeze, prepare upgrades, perform upgrades, or even abort a previously scheduled freeze. FreezeTransaction

      Parameters:
      freezeType - the freeze type
      Returns:
      this
    • validateChecksums

      void validateChecksums(Client client)
      Specified by:
      validateChecksums in class Transaction<FreezeTransaction>
    • getMethodDescriptor

      io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()
      Description copied from class: Executable
      Called to direct the invocation of the query to the appropriate gRPC service.
      Specified by:
      getMethodDescriptor in class Executable<FreezeTransaction,Transaction,TransactionResponse,TransactionResponse>
    • initFromTransactionBody

      void initFromTransactionBody()
      Initialize from the transaction body.
    • build

      Build the correct transaction body.
      Returns:
      builder
    • onFreeze

      void onFreeze(TransactionBody.Builder bodyBuilder)
      Description copied from class: Transaction
      Called in Transaction.freezeWith(Client) just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.
      Specified by:
      onFreeze in class Transaction<FreezeTransaction>
    • onScheduled

      void onScheduled(SchedulableTransactionBody.Builder scheduled)
      Description copied from class: Transaction
      Called in Transaction.schedule() when converting transaction into a scheduled version.
      Specified by:
      onScheduled in class Transaction<FreezeTransaction>