Merge branch 'release/os/4.3' into release/os/4.4

# Conflicts:
#	docs/source/docker-image.rst
This commit is contained in:
Anthony Keenan
2019-10-21 13:44:32 +01:00
91 changed files with 1787 additions and 913 deletions

View File

@ -88,6 +88,9 @@ Unreleased
Note that it's a responsibility of a client application to handle RPC reconnection in case this happens.
See :ref:`setting_jvm_args` and :ref:`memory_usage_and_tuning` for further details.
* Environment variables and system properties can now be provided with underscore separators instead of dots. Neither are case sensitive.
See :ref:`overriding config values <corda_configuration_file_overriding_config>` for more information.
.. _changelog_v4.1:
Version 4.1

View File

@ -371,13 +371,19 @@ More specifically, the behaviour in the second case is a bit more subtle:
.. warning:: In this approach, some events might be lost during a reconnection and not sent from the subscribed ``Observable``\s.
You can enable this graceful form of reconnection by using the ``gracefulReconnect`` parameter in the following way:
You can enable this graceful form of reconnection by using the ``gracefulReconnect`` parameter, which is an object containing 3 optional fields:
* ``onDisconnect``: A callback handler that will be invoked every time the connection is disconnected.
* ``onReconnect``: A callback handler that will be invoked every time the connection is established again after a disconnection.
* ``maxAttempts``: The maximum number of attempts that will be performed per RPC operation. A negative value implies infinite retries. The default value is 5.
This can be used in the following way:
.. container:: codeset
.. sourcecode:: kotlin
val gracefulReconnect = GracefulReconnect(onDisconnect={/*insert disconnect handling*/}, onReconnect{/*insert reconnect handling*/})
val gracefulReconnect = GracefulReconnect(onDisconnect={/*insert disconnect handling*/}, onReconnect{/*insert reconnect handling*/}, maxAttempts = 3)
val cordaClient = CordaRPCClient(nodeRpcAddress)
val cordaRpcOps = cordaClient.start(rpcUserName, rpcUserPassword, gracefulReconnect = gracefulReconnect).proxy
@ -392,7 +398,7 @@ You can enable this graceful form of reconnection by using the ``gracefulReconne
}
void method() {
GracefulReconnect gracefulReconnect = new GracefulReconnect(this::onDisconnect, this::onReconnect);
GracefulReconnect gracefulReconnect = new GracefulReconnect(this::onDisconnect, this::onReconnect, 3);
CordaRPCClient cordaClient = new CordaRPCClient(nodeRpcAddress);
CordaRPCConnection cordaRpcOps = cordaClient.start(rpcUserName, rpcUserPassword, gracefulReconnect);
}

View File

