interface AppServiceHub : ServiceHub
A net.corda.core.node.services.CordaService annotated class requires a constructor taking a single parameter of type AppServiceHub. With the AppServiceHub parameter a net.corda.core.node.services.CordaService is able to access to privileged operations. In particular such a net.corda.core.node.services.CordaService can initiate and track flows marked with net.corda.core.flows.StartableByService.
abstract val database: CordaTransactionSupport
Accessor to CordaTransactionSupport in order to perform sensitive actions within new, independent top level transaction. |
abstract val clock: Clock
A Clock representing the node's current time. This should be used in preference to directly accessing the clock so the current time can be controlled during unit testing. |
|
abstract val contractUpgradeService: ContractUpgradeService
The ContractUpgradeService is responsible for securely upgrading contract state objects according to a specified and mutually agreed (amongst participants) contract version. |
|
abstract val diagnosticsService: DiagnosticsService
The DiagnosticsService provides diagnostic level information about the node, including the current version of the node, and the CorDapps currently installed on the node. Note that this information should be used to provide diagnostics only, and no functional decisions should be made based on this. |
|
abstract val keyManagementService: KeyManagementService
The key management service is responsible for storing and using private keys to sign things. An implementation of this may, for example, call out to a hardware security module that enforces various auditing and frequency-of-use requirements. |
|
abstract val myInfo: NodeInfo
The NodeInfo object corresponding to our own entry in the network map. |
|
abstract val networkMapCache: NetworkMapCache
A network map contains lists of nodes on the network along with information about their identity keys, services they provide and host names or IP addresses where they can be connected to. The cache wraps around a map fetched from an authoritative service, and adds easy lookup of the data stored within it. Generally it would be initialised with a specified network map service, which it fetches data from and then subscribes to updates of. |
|
abstract val validatedTransactions: TransactionStorage
A map of hash->tx where tx has been signature/contract validated and the states are known to be correct. The signatures aren't technically needed after that point, but we keep them around so that we can relay the transaction data to other nodes that need it. |
|
abstract val vaultService: VaultService
The vault service lets you observe, soft lock and add notes to states that involve you or are relevant to your node in some way. Additionally you may query and track states that correspond to various criteria. |
abstract fun register(priority: Int = SERVICE_PRIORITY_NORMAL, observer: ServiceLifecycleObserver): Unit
Allows to register ServiceLifecycleObserver such that it will start receiving net.corda.core.node.services.ServiceLifecycleEvents open fun <T> register(priority: Int = SERVICE_PRIORITY_NORMAL, func: (ServiceLifecycleEvent) -> T): Unit
Convenience method to be able to add an arbitrary function as a register callback. |
|
abstract fun <T> startFlow(flow: FlowLogic<T>): FlowHandle<T>
Start the given flow with the given arguments. flow must be annotated with net.corda.core.flows.StartableByService. TODO it is assumed here that the flow object has an appropriate classloader. |
|
abstract fun <T> startTrackedFlow(flow: FlowLogic<T>): FlowProgressHandle<T>
Start the given flow with the given arguments, returning an Observable with a single observation of the result of running the flow. flow must be annotated with net.corda.core.flows.StartableByService. TODO it is assumed here that the flow object has an appropriate classloader. |
open fun addSignature(signedTransaction: SignedTransaction, publicKey: PublicKey): SignedTransaction
Helper method to append an additional signature to an existing (partially) SignedTransaction. open fun addSignature(signedTransaction: SignedTransaction): SignedTransaction
Helper method to append an additional signature for an existing (partially) SignedTransaction using the default identity signing key of the node. |
|
abstract fun <T : SerializeAsToken> cordaService(type: Class<T>): T
Return the singleton instance of the given Corda service type. This is a class that is annotated with CordaService and will have automatically been registered by the node. |
|
open fun createSignature(signedTransaction: SignedTransaction, publicKey: PublicKey): TransactionSignature
Helper method to create an additional signature for an existing (partially) SignedTransaction. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature. open fun createSignature(signedTransaction: SignedTransaction): TransactionSignature
Helper method to create a signature for an existing (partially) SignedTransaction using the default identity signing key of the node. The legal identity key is used to sign. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature. open fun createSignature(filteredTransaction: FilteredTransaction, publicKey: PublicKey): TransactionSignature
Helper method to create a signature for a FilteredTransaction. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature. open fun createSignature(filteredTransaction: FilteredTransaction): TransactionSignature
Helper method to create a signature for a FilteredTransaction using the default identity signing key of the node. The legal identity key is used to sign. Additional SignatureMetadata, including the platform version used during signing and the cryptographic signature scheme use, is added to the signature. |
|
open fun getAppContext(): CordappContext
|
|
abstract fun jdbcSession(): Connection
Exposes a JDBC connection (session) object using the currently configured database. Applications can use this to execute arbitrary SQL queries (native, direct, prepared, callable) against its Node database tables (including custom contract tables defined by extending net.corda.core.schemas.QueryableState). |
|
open fun recordTransactions(notifyVault: Boolean, txs: Iterable<SignedTransaction>): Unit open fun recordTransactions(notifyVault: Boolean, first: SignedTransaction, vararg remaining: SignedTransaction): Unit
Stores the given SignedTransactions in the local transaction storage and then sends them to the vault for further processing if notifyVault is true. This is expected to be run within a database transaction. abstract fun recordTransactions(statesToRecord: StatesToRecord, txs: Iterable<SignedTransaction>): Unit
Stores the given SignedTransactions in the local transaction storage and then sends them to the vault for further processing if statesToRecord is not StatesToRecord.NONE. This is expected to be run within a database transaction. open fun recordTransactions(first: SignedTransaction, vararg remaining: SignedTransaction): Unit open fun recordTransactions(txs: Iterable<SignedTransaction>): Unit
Stores the given SignedTransactions in the local transaction storage and then sends them to the vault for further processing. This is expected to be run within a database transaction. |
|
abstract fun registerUnloadHandler(runOnStop: () -> Unit): Unit
Allows the registration of a callback that may inform services when the app is shutting down. |
|
open fun signInitialTransaction(builder: TransactionBuilder, publicKey: PublicKey): SignedTransaction
Helper method to construct an initial partially signed transaction from a TransactionBuilder using keys stored inside the node. Signature metadata is added automatically. open fun signInitialTransaction(builder: TransactionBuilder): SignedTransaction
Helper method to construct an initial partially signed transaction from a TransactionBuilder using the default identity key contained in the node. The legal identity key is used to sign. open fun signInitialTransaction(builder: TransactionBuilder, signingPubKeys: Iterable<PublicKey>): SignedTransaction
Helper method to construct an initial partially signed transaction from a TransactionBuilder using a set of keys all held in this node. |
|
open fun <T : ContractState> toStateAndRef(stateRef: StateRef): StateAndRef<T>
Converts the given StateRef into a StateAndRef object. |
|
abstract fun <T> withEntityManager(block: <ERROR CLASS>.() -> T): T abstract fun withEntityManager(block: Consumer<<ERROR CLASS>>): Unit
Exposes the Java Persistence API (JPA) to flows via a restricted EntityManager. This method can be used to persist and query entities which inherit from MappedSchema. This is particularly useful if off-ledger data needs to be kept in conjunction with on-ledger state data. |
const val SERVICE_PRIORITY_HIGH: Int |
|
const val SERVICE_PRIORITY_LOW: Int |
|
const val SERVICE_PRIORITY_NORMAL: Int |
fun Any.contextLogger(): <ERROR CLASS>
When called from a companion object, returns the logger for the enclosing class. |
|
fun ServiceHub.getCashBalance(currency: Currency): Amount<Currency> |
|
fun ServiceHub.getCashBalances(): Map<Currency, Amount<Currency>> |
|
fun ServiceHub.ledger(notary: Party = TestIdentity.fresh("ledger notary").party, script: LedgerDSL<TestTransactionDSLInterpreter, TestLedgerDSLInterpreter>.() -> Unit): LedgerDSL<TestTransactionDSLInterpreter, TestLedgerDSLInterpreter>
Creates and tests a ledger built by the passed in dsl. |
|
fun ServiceHub.transaction(notary: Party = TestIdentity.fresh("transaction notary").party, script: TransactionDSL<TransactionDSLInterpreter>.() -> EnforceVerifyOrFail): LedgerDSL<TestTransactionDSLInterpreter, TestLedgerDSLInterpreter>
Creates a ledger with a single transaction, built by the passed in dsl. |