public APIServer
Top level interface to external interaction with the distributed ledger.
Wherever a list is returned by a fetchXXX method that corresponds with an input list, that output list will have optional elements where a null indicates "missing" and the elements returned will be in the order corresponding with the input list.
Modifier and Type | Method and Description |
---|---|
SerializedBytes<net.corda.core.transactions.WireTransaction> |
buildTransaction(ContractDefRef type,
java.util.List<net.corda.node.api.TransactionBuildStep> steps)
TransactionBuildSteps would be invocations of contract.generateXXX() methods that all share a common TransactionBuilder
and a common contract type (e.g. Cash or CommercialPaper)
which would automatically be passed as the first argument (we'd need that to be a criteria/pattern of the generateXXX methods).
|
SecureHash |
commitTransaction(SerializedBytes<net.corda.core.transactions.WireTransaction> tx,
java.util.List<? extends net.corda.core.crypto.DigitalSignature.WithKey> signatures)
Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be
successful, otherwise exception is thrown.
|
java.util.Map<net.corda.core.contracts.StateRef,net.corda.node.api.FlowRequiringAttention> |
fetchFlowsRequiringAttention(StatesQuery query)
Fetch flows that require a response to some prompt/question by a human (on the "bank" side).
|
java.util.Map<net.corda.core.contracts.StateRef,net.corda.core.contracts.TransactionState> |
fetchStates(java.util.List<net.corda.core.contracts.StateRef> states) |
java.util.Map<net.corda.core.crypto.SecureHash,net.corda.core.transactions.SignedTransaction> |
fetchTransactions(java.util.List<? extends net.corda.core.crypto.SecureHash> txs)
Query for immutable transactions (results can be cached indefinitely by their id/hash).
|
DigitalSignature.WithKey |
generateTransactionSignature(SerializedBytes<net.corda.core.transactions.WireTransaction> tx)
Generate a signature for this transaction signed by us.
|
NodeInfo |
info()
Report this node's configuration and identities.
Currently tunnels the NodeInfo as an encoding of the Kryo serialised form.
TODO this functionality should be available via the RPC
|
java.lang.Object |
invokeFlowSync(FlowRef type,
java.util.Map<java.lang.String,? extends java.lang.Object> args)
This method would not return until the flow is finished (hence the "Sync").
|
void |
provideFlowResponse(FlowInstanceRef flow,
SecureHash choice,
java.util.Map<java.lang.String,? extends java.lang.Object> args)
Provide the response that a flow is waiting for.
|
java.util.List<net.corda.core.contracts.StateRef> |
queryStates(StatesQuery query)
Query your "local" states (containing only outputs involving you) and return the hashes & indexes associated with them
to probably be later inflated by fetchLedgerTransactions() or fetchStates() although because immutable you can cache them
to avoid calling fetchLedgerTransactions() many times.
|
java.time.LocalDateTime |
serverTime()
Report current UTC time as understood by the platform.
|
javax.ws.rs.core.Response |
status()
Report whether this node is started up or not.
|
java.time.LocalDateTime serverTime()
Report current UTC time as understood by the platform.
javax.ws.rs.core.Response status()
Report whether this node is started up or not.
NodeInfo info()
Report this node's configuration and identities. Currently tunnels the NodeInfo as an encoding of the Kryo serialised form. TODO this functionality should be available via the RPC
java.util.List<net.corda.core.contracts.StateRef> queryStates(StatesQuery query)
Query your "local" states (containing only outputs involving you) and return the hashes & indexes associated with them to probably be later inflated by fetchLedgerTransactions() or fetchStates() although because immutable you can cache them to avoid calling fetchLedgerTransactions() many times.
query
- Some "where clause" like expression.java.util.Map<net.corda.core.contracts.StateRef,net.corda.core.contracts.TransactionState> fetchStates(java.util.List<net.corda.core.contracts.StateRef> states)
java.util.Map<net.corda.core.crypto.SecureHash,net.corda.core.transactions.SignedTransaction> fetchTransactions(java.util.List<? extends net.corda.core.crypto.SecureHash> txs)
Query for immutable transactions (results can be cached indefinitely by their id/hash).
txs
- The hashes (from StateRef.txhash returned from APIServer.queryStates
) you would like full transactions for.SerializedBytes<net.corda.core.transactions.WireTransaction> buildTransaction(ContractDefRef type, java.util.List<net.corda.node.api.TransactionBuildStep> steps)
TransactionBuildSteps would be invocations of contract.generateXXX() methods that all share a common TransactionBuilder and a common contract type (e.g. Cash or CommercialPaper) which would automatically be passed as the first argument (we'd need that to be a criteria/pattern of the generateXXX methods).
DigitalSignature.WithKey generateTransactionSignature(SerializedBytes<net.corda.core.transactions.WireTransaction> tx)
Generate a signature for this transaction signed by us.
SecureHash commitTransaction(SerializedBytes<net.corda.core.transactions.WireTransaction> tx, java.util.List<? extends net.corda.core.crypto.DigitalSignature.WithKey> signatures)
Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be successful, otherwise exception is thrown.
java.lang.Object invokeFlowSync(FlowRef type, java.util.Map<java.lang.String,? extends java.lang.Object> args)
This method would not return until the flow is finished (hence the "Sync").
Longer term we'd add an Async version that returns some kind of FlowInvocationRef that could be queried and would appear on some kind of event message that is broadcast informing of progress.
Will throw exception if flow fails.
java.util.Map<net.corda.core.contracts.StateRef,net.corda.node.api.FlowRequiringAttention> fetchFlowsRequiringAttention(StatesQuery query)
Fetch flows that require a response to some prompt/question by a human (on the "bank" side).
void provideFlowResponse(FlowInstanceRef flow, SecureHash choice, java.util.Map<java.lang.String,? extends java.lang.Object> args)
Provide the response that a flow is waiting for.
flow
- Should refer to a previously supplied FlowRequiringAttention.choice
- Should be one of the choices presented in the FlowRequiringAttention.args
- Any arguments required.