Package org.hyperledger.fabric.sdk
Class TransactionRequest
java.lang.Object
org.hyperledger.fabric.sdk.TransactionRequest
- Direct Known Subclasses:
InstallProposalRequest,InstantiateProposalRequest,QueryByChaincodeRequest,QuerySCCRequest,TransactionProposalRequest,UpgradeProposalRequest
A base transaction request common for InstallProposalRequest,trRequest, and QueryRequest.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleandoVerify()Some proposal responses from Fabric are not signed.ArrayList<byte[]>getArgs()get collection configuration for this chaincode.returns the Policy object associated with the chaincode of this transactionorg.hyperledger.fabric.protos.peer.Chaincode.ChaincodeIDgetFcn()longGets the timeout for a single proposal request to endorser in milliseconds.Optional<org.hyperledger.fabric.sdk.transaction.TransactionContext>Get the transaction context to be used when submitting this transaction request, if one has been set.Transient data added to the proposal that is not added to the ledger.booleanisInit()booleanDetermines whether an empty channel ID should be set on proposals built from this request.setArgBytes(byte[][] args) setArgs(byte[]... args) voidsetChaincodeCollectionConfiguration(ChaincodeCollectionConfiguration chaincodeCollectionConfiguration) Set collection configuration for this chaincode.voidsets the endorsementPolicy associated with the chaincode of this transactionvoidsetChaincodeID(ChaincodeID chaincodeID) voidsetChaincodeLanguage(TransactionRequest.Type chaincodeLanguage) The chaincode language type: default type Type.GO_LANGvoidsetChaincodeName(String chaincodeName) setChaincodeVersion(String chaincodeVersion) voidsetInit(boolean init) voidsetProposalWaitTime(long proposalWaitTime) Sets the timeout for a single proposal request to endorser in milliseconds.voidsetTransactionContext(org.hyperledger.fabric.sdk.transaction.TransactionContext transactionContext) Get the transaction context to be used when submitting this transaction request.voidsetUserContext(User userContext) Set the user context for this request.
-
Method Details
-
setChaincodeName
-
setUserContext
Set the user context for this request. This context will override the user context set onHFClient.setUserContext(User)- Parameters:
userContext- The user context for this request used for signing.
-
getTransactionContext
Get the transaction context to be used when submitting this transaction request, if one has been set.- Returns:
- A transaction context.
-
setTransactionContext
public void setTransactionContext(org.hyperledger.fabric.sdk.transaction.TransactionContext transactionContext) Get the transaction context to be used when submitting this transaction request.- Parameters:
transactionContext- A transaction ID.
-
getTransientMap
Transient data added to the proposal that is not added to the ledger.- Returns:
- Map of strings to bytes that's added to the proposal
-
noChannelID
public boolean noChannelID()Determines whether an empty channel ID should be set on proposals built from this request. Some peer requests (e.g. queries to QSCC) require the field to be blank. Subclasses should override this method as needed.This implementation returns
false.- Returns:
trueif an empty channel ID should be used; otherwisefalse.
-
doVerify
public boolean doVerify()Some proposal responses from Fabric are not signed. We default to always verify a ProposalResponse. Subclasses should override this method if you do not want the response signature to be verified- Returns:
- true if proposal response is to be checked for a valid signature
-
getChaincodePath
-
getChaincodeName
-
setChaincodeVersion
-
getChaincodeVersion
-
getChaincodeID
-
setChaincodeID
-
getFcn
-
setFcn
-
getArgs
-
setArgs
-
getArgBytes
-
setArgBytes
-
setArgs
-
setArgs
-
getFabricChaincodeID
public org.hyperledger.fabric.protos.peer.Chaincode.ChaincodeID getFabricChaincodeID() -
setInit
public void setInit(boolean init) -
isInit
public boolean isInit() -
getChaincodeLanguage
-
setChaincodeLanguage
The chaincode language type: default type Type.GO_LANG- Parameters:
chaincodeLanguage- . Type.Java Type.GO_LANG Type.NODE
-
setChaincodeEndorsementPolicy
sets the endorsementPolicy associated with the chaincode of this transaction- Parameters:
policy- a Policy object- See Also:
-
getChaincodeEndorsementPolicy
returns the Policy object associated with the chaincode of this transaction- Returns:
- a Policy object
- See Also:
-
getChaincodeCollectionConfiguration
get collection configuration for this chaincode.- Returns:
- collection configuration if set.
-
setChaincodeCollectionConfiguration
public void setChaincodeCollectionConfiguration(ChaincodeCollectionConfiguration chaincodeCollectionConfiguration) Set collection configuration for this chaincode.- Parameters:
chaincodeCollectionConfiguration-
-
getProposalWaitTime
public long getProposalWaitTime()Gets the timeout for a single proposal request to endorser in milliseconds.- Returns:
- the timeout for a single proposal request to endorser in milliseconds
-
setProposalWaitTime
public void setProposalWaitTime(long proposalWaitTime) Sets the timeout for a single proposal request to endorser in milliseconds.- Parameters:
proposalWaitTime- the timeout for a single proposal request to endorser in milliseconds
-