corda/docs/source/api-service-hub.rst
Katarzyna Streich 495e870b74 NodeInfo remove main identity (#1284)
* Remove node's main identitiy from NodeInfo.

Preparation for getting rid of services + supporting multiple identities
on the node.
NodeInfo keeps multiple identities as a list. For now the first one is treated as a special one.
Introduced function chooseIdentity in CoreTestUtils as a preparation for proper handling of multiple identities in the future.
Remove legalIdentityKey from ServiceHub, add extension function - chooseIdentity on ServiceHub.
Add `me` field on FlowStateMachineImplemetation, flows should know what the calling identity is.
Remove SERVICES_PREFIX in artemis messaging layer.

* Address minor comments.

* Fixes after rebase.

Remove chooseIdentity from ServiceHub

* Rename me to ourIdentity on FlowLogic

* Fixes after rebase

* Address Ross comments, fixes

* Fix after rebase

* Fix services certificate paths

Apply Patrick's patch.
2017-09-15 14:39:34 +01:00

1.5 KiB
Raw Blame History

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 nodes 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 nodes internal time and date

Additional, ServiceHub exposes the following properties:

  • ServiceHub.loadState and ServiceHub.toStateAndRef to resolve a StateRef into a TransactionState or a StateAndRef
  • ServiceHub.toSignedTransaction to sign a TransactionBuilder and convert it into a SignedTransaction
  • ServiceHub.createSignature and ServiceHub.addSignature to create and add signatures to a SignedTransaction

Finally, ServiceHub exposes notary identity key via ServiceHub.notaryIdentityKey.