Interface Transaction

All Superinterfaces:
Signable

public interface Transaction extends Signable
An endorsed transaction that can be submitted to the orderer for commit to the ledger.
  • Method Details

    • getResult

      byte[] getResult()
      Get the transaction result. The result is obtained as part of the proposal endorsement so may be read immediately. It is not necessary to submit the transaction before getting the transaction result, but the transaction will not be committed to the ledger and its effects visible to other clients and transactions until after it has been submitted to the orderer.
      Returns:
      A transaction result.
    • getTransactionId

      String getTransactionId()
      Get the transaction ID.
      Returns:
      A transaction ID.
    • submit

      default byte[] submit() throws SubmitException, CommitStatusException, CommitException
      Submit the transaction to the orderer to be committed to the ledger. This method blocks until the transaction has been successfully committed to the ledger.
      Returns:
      A transaction result.
      Throws:
      SubmitException - if the submit invocation fails.
      CommitStatusException - if the commit status invocation fails.
      CommitException - if the transaction commits unsuccessfully.
    • submit

      Submit the transaction to the orderer to be committed to the ledger. This method blocks until the transaction has been successfully committed to the ledger.
      Parameters:
      options - Function that transforms call options.
      Returns:
      A transaction result.
      Throws:
      SubmitException - if the submit invocation fails.
      CommitStatusException - if the commit status invocation fails.
      CommitException - if the transaction commits unsuccessfully.
    • submit

      @Deprecated default byte[] submit(CallOption... options) throws SubmitException, CommitStatusException, CommitException
      Deprecated.
      Submit the transaction to the orderer to be committed to the ledger. This method blocks until the transaction has been successfully committed to the ledger.
      Parameters:
      options - Call options.
      Returns:
      A transaction result.
      Throws:
      SubmitException - if the submit invocation fails.
      CommitStatusException - if the commit status invocation fails.
      CommitException - if the transaction commits unsuccessfully.
    • submitAsync

      default SubmittedTransaction submitAsync() throws SubmitException
      Submit the transaction to the orderer to be committed to the ledger. This method returns immediately after the transaction is successfully delivered to the orderer. The returned Commit may be used to subsequently wait for the transaction to be committed to the ledger.
      Returns:
      A transaction commit.
      Throws:
      SubmitException - if the gRPC service invocation fails.
    • submitAsync

      Submit the transaction to the orderer to be committed to the ledger. This method returns immediately after the transaction is successfully delivered to the orderer. The returned Commit may be used to subsequently wait for the transaction to be committed to the ledger.
      Parameters:
      options - Function that transforms call options.
      Returns:
      A transaction commit.
      Throws:
      SubmitException - if the gRPC service invocation fails.
    • submitAsync

      @Deprecated default SubmittedTransaction submitAsync(CallOption... options) throws SubmitException
      Deprecated.
      Submit the transaction to the orderer to be committed to the ledger. This method returns immediately after the transaction is successfully delivered to the orderer. The returned Commit may be used to subsequently wait for the transaction to be committed to the ledger.
      Parameters:
      options - Call options.
      Returns:
      A transaction commit.
      Throws:
      SubmitException - if the gRPC service invocation fails.