@ -19,6 +19,7 @@ def cordaSourceReadReplace(app, docname, source):
corda_substitutions = {
"|corda_version|" : constants_properties_dict["cordaVersion"],
"|corda_version_lower|" : constants_properties_dict["cordaVersion"].lower(),
"|java_version|" : "8u"+constants_properties_dict["java8MinUpdateVersion"],
"|kotlin_version|" : constants_properties_dict["kotlinVersion"],
"|gradle_plugins_version|" : constants_properties_dict["gradlePluginsVersion"],

View File

@ -39,6 +39,8 @@ To alter this behaviour, the ``on-unknown-config-keys`` command-line argument ca
Overriding values from node.conf
--------------------------------
.. _corda_configuration_file_overriding_config:
Environment variables
For example: ``${NODE_TRUST_STORE_PASSWORD}`` would be replaced by the contents of environment variable ``NODE_TRUST_STORE_PASSWORD`` (see: :ref:`hiding-sensitive-data` section).
@ -54,6 +56,11 @@ JVM options
.. note:: If the same field is overriden by both an environment variable and system property, the system property
takes precedence.
.. note:: Underscores can be used in instead of dots. For example overriding the ``p2pAddress`` with an environment variable can be done
by specifying ``CORDA_P2PADDRESS=host:port``. Variables and properties are not case sensitive. Corda will warn you if a variable
prefixed with ``CORDA`` cannot be mapped to a valid property. Shadowing occurs when two properties
of the same type with the same key are defined. For example having ``CORDA_P2PADDRESS=host:port`` and ``corda_p2paddress=host1:port1``
will raise an exception on startup. This is to prevent hard to spot mistakes.
Configuration file fields
-------------------------

View File

@ -342,7 +342,7 @@ It is also important that we capture the correct amount of contextual informatio
- Flow id (runId, also referred to as `StateMachineRunId`), if logging within a flow
- Other contextual Flow information (eg. counterparty), if logging within a flow
- `FlowStackSnapshot` information for catastrophic flow failures.
Note: this information is not currently supposed to be used in production (???).
Note: this information is not currently supposed to be used in production.
- Session id information for RPC calls
- CorDapp name, if logging from within a CorDapp

View File

@ -21,7 +21,7 @@ In this example, the certificates are stored at ``/home/user/cordaBase/certifica
-v /path/to/cordapps:/opt/corda/cordapps \
-p 10200:10200 \
-p 10201:10201 \
corda/corda-zulu-4.4-snapshot:latest
corda/corda-zulu-java1.8-|corda_version_lower|:latest
As the node runs within a container, several mount points are required:
@ -59,7 +59,7 @@ In this example, we have previously generated a network-parameters file using th
-v /home/user/sharedFolder/network-parameters:/opt/corda/network-parameters \
-p 10200:10200 \
-p 10201:10201 \
corda/corda-zulu-4.4-snapshot:latest
corda/corda-zulu-java1.8-|corda_version_lower|:latest
There is a new mount ``/home/user/sharedFolder/node-infos:/opt/corda/additional-node-infos`` which is used to hold the ``nodeInfo`` of all the nodes within the network.
As the node within the container starts up, it will place it's own nodeInfo into this directory. This will allow other nodes also using this folder to see this new node.
@ -83,7 +83,7 @@ Joining TestNet
-e LOCALITY="London" -e COUNTRY="GB" \
-v /home/user/docker/config:/etc/corda \
-v /home/user/docker/certificates:/opt/corda/certificates \
corda/corda-zulu-4.4-snapshot:latest config-generator --testnet
corda/corda-zulu-java1.8-|corda_version_lower|:latest config-generator --testnet
``$MY_PUBLIC_ADDRESS`` will be the public address that this node will be advertised on.
``$ONE_TIME_DOWNLOAD_KEY`` is the one-time code provided for joining TestNet.
@ -108,7 +108,7 @@ It is now possible to start the node using the generated config and certificates
-v /home/user/corda/samples/bank-of-corda-demo/build/nodes/BankOfCorda/cordapps:/opt/corda/cordapps \
-p 10200:10200 \
-p 10201:10201 \
corda/corda-zulu-4.4-snapshot:latest
corda/corda-zulu-java1.8-|corda_version_lower|:latest
Joining an existing Compatibility Zone
@ -132,7 +132,7 @@ It is possible to configure the name of the Trust Root file by setting the ``TRU
-e MY_EMAIL_ADDRESS="cordauser@r3.com" \
-v /home/user/docker/config:/etc/corda \
-v /home/user/docker/certificates:/opt/corda/certificates \
corda/corda-zulu-4.4-snapshot:latest config-generator --generic
corda/corda-zulu-java1.8-|corda_version_lower|:latest config-generator --generic
Several environment variables must also be passed to the container to allow it to register:
@ -163,5 +163,5 @@ Once the container has finished performing the initial registration, the node ca
-v /home/user/corda/samples/bank-of-corda-demo/build/nodes/BankOfCorda/cordapps:/opt/corda/cordapps \
-p 10200:10200 \
-p 10201:10201 \
corda/corda-zulu-4.4-snapshot:latest
corda/corda-zulu-java1.8-|corda_version_lower|:latest

View File

@ -10,7 +10,7 @@ containers to abstract the complexity of managing a distributed network away fro
The network you build will either be made up of local ``Docker`` nodes *or* of nodes spread across Azure
containers.
For each node a separate Docker image is built based on `corda/corda-zulu-|corda_version| <https://hub.docker.com/r/corda/corda-zulu-|corda_version|>`_.
For each node a separate Docker image is built based on `corda/corda-zulu-java1.8-|corda_version| <https://hub.docker.com/r/corda/corda-zulu-java1.8-|corda_version_lower|>`_.
Unlike the official image, a `node.conf` file and CorDapps are embedded into the image
(they are not externally provided to the running container via volumes/mount points).
More backends may be added in future. The tool is open source, so contributions to add more

View File

@ -195,20 +195,20 @@ parameters will be accepted without user input. The following parameters with th
:start-after: DOCSTART 1
:end-before: DOCEND 1
This behaviour can be turned off by setting the optional node configuration property ``NetworkParameterAcceptanceSettings.autoAcceptEnabled``
This behaviour can be turned off by setting the optional node configuration property ``networkParameterAcceptanceSettings.autoAcceptEnabled``
to ``false``. For example:
.. sourcecode:: guess
...
NetworkParameterAcceptanceSettings {
networkParameterAcceptanceSettings {
autoAcceptEnabled = false
}
...
It is also possible to switch off this behaviour at a more granular parameter level. This can be achieved by specifying the set of
``@AutoAcceptable`` parameters that should not be auto-acceptable in the optional
``NetworkParameterAcceptanceSettings.excludedAutoAcceptableParameters`` node configuration property.
``networkParameterAcceptanceSettings.excludedAutoAcceptableParameters`` node configuration property.
For example, auto-acceptance can be switched off for any updates that change the ``packageOwnership`` map by adding the following to the
node configuration:
@ -216,7 +216,7 @@ node configuration:
.. sourcecode:: guess
...
NetworkParameterAcceptanceSettings {
networkParameterAcceptanceSettings {
excludedAutoAcceptableParameters: ["packageOwnership"]
}
...

View File

@ -71,25 +71,41 @@ PARTY_NAME FK to NODE_INFO_PARTY_CERT
Node identities
^^^^^^^^^^^^^^^
The following two tables are used by the ``IdentityService`` and are created from the NodeInfos.
The following four tables are used by the ``IdentityService`` and are created from the NodeInfos.
They are append only tables used for persistent caching.
They will also be cleared on ``rpc.clearNetworkMapCache()``.
Read more in :doc:`api-identity` and :doc:`node-services`
============================== ==========================================================================================
NODE_IDENTITIES Maps public keys to identities
NODE_IDENTITIES Maps a public key hash to an identity.
============================== ==========================================================================================
PK_HASH The public key.
PK_HASH The public key hash.
IDENTITY_VALUE The certificate chain.
============================== ==========================================================================================
============================== ==========================================================================================
NODE_NAMED_IDENTITIES Maps the X500 name of a participant to a public key.
NODE_NAMED_IDENTITIES Maps the X500 name of a participant to a public key hash.
============================== ==========================================================================================
NAME The x500 name
PK_HASH The public key
NAME The x500 name.
PK_HASH The public key hash.
============================== ==========================================================================================
============================== ==========================================================================================
NODE_IDENTITIES_NO_CERT Maps a public key hash to the X500 name of a participant.
============================== ==========================================================================================
PK_HASH The public key hash.
NAME The x500 name.
============================== ==========================================================================================
============================== ==========================================================================================
NODE_HASH_TO_KEY Maps a public key hash to a public key.
============================== ==========================================================================================
PK_HASH The public key hash.
PUBLIC_KEY The public key.
============================== ==========================================================================================
@ -173,6 +189,7 @@ NODE_TRANSACTIONS Corda transactions in a binary format
TX_ID The hash of the transaction. Primary key.
TRANSACTION_VALUE The binary representation of the transaction.
STATE_MACHINE_RUN_ID The flow id associated with this transaction.
STATUS ``VERIFIED`` or ``UNVERIFIED``
============================== ==========================================================================================
|
@ -224,7 +241,6 @@ PUBLIC_KEY Binary public key
============================== ==========================================================================================
PK_HASH_TO_EXT_ID_MAP Maps public keys to external ids. Mainly used by CorDapps that need to simulate accounts.
============================== ==========================================================================================
ID Primary key
EXTERNAL_ID External id
PUBLIC_KEY_HASH Public key hash
============================== ==========================================================================================