Constructor and Description |
---|
APIServerImpl(AbstractNode node) |
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.
|
AbstractNode |
getNode() |
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.
|
buildTransaction, commitTransaction, fetchFlowsRequiringAttention, fetchStates, fetchTransactions, generateTransactionSignature, info, invokeFlowSync, provideFlowResponse, queryStates, serverTime, status
public APIServerImpl(AbstractNode node)
public java.time.LocalDateTime serverTime()
Report current UTC time as understood by the platform.
public javax.ws.rs.core.Response status()
Report whether this node is started up or not.
public 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
public 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.public java.util.Map<net.corda.core.contracts.StateRef,net.corda.core.contracts.TransactionState> fetchStates(java.util.List<net.corda.core.contracts.StateRef> states)
public 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 APIServerImpl.queryStates
) you would like full transactions for.public 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).
public DigitalSignature.WithKey generateTransactionSignature(SerializedBytes<net.corda.core.transactions.WireTransaction> tx)
Generate a signature for this transaction signed by us.
public 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.
public 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.
public 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).
public 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.public AbstractNode getNode()