Package org.hyperledger.fabric.client
Interface Transaction
- All Superinterfaces:
Signable
An endorsed transaction that can be submitted to the orderer for commit to the ledger.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get the transaction result.Get the transaction ID.default byte[]
submit()
Submit the transaction to the orderer to be committed to the ledger.byte[]
submit
(UnaryOperator<CallOptions> options) Submit the transaction to the orderer to be committed to the ledger.default byte[]
submit
(CallOption... options) Deprecated.default SubmittedTransaction
Submit the transaction to the orderer to be committed to the ledger.submitAsync
(UnaryOperator<CallOptions> options) Submit the transaction to the orderer to be committed to the ledger.default SubmittedTransaction
submitAsync
(CallOption... options) Deprecated.Replaced bysubmit(UnaryOperator)
.
-
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
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
byte[] submit(UnaryOperator<CallOptions> options) 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.- 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.Replaced bysubmit(UnaryOperator)
.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
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.Replaced bysubmit(UnaryOperator)
.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.
-
submit(UnaryOperator)
.