corda / net.corda.node.internal / APIServerImpl

APIServerImpl

class APIServerImpl : APIServer

Constructors

<init> APIServerImpl(node: AbstractNode)

Properties

node val node: AbstractNode

Functions

buildTransaction fun buildTransaction(type: ContractDefRef, steps: List<TransactionBuildStep>): SerializedBytes<WireTransaction>

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).

commitTransaction fun commitTransaction(tx: SerializedBytes<WireTransaction>, signatures: List<WithKey>): SecureHash

Attempt to commit transaction (returned from build transaction) with the necessary signatures for that to be successful, otherwise exception is thrown.

fetchFlowsRequiringAttention fun fetchFlowsRequiringAttention(query: StatesQuery): Map<StateRef, FlowRequiringAttention>

Fetch flows that require a response to some prompt/question by a human (on the "bank" side).

fetchStates fun fetchStates(states: List<StateRef>): Map<StateRef, TransactionState<ContractState>?>
fetchTransactions fun fetchTransactions(txs: List<SecureHash>): Map<SecureHash, SignedTransaction?>

Query for immutable transactions (results can be cached indefinitely by their id/hash).

generateTransactionSignature fun generateTransactionSignature(tx: SerializedBytes<WireTransaction>): WithKey

Generate a signature for this transaction signed by us.

info fun info(): NodeInfo

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

invokeFlowSync fun invokeFlowSync(type: FlowRef, args: Map<String, Any?>): Any?

This method would not return until the flow is finished (hence the "Sync").

provideFlowResponse fun provideFlowResponse(flow: FlowInstanceRef, choice: SecureHash, args: Map<String, Any?>): Unit

Provide the response that a flow is waiting for.

queryStates fun queryStates(query: StatesQuery): List<StateRef>

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.

serverTime fun serverTime(): LocalDateTime

Report current UTC time as understood by the platform.

status fun status(): Response

Report whether this node is started up or not.