corda/docs/source/api-service-hub.rst
James Higgs d0543d7270 [CORDA-3436] Allow CorDapps access to node diagnostic information (#5834)
* [CORDA-3436] Allow CorDapps access to node diagnostic information

* [CORDA-3436] Fix API breakages

* [CORDA-3436] Improve documentation around diagnostics service

* [CORDA-3436] Remove CorDapps from the diagnostics information

* [CORDA-3436] Silence detekt warning
2020-01-09 11:18:32 +00:00

33 lines
1.7 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
* ``ServiceHub.diagnosticsService``
* Provides diagnostic information about the node, including the node version and currently running apps. Note that this data should be
used for diagnostic purposes ONLY
* ``ServiceHub.contractUpgradeService``
* Provides functionality for secure contract upgrades
Additional, ``ServiceHub`` exposes the following properties:
* ``ServiceHub.loadState`` and ``ServiceHub.toStateAndRef`` to resolve a ``StateRef`` into a ``TransactionState`` or
a ``StateAndRef``
* ``ServiceHub.signInitialTransaction`` to sign a ``TransactionBuilder`` and convert it into a ``SignedTransaction``
* ``ServiceHub.createSignature`` and ``ServiceHub.addSignature`` to create and add signatures to a ``SignedTransaction``