Commit Graph

524 Commits

Author SHA1 Message Date
Konstantinos Chalkias
106eb9df4a
[CORDA-2011] [CORDA-2057] CryptoService interface and BC HSM simulation (#4099) 2018-11-06 12:57:13 +00:00
Christian Sailer
3260d9f2c4
CORDA-1489 Exposure of node internals in mock network (#4130)
* Introduce public subset of config to tweak config via mock net work without exposing internal node config.

* Removal of functions exposing (internal) NodeConfiguration from the public test API

* Code review fixes

* Blank lines removed

* Documented mock network API change in upgrade notes.

* Updated documentation and API doc.

* More documentation/API doc
2018-11-05 09:29:05 +00:00
Venelin Stoykov
094eb266a8 [CORDA-2174] Fix demo node startup (#4151)
- Make issuableCurrencies config optional

- Allow additionalCordapps to override cordappsForAllNodes

In driver DSL when passing additionalCordapps to startNode and
one of the CordApps is also in cordappsForAllNodes will lead to confilc.
This commit is resolving the conflict by using the CordApp provided
by additionalCordapps
2018-11-02 11:44:18 +00:00
Andrius Dagys
66116e8d20
ENT-1858: Notary cleanup (#4134)
* Migrated all non-BFT notary implementations to use async commits.

* Mock network: await for async operation completion. When calling runNetwork()
it keeps "pumping" messages between participants until no more messages are generated.
The problem comes in when a flow suspends on an async operation: the mock network
thinks the flow finished the work for the current step, and since no more messages
are generated, completes the runNetwork() function. The message that the flow
generates once it resumes after async operation completion never gets processed.
This change makes runNetwork() wait until all flow async operations finish,
and only then check whether no more messages can be transferred.
2018-11-01 19:03:43 +00:00
Michele Sollecito
6022cecca5
[CORDA-1763]: Add node CLI option for validating configuration. (#4121) 2018-10-29 13:33:43 +00:00
Anthony Keenan
0ab644783e CORDA-1838: Add subcommands to node (#4091)
* Tidy up

* Add install-shell-extensions command

* Make cli tests use same version of picocli as everything else

* Remove initLogging from NodeStartup, it is ran earlier by CordaCLIWrapper

* Use picocli snapshot for testing

* Use RunLast() parser to invoke correct subcommands

* Deprecate old clear-network-map-cache parameter

* Restructure NodeStartup for commands

* Get rid of -c option since the flag method has been deprecated and that didn't exist in last release

* Update documentation

* Update backwards compatibility test

* Get all subcommands working

* Refactor sub commands into seperate classes

* Update docs and fix some tests

* Docs changes

* Fix merge conflicts with master

* Fix renamed parameters

* Fix test failure

* Fix compatibility tests

* Add missing compatibility test for blob inspector

* Remove blob inspector compatibility test as there are import conflicts

* Assorted doc fixes

* Addressing review comments

* More review comments

* Couple more bits

* Fix broken tests

* Fix compilation error

* More merge conflicts

* Make startup logging function a bit more sensible

* Fix broken shell extensions

* Make shell extensions work with subcommands

* Make sure parameters for deprecated options are carried through

* More review comments

* Adding some s's

* One last go

* Fix compilation error on Windows

* Revert logging changes

* Revert docs back to their original imperatively moody state
2018-10-24 13:58:19 +01:00
Stefano Franz
0919b01271
ENT-2509 - Make @InitiatedBy flows overridable via node config (#3960)
* first attempt at a flowManager

fix test breakages

add testing around registering subclasses

make flowManager a param of MockNode

extract interface
rename methods

more work around overriding flows

more test fixes

add sample project showing how to use flowOverrides

rebase

* make smallest possible changes to AttachmentSerializationTest and ReceiveAllFlowTests

* add some comments about how flow manager weights flows

* address review comments
add documentation

* address more review comments
2018-10-23 16:45:07 +01:00
Shams Asari
d3c5479826
CORDA-1621: The finance CorDapp uses the app config feature rather than the node's config (#4100) 2018-10-22 18:56:30 +01:00
Andrius Dagys
e0d8ea8a58
CORDA-535: Move implementation specific configuration values out of n… (#4058)
The configuration objects for specific notary implementations have been replaced
by a single untyped "extraConfig" Config object that is left to the notary service
itself to parse.

* Remove the raft bootstrapping command from node, we'll need a different
mechanism for that.

* Remove pre-generated identity config value.

* Split up obtainIdentity() in AbstractNode to make it easier to read.

* A temporary workaround for the bootstrapper tool to support BFT notaries.

* Update docs

* Add upgrade notes

* Fix rebase issue

* Add a config diff for the bft notary as well
2018-10-22 10:26:10 +01:00
Viktor Kolomeyko
88f368134f
ENT-2610: Separate passwords for store and for private keys in Corda OS. (#4090)
* ENT-2610: Separate passwords for store and for private keys in Corda OS.

When it comes to KeyStores there are *2* passwords: 1 for the keyStore as a whole and separately there is one private keys within this keyStore.
Unfortunately, those 2 passwords have to be the same due to Artemis limitation, for more details please see:
`org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport.loadKeyManagerFactory`
where it is calling `KeyManagerFactory.init()` with store password.

Before change in this PR, throughout our codebase there are multiple places where we assume that storePassword is the same as keyPassword, even in the classes that have nothing to do with Artemis.
This is of course less than ideal as TLS communication may be used not only for Artemis connectivity (e.g. Bridge/Float interaction in Ent) and it is unfair to impose same passwords constraint on that communication channel.
Therefore this PR is removing this limitation and properly separating storePassword from keyPassword.

Linked Jira(https://r3-cev.atlassian.net/browse/ENT-2610) has for more background info.

Suggest to start review from `net.corda.core.crypto.X509NameConstraintsTest` to get an idea about the nature of the changes made.

* ENT-2610: Address PR input from @kchalkias

* ENT-2610: Address PR input from @kchalkias, s/privateKeyPassword/entryPassword/

* ENT-2610: Address PR input from @kchalkias, s/keyPassword/entryPassword/

In the implementation of `CertificateStoreSupplier`
2018-10-22 07:11:27 +01:00
Katelyn Baker
7cfd44e383
CORDA-2113 - Include PNM ID in CSR (#4086)
* CORDA-2113 - Include PNM ID in CSR

If Compatibility Zone operator is using private networks and the node
should be joining one, optionally the ID (a UUID) of that network can be
included as part of the node's CSR to to the Doorman.

* fix broken test
2018-10-18 15:39:42 +01:00
Rick Parker
55731ef816
ENT-2431 Tidy up buildNamed and CacheFactory 2018-10-18 10:38:43 +01:00
Shams Asari
2c9a942e1a
CORDA-2088: Simplified the TestCordapp public API (#4064)
The entry point to the API has been simplified to just requireing a list of packages to scan, with sensible defaults provided for the metadata. Because of the wither methods, having parameters for the metadata (with default values) seems unnecessary. Also the ability to scan just individual classes has been made internal, as it seems unlikely app developers would need that level of control when testing their apps.

TestCordappImpl is a data class and thus acts as a natural key for the Jar caching, where previously the key was the package names. This fixes an issue where it was not possible to create two CorDapp Jars of the same package but different metadata.
2018-10-15 10:11:18 +01:00
Shams Asari
aced03df54
CORDA-1274: Migrated usage of FastClasspathScanner to ClassGraph (#4060)
FastClasspathScanner was renamed to ClassGraph for the version 4 release
2018-10-11 19:50:26 +01:00
Viktor Kolomeyko
0e68f26c0f
ENT-2569: Clean-up content of registeredShutdowns. (#4048)
Please see comment for more info.
2018-10-10 17:52:00 +01:00
Andrius Dagys
9ebeac1ad8
CORDA-535: Extract notary implementations into CorDapps (#3978)
* Move Raft and BFT notaries into separate modules

* Move schemas

* Fix tests & demos

* Modified logic for creating notary services:

Added a new field 'className' to the notary configuration. The node now
loads the specified implementation via reflection. The default className
value points to the simple notary implementation for backwards compatibility.
Relevant schemas are loaded in a similar fashion.

For backwards compatibility purposes the default SimpleNotaryService will
remain built-in to node, but its cordapp will be generated on startup – so
the loading of notary services is streamlined.

* Move test namedcache factory to test utils
2018-10-10 10:04:22 +01:00
Shams Asari
bffac331a3
Moved the PLATFORM_VERSION constant to core and added some missing usages (#4026) 2018-10-05 09:28:00 +01:00
Florian Friemel
842eac5c43
[CORDA-1926] Implement target version and min platform version (#3899)
https://r3-cev.atlassian.net/browse/CORDA-1926
2018-09-28 09:46:06 +01:00
szymonsztuka
06150371ad CORDA-1726 Make sure test frameworks and nodes refuse to start on any… (#3993)
* CORDA-1726 Make sure test frameworks and nodes refuse to start on anything except the right Java versions

Move isValidJavaVersion(), hasMinimumJavaVersion() to Node as it can be use for check in DriverDSL for starting in-process node,
in-process node doesn't go via NodeStartup class where the correct Java version is checked.

Added safeguard to hasMinimumJavaVersion as some JDKs distributions may not have the update version number (e.g. AdoptOpenJDK) which causes unintended parse exception.

* CORDA-1726 Make sure test frameworks and nodes refuse to start on anything except the right Java versions - remove new test, for proper testing this would use reflection and field setting visibility modifiers which easly can has side effects on the subsequent tests

* Addressing PR comments.
2018-09-27 19:01:01 +01:00
Rick Parker
965f9ce528
ENT-2431 Lay foundations for caching metrics (#3955) 2018-09-24 09:55:56 +01:00
Michele Sollecito
19b8f70117
[CORDA-1996]: Apply error code to exceptions that do not propagate to NodeStartup. (#3964) 2018-09-19 14:24:21 +02:00
Michele Sollecito
5113f4c8c1
[CORDA-1941]: Server-side draining node shutdown. (#3909) 2018-09-18 13:04:26 +02:00
Shams Asari
c79dd8017d
CORDA-1264: Mask internal errors if devMode is false (#3942) 2018-09-17 15:44:51 +01:00
Thomas Schroeter
ec55397335
Record Hikari metrics (#3912) 2018-09-10 13:13:58 +01:00
Michele Sollecito
20cd4539d6
Fixed broken master. (#3906) 2018-09-06 15:07:03 +01:00
bpaunescu
793ee3e1ee
Store default platform version in a constant (#3900)
* use constant for default platform version value when tests with out of process nodes are run from Intellij.

* node will use constant for platform version instead of manifest file(RPC already uses the constant, no sense in having 2 sources for it)

* fix issues caused by merge
2018-09-06 14:32:23 +01:00
Michele Sollecito
584387d5ec
Fixed some problem I discovered while working on another story (#3901)
* - Fixed some problems with error handling for Observables.
- Eliminated incorrect double `stop()` call for RpcBroker.
- Added `Schedulers.shutdown()` call in `stop()` implementation for Node and Driver, to avoid stuck processes when observable pipelines go wrong.

* Fixed a missing import.

* Removed `Schedulers.shutdown()` for now.

* Fixed an issue with `pendingFlowsCount()` function.
2018-09-06 13:11:41 +01:00
Matthew Nesbit
304dba704e
Support HA without load balancer (#3889)
Allow configuration in node for additional advertised addresses.

fix logic error

Use empty list as default config not null

Allow multiple addresses in NodeInfo

Describe new additionalP2PAddresses property in docs.

Add integration test of additionalP2PAddress feature

Fixup after rebase

Address PR comment

Address PR comments by removing unused element of NodeAddress
2018-09-05 17:46:46 +01:00
Michele Sollecito
2fbeab1365
Fixed compilation error for case-insensitive operating systems. (#3896) 2018-09-05 13:06:05 +01:00
Michele Sollecito
d01dd22419
[CORDA-1937]: Refactor NodeConfiguration hierarchy. (#3856) 2018-09-04 10:26:10 +01:00
Mike Hearn
33f5aa4190 RPC: make the client library require the platform version it is built for.
Remove an unnecessary override on the CordaRPCOps interface.
2018-09-03 19:05:47 +02:00
Dominic Fox
f81428eb53
Corda 1916: signature attachment constraints (#3839)
* Create constraint, extract Jar signature collection

* Extract JarSignatureCollector into its own file

* Jar signature collection throws exception if signatures are inconsistent

* Focus testing in Jar signature collection

* Extract some helper functions in test

* Patch tests with mock attachment storage

* Assert that generated constraint is satisfied by signed attachment

* Clarify constraint selection logic

* Explicit return types on extension methods

* Link to docsite Signature Contrainsts documentation

* Fix issue with shared JAR reading buffer
2018-08-24 17:21:54 +01:00
Clinton
3594ccd89b
CORDA-1924: Remove references to Cordform definition and cordform-common (#3842) 2018-08-24 16:29:14 +01:00
szymonsztuka
487cad7d06
CORDA-1471 Database schema setup for internal tables via Liquibase (#3815)
Internal tables (the tables from node and finance modules) are now tracked /created by Liquibase script.
Tables backing MappedSchemma in Cordapps are created by Hibernate (as before). 
The PR scope added Liquibase library, setup code SchemaMigration and XML scripts and from Enterprise.
For existing database installation - the node will auto-upgrade to use Liquibase.
Method migrateOlderDatabaseToUseLiquibase checks for any 3.X existing Corda database to upgrade database to use Liquibase. When the existing database without Liquibase integral tables is detected, the node (at startup) will create Liquibase tracking tables and fill them with all migration scripts (marked as done), this ensure the database will look as it would use Liquibase from the beginning.
The database changes gradually introduced by the subsequent 3.X releases (3.1, 3.2) are conditionally run by Liquibase.
2018-08-23 16:30:02 +01:00
Rick Parker
2f76651d00
ENT-2378 ENT-2377 Minimise database access during transaction creation and recording for public key handling (#3812)
* ENT-2378 ENT-2377 minimise database access by making more use of caches for filterMyKeys, and don't make a redundant database check for existence of new random keys.

* ENT-2378 Unit test for new method in PersistentIdentityService.
2018-08-20 15:01:51 +01:00
Joel Dudley
f3392e31d2
Documents waitQuiescent. Explains why it is important. (#3787)
* Update api-testing.rst

* Warning regarding using threadPerNode

* Corrects JavaDocs. Adds message to .
2018-08-16 17:34:50 +01:00
Shams Asari
3f27e8e0be
ENT-2359: Complete the nodeReady future if there are already node-infos in the db on startup (#3745)
Otherwise PersistentNetworkMapCache only completed the future if a node-info was added, which may not occur after a node restart and thus prevented the SMM from registering its listener with the messaging layer.

Further, the future is only completed if the node-info is other than the node's own one.
2018-08-07 16:17:06 +01:00
Viktor Kolomeyko
76d87b67ce
CORDA-1844: Support for high throughput Observables shipped via RPC (#3698)
* CORDA-1844: Exposing a problem via Unit test.

* CORDA-1844: Unit test update following input from Andras.

* CORDA-1844: Add optional parameter to reduce the time it takes to shutdown RPCServer.

* CORDA-1844: Add optional parameter to reduce the time it takes to shutdown RPCServer and sensibly default it.

Minor changes.
2018-08-06 13:14:53 +01:00
Dan Newton
40b922c1f2 CORDA-1837: Reject nodes that have the same organisation name in driver tests (#3740)
* Reject nodes that have the same organisation name as a previously registered node rather than the same X500 name

DriverDSLImpl -> NetworkVisibilityController -> register check organisation name rather than X500 name and throw IllegalStateException if already exists
Added test to DriverTests to test multiple organisation names end exceptionally

* Remove redundant test and store the organisation names rather than X500 names for driver tests
2018-08-04 13:26:41 +01:00
Dominic Fox
7182542724
Matchers (#3716)
* Move common matches to testing, add some missing ones

* Clarify test logic

* Move common matches to testing, add some missing ones

* Clarify test logic

* Rename 'randomise'

* endregion

* Fix broken unit test
2018-08-01 10:18:54 +01:00
Chris Rankin
01d896394a
CORDA-1862: Allow MockNetwork to create StartedMockNode from UnstartedMockNode. (#3731)
* Allow MockNetwork to create StartedMockNode from UnstartedMockNode.
* Reimplement by adding a `started` property to UnstartedMockNode.
* Throw IllegalStateException instead of NoSuchElementException.
* Add an isStarted property to UnstartedMockNode.
2018-08-01 08:35:39 +01:00
Chris Rankin
b7f7dcc510
CORDA-1861: Remove default value to make createUnstartedNode() unambiguous. (#3729) 2018-07-31 17:10:07 +01:00
Shams Asari
dfafdbcb9f
Added checks against the use of the special uploader tokens (#3724)
"app", "rpc", "p2p" and "unknown" have security implications (see isUploaderTrusted method) and thus they are not allowed to be used in the uploader field when importing attachments via the public API.
2018-07-31 17:01:39 +01:00
Tudor Malene
85caa9ee9d
Feature/corda 1847/remove hibernate observers (#3696)
* CORDA-1847 Fix hibernate observer issue

* CORDA-1847 Fix hibernate observer issue

* CORDA-1847 Fix hibernate observer issue

* CORDA-1847 Fix tests

* CORDA-1847 Fix tests

* CORDA-1847 Fix tests
2018-07-31 13:52:13 +01:00
Dominic Fox
4542e0cd06
CORDA-916: Add registerFlowFactory method to public test API (#3720)
* Add registerFlowFactory method to public test API

* Return CordaFuture rather than a plain Future

* Rename method

* Improve KDoc

* Hide internal interface with public wrapper

* Modify API current to include ResponderFlowFactory interface

* Take API definition change from generated file

* Note API change in changelog
2018-07-31 13:33:18 +01:00
Shams Asari
93bb24ed17
Internal mock node clean up (#3715)
* InMemoryMessagingNetwork.InMemoryMessaging renamed to MockNodeMessagingService and moved to internal package
* start method added to MockNodeMessagingService which enables AbstractNode to call makeMessagingService in its c'tor
* Removed TopicStringValidator as it's no longer used
* Clean up of TestStartedNode
* Merged InMemoryMessagingTests into InternalMockNetworkTests as it's testing InternalMockNetwork
2018-07-30 10:35:03 +01:00
Viktor Kolomeyko
e1223e3145
CORDA-1799: Always use "/" as a path separator inside JARs (#3704)
Or else tests are going to fail on Windows, e.g.:
https://ci-master.corda.r3cev.com/viewLog.html?buildId=103027&tab=buildResultsDiv&buildTypeId=Corda_BuildWindowsTest

```
java.lang.IllegalArgumentException: Illegal character in path at index 95: file:/F:/buildAgent/work/f0cf2ea65c8f73ab/finance/build/libs/corda-finance-4.0-SNAPSHOT.jar/net\corda\finance\contracts\asset\BilateralNetState.class
    at java.net.URI.create(URI.java:852)
    at net.corda.testing.node.internal.JarEntryInfo$Companion.classFileURL(TestCordappsUtils.kt:209)
    at net.corda.testing.node.internal.JarEntryInfo$Companion.access$classFileURL(TestCordappsUtils.kt:199)
    at net.corda.testing.node.internal.JarEntryInfo$ClassJarEntryInfo.<init>(TestCordappsUtils.kt:178)
    at net.corda.testing.node.internal.TestCordappsUtilsKt.jarEntryInfo(TestCordappsUtils.kt:56)
    at net.corda.testing.node.internal.MutableTestCorDapp$Companion.jarEntriesFromClasses(MutableTestCorDapp.kt:42)
...
 ```
2018-07-27 12:55:39 +01:00
Roger Willis
8207ac3222
CORDA-1332 Reference input states (#3525)
* * First commit for reference input states feature.

* Added docs.
* Added additional test.

* Fixed whitespace.

* Rebased to master.
* Updated Raft and persistent notary implementations.

* Updated changelog.

* Updated topo sort to handle reference states.
* Stubbed out with referenced states flow.

* Added WithReferencedStatesFlow.
* Added Tests for WithReferencedStatesFlow.
* Added ReferenceState type.
* Rebased to latest version of master.

* Added better comments.
* Updated unit test.

* Added comment to explain a little hack.
* Fixed broken contract upgrade RPC test.

* Added minimum platform version check.
* Updated mock network so that notary nodes inherit the platform version set by the network's minimum platform version.
* References states can now only be used when minimum platform version >= 4.

* Created a new file to hold async operations as "WaitForStatesToUpdate" is broadly reusable.
* Refactored WithReferenceStatesFlow

* Updated javadoc for WaitForStatesToUpdate aysnc operation.

* Added network parameters property to InternalMockNetwork.

* Added min platform version capability to mock services.

* Removed erroneous chars from file.

* Made async operation internal and now call it from FlowLogic.
* Moved some transaction checking code around.

* Removed serializable annotation from referenced state and ref.
* Added reference states design doc.
* Added missing KDocs.
* Updated with reference states flow to handle consecutive update races.
* Made platform version info an inheritable thread local.
* Fixed various typos.
* Updated docs.

* Fixed race.

* Removed min platform version checks as API needs more thought.

* Added deprecation to method and supressed warnings.

* Renamed WaitForStatesToUpdate to WaitForStateConsumption.
* Fixed race in WaitForStateConsumption.

* Addressed PR comments and updated comments / KDocs.

* Reverse vault bugfixes.

* * Vault bug fixes.

* * Fixed broken test.
* Moved WaitForStateConsumption to internal package.
2018-07-25 14:06:56 +01:00
Dominic Fox
f5b86d32f8
Eliminate StartedNode (#3690)
* Shrink StartedNode

* Eliminate StartedNode
2018-07-25 13:49:34 +01:00
Dominic Fox
6b320026a1
CORDA-916 separate test startednode (#3675)
* Push start() implementation back into base

* Narrow access

* Optimise imports

* Fix tests

* Get Java test compiling
2018-07-25 10:05:50 +01:00
Tudor Malene
40fc56f2ea
Feature/corda 1813/change postgres column type (#3631)
* CORDA-1813 fix Postgres db bloat issue

* CORDA-1813 merge fixes

* CORDA-1813 change column type and size to a standard corda type

* CORDA-1813 docs

* CORDA-1813 create custom hibernate type for the checkpoint blob and align with enterprise

* CORDA-1813 Remove max col size

* CORDA-1813 Remove max col size

* CORDA-1813 Fix merge

* CORDA-1813 Remove buggy :serverNameTablePrefix: configuration
2018-07-25 09:52:57 +01:00
Shams Asari
d4f0e0f8e0
Ordered starting of node components and clear dependencies between them (#3664)
Moved start up logic of the various node components out of their c’tors and into “start” methods, which are called from Node.start(). The components themselves are created in the Node’s c’tor with minimal initialisation logic.

Certain things are not immediately available at construction time, which are instead given to the components at start time in an orderly fashion:

* Certs from the node’s key store and trust store
* The network parameters, and thus access to things like maxMessageSize and the contracts whitelist
* A running database - several components were doing database stuff their c’tors
* The node’s NodeInfo, and thus access to things like identities and addresses

The messaging service couldn’t be created in the Node’s c’tor due to initialisation issues with MockNode. This should be fixed in a later commit.
2018-07-24 16:13:21 +01:00
Shams Asari
a0183fbdfd
Removed PersistentNetworkMapCache.start() (#3661)
The loading of all node infos in the start method was unnecessary, both for the changePublisher and _loadDBSuccess, and the setting of _registrationFuture was incorrect.
2018-07-23 14:01:14 +01:00
Michele Sollecito
abc1d99eaa
[CORDA-1799]: Avoid generating test CorDapp JARs from each out of process node started by the driver (#3641) 2018-07-23 11:18:11 +01:00
Shams Asari
ff607e1bc1
Moved network services tests back as unit tests (#3639) 2018-07-18 11:03:45 +01:00
Shams Asari
921b132658
Deprecated freeLocalHostAndPort, freePort and getFreeLocalPorts of TestUtils (#3630)
They're prone to cause flaky tests due to the "allocated" ports already being taken by the system when eventually needed. Replaced usages with PortAllocation.Incremental.

Affected unit tests made into integration tests to avoid any issues in the future when unit tests are made to run in parallel.
2018-07-17 14:42:30 +01:00
Shams Asari
736d62ec1a
Retire RandomFree as it causes flaky tests (#3626) 2018-07-17 10:29:47 +01:00
Shams Asari
dc3bd8de7a Retired BankOfCordaRPCClientTest as it's mostly duplicated by BankOfCordaCordformTest (#3565) 2018-07-13 10:37:51 +01:00
Shams Asari
f4a248f81f
Made CashSelectionTest a unit test by using mock network. (#3570)
Also includes adding a default value of emptyList() to InternalMockNetwork.cordappPackages
2018-07-12 11:55:51 +01:00
Shams Asari
2833ec2a88
Avoiding starting notaries in driver-based integration tests to speed them up (#3544) 2018-07-11 11:36:36 +01:00
Viktor Kolomeyko
d481c55b82
CORDA-1743: Remove isDebug = true from Node driver to speed-up integration tests execution. (#3535)
* CORDA-1743: Remove `isDebug = true` from Node driver to speed-up integration tests execution.

* CORDA-1743: Undo removal of "isDebug = true" from the test that specifically checks for this condition.

* CORDA-1743: Address input from @shamsasari
2018-07-09 16:37:01 +01:00
Shams Asari
aefd90f062
Minor: ProcessUtilities clean up (#3533) 2018-07-09 12:29:33 +01:00
Maksymilian Pawlak
f7dd4f7880
Use in-memory H2 for integration test (#2508)
* Default integration tests running with in-memory H2
2018-07-05 14:58:51 +01:00
Shams Asari
244167d3e9
Enabled warnings as errors (#3514) 2018-07-04 17:17:27 +01:00
Tudor Malene
95d1b1f84e
ENT-2001 use versionInfo when registering node with the doorman (#3435)
* ENT-2001 use versionInfo when registering node with the doorman

* ENT-2001 address code review changes
2018-07-03 09:16:48 +01:00
PokeyBot
2b6018f050
Merge pull request #3473 from corda/fix_flaky_test
[CORDA-1698] Fix flaky test
2018-06-29 16:26:24 +01:00
Florian Friemel
4c56188383
Cleanup. 2018-06-29 09:55:34 +01:00
Florian Friemel
941719ab8b
Use TestClock in MockServices. 2018-06-28 17:14:06 +01:00
Patrick Kuo
8df18e954f ENT-2014 Deletes of NodeInfo can fail to propagate leading to infinite retries (#1101)
* ENT-2014 Deletes of NodeInfo can fail to propagate leading to infinite retries
ENT-1880 Move identity key generation to network registration process

(cherry picked from commit c3ac203)
2018-06-28 15:20:22 +01:00
Shams Asari
eee2563bfa
CORDA-1660: Wiring up the CordaRPCClient class loader to the p2p serialisation context. (#3454)
This is to allow the standalone shell to be able to receive WireTransactions containing Cash.State objects.
2018-06-27 17:02:35 +01:00
Tudor Malene
9be4c5dca4
CORDA-1567 Remove all traces of the out-of-process verifier (#3424) 2018-06-25 13:01:33 +01:00
Tudor Malene
687ed95994
CORDA-1407 Fix explorer rpc access rights (#3413) 2018-06-22 09:48:13 +01:00
Florian Friemel
100008b139
[CORDA-1634] Destroy child processes when parent exits. (#3368)
* [CORDA-1634] Destroy child processes when parent exits.

* Add comment.

* Register Shutdownhook for processes regardless of whether the Driver was initialized with

* Add comment.

* Revert "Add comment."

This reverts commit a5e78c379f.

* Add comment.

* Add shutdown hook in ShutdownManager.registerProcessShutdown.

* Initialize the ShutdownManager with a shutdown hook to ensure that  is called.

* Add comment.
2018-06-18 17:39:46 +01:00
Tommy Lillehagen
fe313951ea CORDA-1609 - Don't use reserved keyword as method name
As reported in [CORDA-1609](https://r3-cev.atlassian.net/browse/CORDA-1609),
`CordaRPCClientConfiguration.default` is not accessible from Java since
`default` is a reserved keyword.

As part of the refactor made in #2831, `CordaRPCClientConfiguration` went
from being a data class to an interface with a backing implementation of
type `CordaRPCClientConfigurationImpl`.

This resulted in Java users having to rewrite code that was on the form:

```java
final CordaRPCClient client = new CordaRPCClient(
    nodeAddress, CordaRPCClientConfiguration.DEFAULT
);
```

to something like this:

```java
final CordaRPCClient client = new CordaRPCClient(
    nodeAddress, CordaRPCClientConfiguration.Companion.default()
);
```

However, this does not work. The user would get a compilation error because
`default` is a reserved keyword in Java.

Since `CordaRPCClientConfiguration` has been made an interface, there is no
easy way of introducing a static final field on the interface from Kotlin.

Consequently, I've changed this back to using a `class` with a static field
named `DEFAULT` instead of the static method `default()`.

It should be noted that `default()` / `DEFAULT` is currently only used
internally to pass in default values in `CordaRPCClient.kt` and
`CordaRPCClientUtils.kt`. That said, it is exposed as part of our API
surface and consequently shouldn't be broken.

The latter means that in the above example, the user would actually not
have to provide the parameter at all:

```java
final CordaRPCClient client = new CordaRPCClient(nodeAddress);
```

As can be seen from the definition of `CordaRPCClient`:

```kotlin
class CordaRPCClient private constructor(...) {
    @JvmOverloads
    constructor(
        hostAndPort: NetworkHostAndPort,
        configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT
    ) : this(hostAndPort, configuration, null)
```

The mentioned [refactor](7a077e76f0 (diff-0948c125db93a22263eb81eaf3161c17R65))
did not make it into the 3.1 release, so from an API-stability perspective,
this change can be applied without affecting our commitment to a
backwards compatible API..
2018-06-13 15:39:03 +01:00
Andrius Dagys
85fe0e4cb1
CORDA-1494: Rename p2pMessagingRetry configuration to flowTimeout configuration to reflect the change in how retries are implemented – it is now on flow rather than message level. (#3339) 2018-06-11 15:50:06 +01:00
Andrius Dagys
a590d5e0b3
CORDA-1494: Remove isTimed check from flow hospital when handling tim… (#3337)
* CORDA-1494: Remove isTimed check from flow hospital when handling timeout exceptions - the timeout might expire just after the TimeFlow has finished and the staff member would throw an exception.

Increase the default flow timeout value in mock network so retries don't happen – this has cause test flakiness.
2018-06-11 13:17:22 +01:00
Shams Asari
f6a23a0216
CORDA-1546: Updated the flow hospital to suspend FinalityHandler if it errors (#3304)
It will re-run automatically from last checkpoint on node restart, allowing the opportunity to resolve the issue, something required when dealing with contract constraint failures.
2018-06-07 16:18:00 +01:00
Andrius Dagys
0978d041a3
CORDA-1494: Re-enable notarisation retries in the new state machine manager (#3295)
* Remove all notion of message level retry.

* Introduce randomness into de-duplication IDs based on the session rather than the flow, in support of idempotent flows.

* CORDA-1494: Re-enable notarisation retries in the new state machine manager.

The original message-based retry approach does not work well with the new
flow state machine due to the way sessions are handled. We decided to move
the retry logic to flow-level: introduce RetryableFlow that won't have
checkpoints persisted and will be restarted after a configurable timeout
if it does not complete in time.

The RetryableFlow functionality will be internal for now, as it's mainly
tailored for the notary client flow, and there are many subtle ways it can
fail when used with arbitrary flows.
2018-06-07 08:45:32 +01:00
Michele Sollecito
fc020bca4b
[CORDA-1575]: Out of process nodes started by the driver do not log to file (fix). (#3286) 2018-06-01 16:16:23 +01:00
Michele Sollecito
f68cf6f712
[CORDA-1341]: Ensure API can be called concurrently wrt transactions. (#3235) 2018-05-29 15:25:34 +01:00
Rick Parker
59fdb3df67
CORDA-1475 CORDA-1465 Allow flows to retry from last checkpoint (#3204) 2018-05-25 13:26:00 +01:00
Katelyn Baker
a3d88f752d
CORDA-1510 - Allow Doorman and NetworkMap to be configured independently (#3220)
* CORDA-1510 - Allow Doorman and NetworkMap to be configured independently

Currently only one compatabilityZoneURL can be specified, however the
two services can be run on as separate servers. Allow nodes to be
configured in this manner

* Partial review comments

* Review comments

* review comments
2018-05-25 11:37:20 +01:00
Siddhartha Sengupta
093be1b88c Using a List for the identity certs in InMemoryIdentityService and PersistentIdentityService (#3210) 2018-05-23 10:14:13 +01:00
Tudor Malene
455221629b
CORDA-1343 Make the RPCClient ssl constructors public. Clean up broke… (#3039)
* CORDA-1343 Make the RPCClient ssl constructors public. Clean up broker authentication logic

* CORDA-1343 small fix

* CORDA-1343 cleanup

* CORDA-1343 fixed api changes script

* CORDA-1343 fixed merge

* CORDA-1343 removed unused property

* CORDA-1343 add separate p2p and rpc node users

* CORDA-1343 remove test configuration

* CORDA-1343 fix tests

* CORDA-1343 address core review comments

* CORDA-1343 some documentation and adding createWithSsl method for a haAddressPool

* CORDA-1343 clean up the CordaRPCClient interface

* CORDA-1343 add internal shell test

* CORDA-1343 address code review comments

* CORDA-1343 split the internalShell user from the System Rpc user

* CORDA-1343 fix test

* CORDA-1343 Add warning when certificateChainCheckPolicies is being configured

* CORDA-1343 Address code review changes

* CORDA-1343 fix merge

* CORDA-1343 added test, docs, clarify comments

* CORDA-1343 clean up docs

* CORDA-1343 fix api

* CORDA-1343 fix merge

* CORDA-1343 fix merge

* CORDA-1343 fix merge

* CORDA-1343 fix merge
2018-05-21 13:05:08 +03:00
Shams Asari
3cdd908714
Moved the serialisation logic in nodeapi.internal.serialization into its own module: serialization (#3179)
node-api now depends on this module and upcoming changes will use this as well rather than having to depend on node-api.

EnumEvolveTests.deserializeWithRename and EnumEvolveTests.multiOperations are temporarily ignored since their test resources can't be regenerated due to bugs.
2018-05-17 16:18:07 +01:00
Kat Baker
f850daa582 CORDA-847 - AMQP RPC
* Client and server support for amqp
 * Observable (and supporting) serialisers
   Unit Tests
 * Fixing tests
 * Test fixes
 * CORDA-847 - Update api doc with additon of @CordaSerializable annotation
 * TestFixes
 * review comments
 * TestFixes
 * Test Fix
 * Test Fix
 * Test Fix
 * Test Fix
 * Test Fix
 * Test Fix
 * TestFix
 * Test Fix
 * Review Comments
2018-05-17 12:53:38 +01:00
josecoll
27803cdc9e
ENT-1887 Make sure open and enterprise API are identical (#3158)
* Sync public API's (and associated internal helpers) between Enterprise and OS.

* Add previous default constructor explicitly.

* Keep the API checker happy!

* Revert addition of ENT makeTestDataSourceProperties() function.
2018-05-16 18:01:53 +01:00
Thomas Schroeter
3d50e73271 Add configuration notary.serviceLegalName for clustered notaries 2018-05-16 15:19:14 +01:00
Katarzyna Streich
24fa695ca0
CORDA-866: Implement removal of stale nodes from network - backport (#3128)
* CORDA-866: Implement removal of stale nodes from network

Backported

* Implement removal of stale nodes from network

Add eventHorizon to NetworkParameters structure. Add republishing of
node info on 1 day intervals - it is treated by network map as heartbeat from node indicating if it's alive or not. Add removal of old node infos on network map signing.

* Add copy method to NetworkParameters data class

Add JvmOverloads annotation to the constructor, because it's data class
exposed in API

* Fix test
2018-05-15 12:10:04 +01:00
Michele Sollecito
d027b5b8f2
[CORDA-1472]: Crackdown on warnings. (#3136) 2018-05-14 21:15:52 +07:00
Tudor Malene
543491c7df
CORDA-1461 improve devMode (#3100)
* CORDA-1461 improve devMode

* CORDA-1461 set devMode=true for driver

* CORDA-1461 fix tests and improve UI

* CORDA-1461 Address code review changes

* CORDA-1461 Missing developer emoji

* CORDA-1461 use latest cordform that sets devMode=true

* CORDA-1461 fix test and add driver overrides for notary

* CORDA-1461 fix tests, fix api-scanner version

* CORDA-1461 fix api

* CORDA-1461 formatting

* CORDA-1461 comment style
2018-05-11 17:48:02 +01:00
Shams Asari
a772884d48
CORDA-1030 - allow nodes to be waited for in-process (#2678) (#3070)
(cherry picked from commit 53bb986)
2018-05-03 17:48:49 +01:00
Roger Willis
db22c5259d
Feature to exclude CorDapps from specific MockNodes in a MockNetwork. (#3028)
* Feature to exclude CorDapps from specific MockNode's in a MockNetwork.

* Fixed API stability issue.

* * Added docs.
* Changed approach for the new parameter to be additive as opposed to exclusive.

* * Updated incorrect comments.
2018-05-03 15:39:52 +01:00
Patrick Kuo
2750017b8e Bug fix: registration tool doesn't register for service identity if keystore already contains node cert (#756)
* fix a bug where registration tool will refuse to register for a service identity if the keystore contain NODE_CA key already.
some refactoring

(cherry picked from commit 5ed60ab)
2018-05-02 09:59:12 +01:00
Katelyn Baker
e338414cd4
CORDA-847 - RPC Clent lib refactoring (#3052)
Move Kryo into it's own sub module
2018-05-01 20:52:19 +01:00
bpaunescu
c3e6b39e59
artemis upgrade to 2.5.0 (#3029) 2018-04-27 19:54:08 +01:00
Thomas Schroeter
2ff3939e2e
Add exponential backoff to P2P messaging retry (#2975) 2018-04-26 13:58:41 +01:00
bpaunescu
c4ceca3787
Merge pull request #2989 from corda/ENT-1775-PR759
ENT-1775: reworked client to handle failover in HA mode instead of Artemis
2018-04-23 17:15:00 +01:00
Andras Slemmer
ce5fb66260 StateMachine rewrite 2018-04-23 15:36:16 +01:00
Shams Asari
d3446e213c
Introduced a few more extension methods to Path, which are clearer than the static methods in Files. (#2985)
Also migrated code away from the old File API.
2018-04-23 14:31:49 +01:00
Viktor Kolomeyko
3aaa176dd4
CORDA-1355: Introduce a dedicated property which controls what is going to be in scope for classpath scanning (#2977)
* CORDA-1355: Introduce a dedicated property which controls what is going to be in scope for classpath scanning

* CORDA-1355: Update change log

* CORDA-1355: Minor change to improve readability.

* CORDA-1355: Custom serializers documentation update to mention new system property.
2018-04-23 13:55:40 +01:00
bpaunescu
3a17d4726f ENT-1775: reworked client to handle failover in HA mode instead of relying on artemis (#759)
* ENT-1775: reworked client to handle failover in HA mode instead of relying on artemis

* ENT-1775: address PR comments
2018-04-22 14:48:16 +01:00
Katarzyna Streich
91c52af5ac
ENT-1584: Subscribe to private network maps using UUIDs (#2922)
Client private network map implementation

Add private network maps UUIDs to config as extraNetworkMapKeys. Adjust NetworkMapServer implementation accordingly.
Change NetworkMapUpdaterTest to use NetworkMapServer instead of mock
2018-04-13 10:52:45 +01:00
Shams Asari
f88542faa2
CORDA-1095: Fixed rare race where the startNode future completes before the default notary is visible (#2947) 2018-04-11 15:33:55 +01:00
Rick Parker
130b1d9325
CORDA-1303 Regression: Recording a duplicate transaction attempts sec… (#2935)
* CORDA-1303 Regression: Recording a duplicate transaction attempts second insert to vault.

Added unit test, and merged mock and real logic.
2018-04-06 10:28:51 +01:00
Viktor Kolomeyko
d5317e074c
Remove errorLogPath parameter which is not used anyway. (#2934)
StdErr is always written to working directory if such path specified.
2018-04-05 18:10:47 +01:00
Shams Asari
53a0aae489
Introduced a few helper methods around InputStream.readBytes (#2928) 2018-04-05 14:27:42 +01:00
Viktor Kolomeyko
1f5559e3c4
Speed-up NodeRegistrationTest (#2873)
* Improve logging for NetworkMap requests

* Allow interrupt in polling if the process started successfully

* Put `advertiseNewParameters` back

* Additional log line to indicate when all the nodes are started

* Improve logging and use concurrent map since it is updated from multiple threads

* Change NetworkMap response validity duration and rename parameter accordingly

* Changes following code review from @shamsasari
2018-04-03 17:33:42 +01:00
renlulu
196a24f030 Optimize imports (#2872) 2018-03-29 11:25:56 +01:00
Shams Asari
768dd32417
ENT-1663 - Inclusion of the cert path and root cert in the exception message when cert path validation fails. (#2890)
Also, added check to node startup that --initial-registration cannot occur in devMode
2018-03-28 15:18:50 +01:00
Tudor Malene
7978910e0b
ENT-1633 increase node max heap size to 512m (#2851) 2018-03-26 13:41:37 +01:00
Shams Asari
620ba1e8a2
Integration test for network parameter updates and improved logging (#2863) 2018-03-22 14:08:07 +00:00
igor nitto
8591ae2dc9
CordApps back in node classpath (#2843) [CORDA-1232] 2018-03-19 14:34:02 +00:00
Michele Sollecito
7a077e76f0
CORDA-1099: Orchestrated clean shutdown from Shell (#2831) 2018-03-19 14:20:10 +00:00
Shams Asari
327d7d8acf
Added sign helper method to CertificateAndKeyPair for producing SignedDataWithCert objects (#2841) 2018-03-19 12:47:23 +00:00
igor nitto
2cff495553
Remove CordApps JARs from node classpath [CORDA-1135] (#2691) 2018-03-14 16:42:23 +00:00
szymonsztuka
72074c76c7
[CORDA-792] Standalone Shell (#2663)
- Existing embedded Shell connects via RPC including checking RPC user credentials (before was a direct use of CordaRPCOps):  in dev mode when console terminal is enabled, node created `shell` user.
- New Standalone Shell app with the same functionalities as Shell: connects to a node via RPC Client,  can use SSL and run SSH server.
2018-03-07 09:57:32 +00:00
Michele Sollecito
b580a2ac30
[CORDA-926]: Parsing NodeConfiguration will now fail if unknown properties are present. (#2484) 2018-03-01 14:57:36 +00:00
Anthony Keenan
577033441a
[CORDA-1035] Testing api KDoc Updates (#2584)
* Testing api KDoc Updates

* Update after code review

* Update api-current

* Revert changes to compiler.xml

* Made comment changes from review

* Fixing merge conflict

* Don't expose net.corda.node through test API (first pass)

* Fixing merge conflicts

* Update api-current

* Addressing review commits

* Fix exposure of internal implementation of MessageHandlerRegistration

* Make InProcess expose ServiceHub instead of internal StartedNodeServices

* Move InternalMockMessaginService interface to internal namespace

* Move MOCK_VERSION_INFO to internal namespace to avoid exposing VersionInfo

* Don't expose WritableTransactionStorage via testing api

* Create public VerifierType enum

* Update api-current and modify check-api-changes to check for net.corda.node exposures

* Fix merge conflicts

* Fixing another merge conflict

* Fix accidentally broken unit tests

* Make getInternalServices a property

* Fix failing unit tests

* Add todo to check-api-changes

* Fix rpc sender thread busy looping

* Fix tests

* Fixing tests

* Address mike's comments

* Fixing tests

* Make random port allocation internal

* Update api
2018-02-28 13:26:49 +00:00
Andrzej Cichocki
4d4253a287
CORDA-1124 Fix thread leak in generateAndSaveNodeInfo (#2659) 2018-02-27 15:43:41 +00:00
Maksymilian Pawlak
854a40d87f
[Corda-1116] Classpath as env (#2652)
* Move classpath to a system variable so it can overcome command limits on Windows, while keep working fine on other system.
2018-02-27 11:48:25 +00:00
Andrius Dagys
0edfef2409 CORDA-696 - Create separate transaction types for contract upgrade transactions (#2589)
* CORDA-986 and CORDA-985 CompositeKey and Signature verification performance fixes (#2467)

* CORDA-696: Create separate transaction types for contract upgrade transactions.

Add rationale around upgrade transactions

Move contract upgrade transaction resolution logic into internal until it's stabilised.

Throw a better exception when contract attachment not found

Default legacy contract constraint to always accepting - needs to be changed to whitelist constraint before merging

Introduce a new upgraded contract interface that allows specifying the legacy constraint.

Remove StateLoader, make all tx resolution functions take in ServicesForResolution

Contract upgrade transactions can handle whitelist by zone constraints

When creating a contract upgrade transaction, make sure the attachment of the old cordapp gets attached when using hash constraints.
Attachment lookup for a given contract class name only scans currently loaded cordapps, and we don't load old versions of cordapps.

CORDA-696: Update upgrade docs
2018-02-26 11:29:25 +00:00
Michele Sollecito
5be0e4b39e
[CORDA-941]: Add NetworkParameters contract implementation whitelist. (#2580) 2018-02-23 14:29:02 +00:00
Patrick Kuo
1552e992e7
ENT-1443 Add cert role to CSR and doorman issue cert according to the cert role (#2620)
* ENT-1443 Add cert role to CSR and doorman issue cert according to the cert role (#431)

* Doorman and HSM create certificate base on requested cert role specified in the certificate signing request.

(cherry picked from commit 94f7392)

* remove R3 corda code
2018-02-23 13:38:09 +00:00
Shams Asari
2af0feee04
Various cleanup of the network map code (#2604) 2018-02-23 09:13:00 +00:00
Andras Slemmer
51704cd7a4
Merge pull request #2591 from corda/aslemmer-fix-mocknetwork-networkparams
Pass network params to InternalMockNetwork
2018-02-21 18:00:02 +00:00
Michele Sollecito
9ddd47ea39
[CORDA-1059]: Fix Driver hanging on duplicate node names. (#2590) 2018-02-21 11:28:51 +00:00
Andras Slemmer
1592c18770 Pass network params to InternalMockNetwork 2018-02-21 11:28:29 +00:00
Shams Asari
979aef1308
Removed DriverParameters.initialiseSerialization (#2572) 2018-02-20 12:57:59 +00:00
Shams Asari
ad959c7af1
Changed the wither methods in DriverParameters and NodeParameters to begin with "with" and not "set" (#2570) 2018-02-19 18:11:20 +00:00
Mike Hearn
4f0c692831 Minor: reduce the size of the MockNetwork API a bit, add some better documentation 2018-02-19 16:58:28 +01:00
Shams Asari
71c94f8a9d
Reversing the introduction of GlobalProperties (by CORDA-961), and added NetworkParameters to ServicesForResolution instead. (#2563)
Also, replaced the maxTransactionSize parameter of the driver and MockNetwork with NetworkParameters.
2018-02-19 12:23:59 +00:00
igor nitto
ed0cf91946
Start Jolokia agents if configured without modifying JVM options [CORDA-1042] (#2541)
* Jolokia agents are loaded dynamically if configured
* Renamed exportJmxTo (never used) to jmxMonitoringHttpPort and take it from config
* Updated documentation and tests
2018-02-15 17:10:07 +00:00
Shams Asari
2864ce1384
ENT-1519: Ensure NodeInfo always has at least one address by checking in the c'tor (#2538)
Further, the look up of the node's own node-info from its database has been tightened to ensure there isn't more than one.

Also fixed some brittle code which was assuming exactly one address rather than at least one.
2018-02-15 14:06:41 +00:00
Anthony Keenan
3e8d76334e
CORDA-939 Modify Api Scanner to check api for internal exposures (#2510)
* Update check api changes to look for internals

* Update several more uses of internal

* Make check-api-changes script filter out internal class usages

* Make CordaClock part of API

* Update api-current.txt

* Remove exclusion of nodeapi.internal

* Remove access to CordaPersistence from public api

* Don't expose DB Connection from StartedMockNode and remove unnecessary transaction from CustomVaultQueryTest

* Make internal tests that use need db access use InternalMockNetwork

* Make test certificates internal

* Address further review comments

* Revert some accidental changes to api-current.txt

* Address Shams' review comments

* Update Api Scanner to filter out CordaInternal attribute

* Update api-current.txt

* Remove superfluous brackets

* Add transaction to StartedMockNode

* More leaky transaction fixes
2018-02-14 16:42:56 +00:00
Clinton
174ed3c64b
CORDA-556: Added Cordapp Config and a sample (#2469)
* Added per-cordapp configuration 
* Added new API for Cordformation cordapp declarations to support per-cordapp configuration
* Added a cordapp configuration sample
2018-02-14 14:49:59 +00:00
Anthony Keenan
117f4a721e
CORDA-939 Remove sslConfiguration from public constructor of CordaRPCClient (#2522)
* Remove sslConfiguration from public constructor of CordaRPCClient

* Address review comments

* Update api-current.txt

* sslConfiguration doesn't need to be a property
2018-02-13 21:39:31 +00:00
Maksymilian Pawlak
b91dd43a83
Test driver default parameters removal (#2519)
* Removed long parameter list in test driver, replaced with DriverParameters object
2018-02-13 13:15:05 +00:00
Joel Dudley
c3455053ac
Adds constructors for creating mock nodes by passing params. 2018-02-12 17:50:35 +00:00
Joel Dudley
ad1be79900
Reorders params to put non-default args first. Creates simpler default constructors. 2018-02-12 17:02:34 +00:00
Michele Sollecito
da591363fd
CORDA-990: Flows Draining Mode (#2483)
[CORDA-990]: Flows draining mode.
2018-02-12 16:13:43 +00:00
Patrick Kuo
ddf0d34147
CORDA-1008 Samples fail to run due to wrongly configured max transaction size in the network bootstrapper (#2509)
* [CORDA-1008] - Samples fail to run due to wrongly configured max transaction size in the network bootstrapper

* address PR issues
2018-02-12 15:33:22 +00:00
Joel Dudley
ad7b84b5a8
Removes IdentityServiceInternal as a public parameter to MockServices. 2018-02-12 13:30:47 +00:00
Anthony Keenan
7b65b7971a
CORDA-939 - Don't expose StartedNode and AbstractNode as part of public test api (#2472)
* Don't expose StartedNode via Node Driver

* Dont expose StartedNode/Abstract Node via MockNetwork

* Remove internal var from constructor as it doesn't hide from public api and change to internal initialisation method

* Update api

* Rename MockNode to StartedMockNode to avoid confusion
Update documentation
Update api-current.txt

* Fix typo

* Fix test failure

* Modify flow tests to use internal mock network and remove additional internal exposures from StartedMockNode

* Fix api-current

* Change InProcess and OutOfProcess to interfaces

* Explicitly declare MockNetwork parameters
Dont expose StateMachineManager
Move affected tests to use internal mock network

* Fix api-current

* Changes requested via review

* Fix IRS Demo address

* Fix api

* Remove internal attribute from classes in internal package

* Remove accidentally added code

* Move useHttps into NodeHandleInternal

* Remove duplicated code

* Update api-current

* Make webAddress internal on NodeHandle

* Make sure parameters in public api are explicitly specified

* Use correct address in IRS Demo

* Get webaddress from webserver handle

* Update api-current
2018-02-12 10:09:59 +00:00
Andras Slemmer
d072f6c275
Merge pull request #2490 from corda/aslemmer-r3corda-compatibility
CORDA-995: r3corda wire compatibility
2018-02-09 17:12:18 +00:00
Andras Slemmer
0a88b76e46 r3corda wire compatibility 2018-02-09 14:50:20 +00:00
Patrick Kuo
c8cf46c657
CORDA-961 Wire up and enforce max transaction size (#2465)
* wire up and enforce max transaction size

* fixup after rebase
moved network parameter from AbstractNode to NodeProperties

* removed TODO

* fix broken import

* address PR issues

* remove API breaking change
address PR issue

* added max transaction size to driver and mock network.
address PR issues

* fix failing test

* added TODO

* fix verifier test

* fix spring driver build error
2018-02-09 14:48:45 +00:00
Anthony Keenan
4a68145f23
CORDA-939 Adding documentation changes requested from v3 release branch PR (#2480)
* Adding documentation changes requested from v3 release branch PR

* Further doc changes as requested
2018-02-08 14:38:15 +00:00
Katarzyna Streich
6acff3a7df
First approach to network parameters updates (#2412)
* Network parameters updates

Add two RPC methods networkParametersFeed and
acceptNewNetworkParameters. Implementation of client handling of network
parameters update event. Partial implementation of accepting new
parameters and installing them on the node as well as node startup with
updated parameters.

Move reading of network parameters on startup to separate
NetworkParametersReader class. Add tests.

Move NetworkParameters and NotaryInfo classes to core.

* Ignore evolvability test - to be fixed later

* Add documentation on update process
2018-02-08 14:31:43 +00:00
Anthony Keenan
8081ee42ad
CORDA-939 - Dont expose FlowStateMachine via public API (#2438)
* Create CordaInternal attribute for properties on public classes that are not part of the api and apply to FlowLogic.stateMachine

* Remove startFlow from public test api and replace with startFlowAndReturnFuture

* Update api-current with changed signature

* Change test used in documentation to use public test methods

* Remove the rest of the unneccessary usages of the startFlow test utility

* Remove extra whitespace

* Rename startFlowAndReturnFuture back to startFlow

* Update api

* The annotation doesn't appear unless its marked as on the actual getter and setter

* Updated docs and removed pointless attribute

* Deleted whitespace
2018-02-07 11:55:06 +00:00
Michele Sollecito
3b5d89883d
Added basic node configuration validation. (#2433) 2018-02-05 18:17:54 +00:00
Mike Hearn
82ece34ac8
Tweak the way invocation context is integrated to reduce the pain for devs using the old API (#2447)
Minor tweaks to the invocation context code.

1) Un-deprecate FlowInitiator, move the deprecation to the field. This
   eliminates large numbers of warnings and means developers are warned
   only once in the place where they obtain one.

2) Add documentation for StateMachineInfo and create a type alias to give
   it a better name in an ABI compatible way.

3) Improve markup on InvocationContext

4) Rename field from just "context" to "invocationContext" (Context is vague)
2018-02-02 17:09:08 +01:00
Anthony Keenan
0c93f1d4b1
Remove exposure of internal hibernate configuration from mockservices (#2442) 2018-02-01 10:31:11 +00:00
Patrick Kuo
93054a9590
Add cmdline option for network root truststore and password (#2407)
* add cmdline option for network root truststore and password, instead of using node's truststore configuration to avoid confusion.

* revert line auto format

* fix failing integration test

* address PR issue
2018-01-29 13:43:16 +00:00
Matthew Nesbit
0ff9c9e2e3
Move to message based bridge control protocol (#2410)
Tidy up

Remove dead RPCSecurity logic from ArtemisMessageServer

Address PR comments

Address PR comments
2018-01-25 17:53:34 +00:00
Mike Hearn
17a6f61eba
Simplify CashTests and add some comments/convenience APIs to MockServices (#2241) 2018-01-25 16:29:26 +01:00
Michele Sollecito
9783f11ba8
Exposed RPC SSL settings through Cordformation (#2419) 2018-01-25 14:32:58 +00:00
Ben Wyeth
d17670c747 Provide an API to register callback on app shutdown (#2402)
Provide an API to register callback on app shutdown.
2018-01-24 16:19:24 +01:00
Michele Sollecito
3c0e006456
Reverted incorrect additional advertised RPC address in NodeInfo (#2417) 2018-01-24 14:42:07 +00:00
Shams Asari
61c7de22d6
Replaced KeyStoreWrapper with X509KeyStore, which is still a wrapper but assumes only X509 certs and has better APIs (#2411) 2018-01-24 07:51:55 +00:00
Michele Sollecito
142f52fa82
[CORDA:936]: Enable RPC layer to work with SSL 2018-01-23 16:23:37 +00:00
Andrzej Cichocki
1fc646cfa8 CORDA-716 Move test-utils and node-driver to stable API section in docs (#2335)
* Move test-utils and node-driver to stable section.

* Move FlowStackSnapshotFactory to testing.services package & update docs

* Move SerializationTestHelpers to testing.core package

* Move TestConstants.kt to core namespace

* Move Expect.kt to core namespace

* Move CoreTestUtils to core.TestUtils - rename class and update imports

* Added some clarification to documents after re-reading them

* Added static imports

* Removing unused import

* Fix merge conflict

* Fixing merge conflict
2018-01-22 11:28:41 +00:00
Andrzej Cichocki
d00438b86f
Fix MockNetwork non-daemon thread leak. (#2397) 2018-01-22 11:00:40 +00:00
Mike Hearn
ac7637e2b4 Revert "CORDA-599 RPCSecurityManager is no longer lateinit (#2347)"
This reverts commit 75e74e67a1.
2018-01-19 17:52:59 +01:00
Anthony Keenan
35f89e03ea
Abstract InMemoryMessaging behind an interface so as not expose net.corda.nodeapi.internal.persistence.CordaPersistence in public API (#2390) 2018-01-19 10:57:08 +00:00
Shams Asari
d19eb4a9d7
Removed useHTTPS from NodeConfiguration as it's not needed by the node. (#2375)
It's still expected to be present in node.conf if the web server needs to use SSL.
2018-01-17 17:47:40 +00:00
Anthony Keenan
1367cd4adb
CORDA-912 Stop exposing internal node user, create user in testing infrastructu… (#2361)
* Stop exposing internal node user, create user in testing infrastructure instead

* Update kdocs
2018-01-15 19:30:33 +00:00
Andrzej Cichocki
75e74e67a1
CORDA-599 RPCSecurityManager is no longer lateinit (#2347) 2018-01-15 19:11:00 +00:00
Andrius Dagys
fb1d3087de Raft notaries can share a single key pair for the service identity (in contrast to a shared composite public key, and individual signing key pairs). This allows adjusting the cluster size on the fly. 2018-01-13 16:36:41 +00:00
Andrius Dagys
89b64da12b Increase shutdown action timeout. In some tests using driver, the shutdown
can be invoked before the notary node gets started, and the node disposal action
times out, leading to unclosed message brokers and port conflicts.
2018-01-12 18:19:02 +00:00
Shams Asari
bbfbb08c43
CORDA-881: Signed network parameters has the network map cert attached to it instead of just the public key. (#2346)
Introduced DigitalSignatureWithCert and SignedDataWithCert as internal APIs, with the expectation that they will become public; renamed the network parameters end-point to network-parameters; updated the network-map.rst doc; and did some refactoring.
2018-01-12 07:59:08 +00:00
Anthony Keenan
979d7f2c63
ENT-1226 Improve Network client Error Handling (#2344)
* Improve Network client Error Handling

* Reformatted NetworkMapServer

* Removed line that is now redundant
2018-01-09 16:55:16 +00:00
Andrius Dagys
63e1bdaa94 Revert "Raft notaries can share a single key pair for the service identity (i… (#2269)"
This reverts commit 3e00676851.
2018-01-09 12:20:25 +00:00
Joel Dudley
46d88ed740
Adds JavaDocs for waitForAllNodesToFinish param 2018-01-09 11:56:48 +00:00
Andrius Dagys
3e00676851
Raft notaries can share a single key pair for the service identity (i… (#2269)
* Raft notaries can share a single key pair for the service identity (in contrast to a shared composite public key, and individual signing key pairs). This allows adjusting the cluster size on the fly.
2018-01-09 08:17:59 +00:00
Konstantinos Chalkias
48be562a2a
ECDSA entropyToKeyPair + no idempotent signatures (#2210) 2018-01-04 17:52:31 +00:00
Andrzej Cichocki
8a3299fa2a
CORDA-716 Configure api scanner for test modules (#2259) 2018-01-04 10:09:04 +00:00
Shams Asari
d84105b60e
Using X509Certificate consistently throughout, rather than BC's X509CertificateHolder. (#2305)
The later is now only used where needed. This has reduced the amount of converting we have to do back and forth.
2018-01-03 22:00:39 +00:00
Shams Asari
730fec2eb4
Internal driver now also does the registration for the notaries. (#2304)
Using the --just-generate-node-info flag for the notary nodes so that their identities can be submitted to the network map server, which does the network parameters generation.
2018-01-02 15:12:30 +00:00
Shams Asari
4a2f157118
Validating the entire cert path in node registration, rather just checking the root cert. (#2298)
Also reduced duplicate code when creating the node CA cert path for testing, and renamed IdentityGenerator to DevIdentityGenerator.
2017-12-29 14:38:30 +00:00
Shams Asari
39d25958e2
Fixed identity generation of single node notaries as used by the driver and MockNetwork. (#2296)
The identity cert generated used to be of type SERVICE_IDENTITY when it should have been a LEGAL_IDENTITY.
2017-12-28 15:32:09 +00:00
Alberto Arri
6db0490750
Fix node integration tests. (#2233)
* Add tests for node registration and communication
2017-12-21 11:48:00 +00:00
josecoll
a2d14bd20d
Exclude jolokia packages from Quasar instrumentation. (#2279) 2017-12-21 11:06:44 +00:00
Shams Asari
e1e715ee81 Removed all remaining special treatment of the X500 common name.
With network parameters the CN is no longer needed to identify notaries. This frees it up to be used in the node's name alongside the other attributes.

Also, the identity generation logic has been simplified, removing the need to have magic string values for storing distributed identities in the keystore. Now there are just two alias prefixes: "identity" as it was previously, and "distributed-notary".
2017-12-18 21:39:11 +00:00
Andrzej Cichocki
f7445a5e6a
CORDA-876 MockNetwork no longer leaks serialization env if init fails (#2272) 2017-12-18 17:09:24 +00:00
Shams Asari
00a5e3db6b CORDA-830 Introducing the network bootstrapper
Copying of the node-info files moved out of Cordform and into NetworkParametersGenerator (which is now called NetworkBootstrapper). This class becomes an external tool to enable deployment of nodes in a test setup on a single filesystem.
2017-12-17 23:49:57 +00:00
Shams Asari
e9cead9055 CORDA-833: SignedNodeInfo object for holding a list of signatures, one for each identity in the NodeInfo. This forms part of the network map. 2017-12-17 19:45:58 +00:00
Andrzej Cichocki
8114a20abd
CORDA-716 Move non-API things to internal (#2256) 2017-12-17 18:44:35 +00:00
Andrzej Cichocki
2652ae111a
CORDA-716 Devrel feedback (#2266)
* * Document TestIdentity entropy and enforce that it actually works
* Ledger/transaction DSL default notary with fresh key
* MockServices default identity with fresh key
* makeTestIdentityService now takes vararg
* Require cordappPackages for MockServices
* DSL automatic serialization init
* Improve error when two MockNetworks used

* * Make cordappPackages required by MockNetwork
* Default identity service in MockServices
* Make notarySpecs Java-friendly
2017-12-15 19:18:31 +00:00
Matthew Nesbit
595d41af04
AMQP Bridging between nodes (#2181)
* Able to send hand coded messages to an Artemis node inbox

Get startup race condition fixed. Start cleanup work.

Fixup after rebase

Remove SASL hack for now

Minor tweaks. Enable AMQP mode manually.

Add configuration control

Slight clean up

Stop timeouts that don't work with AMQP

Rename class

Get TLS constants from :node-api

Primitive integration test

Put back commented line

Session per bridge to alow rollback on remote rejects.

Add more tests and handle multiple IP adddresses

Reduce logging

Fixup after rebase

Add a test to verify the remote end AMQP rejection logic works and does cause message replay.

Allow Artemis to duplicate after session rollback

Reduce number of threads

Move legacy bridge related code over to CoreBridgeManager

Shared threadpool for bridges

Add a test to confirm that no side effects when using a shared thread pool.

Address PR comments and remove dead lines

Rebase and add some comments

Remove a couple of blank lines

Ensure AMQP bridges are used in tests

Fixup after removal of testNodeConfiguration

Add a couple of doc comments

Add a couple of doc comments

Make things internal and use CordaFuture

Address some PR comments

Change comment type

* Use Artemis 2.2 to fix AMQP problems. Add explicit test of legacy core bridges, as marking the factory class private had silently broken them.

* Fix change due to using Artemis 2.2
2017-12-15 17:48:33 +00:00
Katarzyna Streich
02ad2b8b60
Fix LargeTransactionTest (#2265) 2017-12-15 16:53:57 +00:00
Andrzej Cichocki
479a656484
CORDA-716 Consistent MockServices API (#2247)
* Consistent MockServices API.

* Fix compile error.
2017-12-15 13:15:05 +00:00
Katarzyna Streich
550469ea38
Wire part of network parameters (#2187)
* Take maximum message size from network parameters

* Add epoch handling

* Add handling of network parameters mismatch

Change NetworkMapClient and updater, add handle in
AbstractNode that results in node shutdown on parameters mismatch. Later
on we should implement proper handling of parameters updates.
Add tests of NetworkParameters wiring.

When node starts with compatibilityZone url configured it takes
networkParameters from the networkMap.

* Permit only one network parameters file

On node startup network parameters are read from node's base directory,
we permit only zero or one files to be there. If network map server is
configured the parameters can be downloaded at startup (if not present
in the directory already).

* Update docs on network map endpoints
2017-12-15 11:13:15 +00:00
Tommy Lillehagen
90f6cd1fe7
Merge pull request #2252 from corda/tlil/ENT-1249/downgrade-artemis-2.2
ENT-1249 - Downgrade Artemis from v2.4 to v2.1
2017-12-15 07:01:13 +00:00
Tommy Lillehagen
5e60aa1c55 ENT-1249 - Downgrade to version 2.1 instead 2017-12-14 16:01:47 +00:00
Shams Asari
70b6944c96
Merge pull request #2074 from corda/mkit-add-test-comment
Adding comment to test
2017-12-14 11:40:35 +00:00
Shams Asari
2319bf396c Renamed TestIdentity.key to keyPair and pubkey to publicKey (#2249) 2017-12-14 11:30:55 +00:00
Michal Kit
f3253b4644 Adding comment to test 2017-12-14 10:48:38 +00:00
Tommy Lillehagen
4ad7b2325e ENT-1249 - Downgrade to Artemis 2.2 to protect against rouge connections causing OOM 2017-12-14 09:47:57 +00:00
Andrzej Cichocki
d1ea881aef
Inline testNodeConfiguration. (#2238) 2017-12-13 16:18:42 +00:00