mirror of
https://github.com/corda/corda.git
synced 2024-12-23 14:52:29 +00:00
f0c7d7665a
* Remove TransactionBuilder.signWith() * Remove TransactionBuilder.addSignatureUnchecked() * Rename signInitialTransaction to toSignedTransaction * Remove checkAndAddSignature() * Require all unit tests sign transactions via services
1.6 KiB
1.6 KiB
API: ServiceHub
Within FlowLogic.call
, the flow developer has access to the node's ServiceHub
, which provides access to the various services the node provides. The services offered by the ServiceHub
are split into the following categories:
ServiceHub.networkMapCache
- Provides information on other nodes on the network (e.g. notaries…)
ServiceHub.identityService
- Allows you to resolve anonymous identities to well-known identities if you have the required certificates
ServiceHub.attachments
- Gives you access to the node's attachments
ServiceHub.validatedTransactions
- Gives you access to the transactions stored in the node
ServiceHub.vaultService
- Stores the node’s current and historic states
ServiceHub.keyManagementService
- Manages signing transactions and generating fresh public keys
ServiceHub.myInfo
- Other information about the node
ServiceHub.clock
- Provides access to the node’s internal time and date
Additional, ServiceHub
exposes the following properties:
ServiceHub.loadState
andServiceHub.toStateAndRef
to resolve aStateRef
into aTransactionState
or aStateAndRef
ServiceHub.toSignedTransaction
to sign aTransactionBuilder
and convert it into aSignedTransaction
ServiceHub.createSignature
andServiceHub.addSignature
to create and add signatures to aSignedTransaction
Finally, ServiceHub
exposes the node's legal identity key (via ServiceHub.legalIdentityKey
) and its notary identity key (via ServiceHub.notaryIdentityKey
).