Commit Graph

109 Commits

Author SHA1 Message Date
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
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
Andrzej Cichocki
1902a4f11e
CORDA-973 Refactoring for serialization compression support (#2466)
* Use constant for empty byte array
* Less byte array copying
* Fix InputStreamSerializer trailing garbage
* More OO kryo streams
* Introduce SerializationMagic
* Introduce non-copying slice on ByteSequence
2018-02-09 11:54:07 +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
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
Alberto Arri
6db0490750
Fix node integration tests. (#2233)
* Add tests for node registration and communication
2017-12-21 11:48:00 +00:00
Andrzej Cichocki
c3b9955344
CORDA-716 Fix split packages in testing (#2232) 2017-12-12 19:37:01 +00:00
Andrzej Cichocki
905c8252a6
CORDA-654 Remaining key constants (#2226) 2017-12-12 18:03:06 +00:00
Shams Asari
6d6393d984 Merge branch 'feature-network-parameters' into shams-merge-feature-network-parameters 2017-12-11 21:10:34 +00:00
Katelyn Baker
4b5c60637c
Merge pull request #2017 from corda/kat/feature/enableAMQP
CORDA-780 - Enable AMQP for P2P and Storage Contexts
2017-12-11 11:37:16 +00:00
Shams Asari
249d8d1ac7 Further merge fixes 2017-12-11 10:42:50 +00:00
Shams Asari
d6054e4b4f Merge branch 'master' into shams-master-merge-081217
# Conflicts:
#	node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/DriverDSLImpl.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/RPCDriver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/demorun/DemoRunner.kt
#	verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt
2017-12-11 10:23:16 +00:00
Shams Asari
41bfd7a971 Merge fixes 2017-12-10 20:15:33 +00:00
josecoll
4762569200
CORDA-822 - JMX Jolokia instrumentation (#2197)
* JMX Jolokia instrumentation WIP (driverDSL, webserver, cordformation, hibernate statistics, access policy config file hardening)

* Cordformation changes to support jolokia agent instrumentation at JVM startup.

* Minor updates to reflect usage of Jolokia 1.3.7 (which uses slightly different .war naming)

* Use relative path reference in -javaagent to prevent problem with long path names with spaces.

* Fixed incorrect regex pattern and added assertion to test.

* Enable JMX monitoring.

* Reporting of Hibernate JMX statistics is configurable (by default, only switched on in devMode)

* Make Artemis JMX enablement configurable.

* Re-instate banning of java serialization.

* Improve JUnit.

* Fixes following rebase from master.

* Re-instated correct regex for picking up Jolokia agent jar.

* Fixed broken integration test.

* Updated documentation

* Updated following PR review feedback.

* Fixed compilation error caused by change in DriverDSL argument type.

* Fixed compilation error caused by change in DriverDSL argument type.

* Fail fast if jolokia-agent-jvm.jar is not located.

* Applied changes in cordformation following review feedback from CA.
2017-12-08 16:27:12 +00:00
Shams Asari
65ff931f53 Merge branch 'master' into shams-master-merge-081217
# Conflicts:
#	node-api/src/main/kotlin/net/corda/nodeapi/internal/crypto/KeyStoreWrapper.kt
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/services/config/ConfigUtilities.kt
#	node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt
#	node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt
#	samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt
#	testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/DriverDSL.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/DriverDSLImpl.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/NodeBasedTest.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/RPCDriver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/demorun/DemoRunner.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/CoreTestUtils.kt
#	verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt
2017-12-08 16:03:16 +00:00
Shams Asari
db9eb8a63f Preliminary work to make merge with master manageable 2017-12-08 13:39:05 +00:00
Katelyn Baker
81eb0c1898 CORDA-780 / CORDA-786 - Enable AMQP for P2P and Storage Contexts
Add plugable mechanism for CorDapps such that they can add their own
custom serializers
2017-12-07 21:13:59 +00:00
Shams Asari
89256a7f16 Moved the CZ URL and node registration logic of the driver to be more internal, not available through the standard driver call, as these are not testing features for an app dev.
Also cleanup up some of the related tests.
2017-12-06 12:32:41 +00:00
Shams Asari
8461837f1a Cleaned up Driver.kt so that only the relevant bits are exposed as public API 2017-12-05 23:52:15 +00:00
Shams Asari
6a1aa59e3e Merge branch 'master' into shams-merge-master-041217
# Conflicts:
#	node/src/integration-test/kotlin/net/corda/node/services/DistributedServiceTests.kt
#	samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/BankOfCordaCordform.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/NodeTestUtils.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/NodeBasedTest.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/NotarySpec.kt
#	verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt
2017-12-04 13:39:32 +00:00
Alberto Arri
acd2281b20
ENT-1125 bootstrap root certificate (#2151)
* ENT-1125 make nodes check that the returned signed certificate from Doorman has the expected root
2017-12-04 12:53:22 +00:00
Shams Asari
5264072752 Renamed n.c.nodeapi.config to n.c.nodeapi.internal.config as that config code is not public API. For the same reason, also moved User into the same internal package. 2017-12-03 17:20:30 +00:00
Patrick Kuo
cc1fba641e
Integration test for http network map service (#2078)
* make node info file copying optional by setting "compatabilityZoneURL" in driver
integration test for node using http network map using driver
some bug fixes

* rebase to feature branch and fixup

* add initialRegistration flag to driver

* remove useFileBaseNetworkMap flag, add network map server to DriverTest

* remove useFileBaseNetworkMap flag, add network map server to DriverTest

* use PortAllocation.Incremental instead of random

* * use PortAllocation.Incremental instead of random
* fix NodeInfoWatcher thread leak issue

* reset scheduler before create notary

* move port allocation out of companion object

* move port allocation out of companion object

* make node info file copier lateinit to avoid observable thread pool get created on init
2017-11-28 13:58:48 +00:00
Shams Asari
5cf7ecd9ed Merge branch 'master' into feature-network-parameters
# Conflicts:
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
2017-11-21 15:01:52 +00:00
Alberto Arri
a13dbcaa5d
ENT-1069 Allow for nodes to be started in registration mode (#2065)
* ENT-1069 Allow for nodes to be started in registration mode
2017-11-21 09:59:56 +00:00
Andrzej Cichocki
f26aa33553
Introduce contextLogger (#2085)
* Revert with comment, probably lazy for a reason.
2017-11-20 11:31:08 +00:00
Andrzej Cichocki
039cacae76
CORDA-787 Remove unused class (#2049)
* and refactor a superclass that isn't really one
* move it to internal
* misc refactorings
2017-11-17 12:24:55 +00:00
Shams Asari
2fe41715cc On exit, the driver will automaticallly shutdown any nodes which weren't waited for.
The motivation for this came with the recent change that a default notary is started by the driver, which if ignored will leak the notary process.

Also, waitForAllNodesToFinish() has been replaced by a driver parameter.
2017-11-14 20:20:00 +00:00
Andrzej Cichocki
2d997b1fa7
Retire verifierDriver serialization init. (#2026) 2017-11-14 10:45:36 +00:00
Andrzej Cichocki
052124bbe0
CORDA-716 Make serialization init less static (#1996) 2017-11-10 15:44:43 +00:00
Shams Asari
e26e41a384 Various structural cleanups of node-driver:
* Extracted out ShutdownManager into its own file
* Moved RPCDriver and ProcessUtilities into internal package
* Made n.c.testing.performance package internal
2017-11-07 16:58:40 +00:00
Shams Asari
3bb018a5ce Removed the ability to manually start notary nodes from the driver and MockNetwork. Instead by default a single notary is automatically started. This can be customised at creation time of the driver and MockNetwork. This more accurately models the concept of network parameters in a CZ.
Also added helper methods to retrieve this default notary.
2017-11-05 22:55:33 +00:00
Shams Asari
d04e48740b Introducing network parameters.
network-parameters file read in by the node at startup, of which only the list of notaries is used. For now, the driver and MockNetwork have been updated to require notaries to be started first. This is so that the same set of network parameters can be defined for all the nodes.

CN in the legal name is not longer disallowed since it's no longer reserved for distributed notary names.

Single-node notaries now only have one identity, their main identity. Nodes part of a cluster continue to have two.

(Based off Kasia's work)
2017-11-03 09:46:10 +00:00
Alberto Arri
a21d361df8
Clean up mentions of nodeReady future and friends from MockNetwork/Driver (#1979)
* Clean up mentions of nodeReady future and friends from MockNetwork/Driver
2017-11-02 10:31:31 +00:00
Katelyn Baker
d6adb83cd0 CORDA-756 - Refactor Kryo into sub module as per AMQP 2017-10-31 15:45:58 +00:00
bpaunescu
04d8260e0f CORDA-351: force update dependencies and suppress vulnerabilities not… (#1944)
* CORDA-351: force update dependencies and suppress vulnerabilities not affecting corda

* CORDA-351: force update dependencies and suppress vulnerabilities not affecting corda
2017-10-26 12:16:57 +01:00
Alberto Arri
b33b013284 [CORDA-442] let Driver run without network map (#1890)
* [CORDA-442] let Driver run without network map

- Nodes started by driver run without a networkMapNode.

- Driver does not take a networkMapStartStrategy anymore

- a new parameter in the configuration "noNetworkMapServiceMode" allows for a node not to be a networkMapNode nor to connect to one.

- Driver now waits for each node to write its own NodeInfo file to disk and then copies it into each other node.

- When driver starts a node N, it waits for every node to be have N nodes in their network map.

Note: the code to copy around the NodeInfo files was already in DemoBench, the NodeInfoFilesCopier class was just moved from DemoBench into core (I'm very open to core not being the best place, please advise)
2017-10-18 13:49:32 +01:00
Viktor Kolomeyko
cac3057877 CORDA-540: Make Verifier work in AMQP mode (#1870) 2017-10-17 10:44:27 +01:00
Viktor Kolomeyko
99b509cb68 Attempting to make VerifierTests more stable (#1883)
* Attempting to make VerifierTests more stable

Main point: Alice node will always be faster to locate Alice by name than NotaryNode. Especially given that it may take some time
for Alice node to get reflected on the Notary's NetworkMap.

Also additional logging which might be helpful during debug and IntelliJ changed project structure reflection.

* Introduce a way for nodes to reliably learn about each other existence in the NetworkMap

Plus minor refactoring of the Driver code.
2017-10-16 09:16:40 +01:00
Ross Nicoll
327f0ebd73 CORDA-654: Migrate test APIs to match identity changes (#1744)
Rework identity usage in tests to extract identity from nodes by name, rather than just arbitrarily choosing the first identity. This better models the intended design for production (future work).
2017-10-11 18:26:09 +01:00
Tommy Lillehagen
3f3ffd50e1 Reformat files in verifier 2017-10-09 15:26:40 +01:00
Shams Asari
727cd0e55c Cleaned up notary configuration by introducing a notary config option.
extraAdvertisedServiceIds is no longer used for this.
2017-10-07 12:52:37 +01:00
Chris Rankin
248c898818 Instantiate Contract classes outside of LedgerTransaction.verify() (#1770)
* Load the contract classes when we create the LedgerTransaction.
* Fix Verifier tests by making ContractResult serialisable.
* Use named parameters to create ContractResult.
* Make the @JvmStatic function private.
* Refactor ContractResult to use Try.on{} instead.
2017-10-05 15:20:21 +01:00
Ross Nicoll
da82a0be40 CORDA-499: Dokka cleanup (#1575)
* Make functions in CompositeSignature static
* Make contract IDs constant
* Remove use of "e.g." which Dokka will take as end of the first sentence
* Move example onto function that it actually works with
* Change comment which refers to comment above it, without any linkage, to directly describe the function
* Move implementation notes out of Dokka comment
* Change contract IDs to constants in companion objects
2017-09-26 10:26:44 +01:00
Clinton
532bbb5cca Contract constraints (#1518)
* Contract constraints and attachment loading

Fix compiler warnings.

Fixed IdentitySyncFlowTests in confidential-identities.

Fixes.

Fix AttachmentClassLoaderTests.

Added a TODO.

Renamed cordapp service.

Fix compilation error in java code.

Fix RaftNotaryServiceTests

Fix AttachmentLoadingTest

Fix DistributedServiceTests and LargeTransactionTests.

Add cordapp packages to Verifier tests.

Refactor DummyContractBackdoor back out of internal package.

Resolve compiler warnings.

Consolidate excluding `isolated` project at top-level.

Fix contract attachment serialisation for remote verifier.

Fix integration tests for client:rpc.

Contract constraints and attachment loading

Fix compiler warnings.

Fixed IdentitySyncFlowTests in confidential-identities.

Fixes.

Fix AttachmentClassLoaderTests.

Added a TODO.

Renamed cordapp service.

Fix compilation error in java code.

Fix example compilation.

Fix RaftNotaryServiceTests

Fix AttachmentLoadingTest

Fix DistributedServiceTests and LargeTransactionTests.

Add cordapp packages to Verifier tests.

Refactor DummyContractBackdoor back out of internal package.

Resolve compiler warnings.

Consolidate excluding `isolated` project at top-level.

Fix integration tests for client:rpc.

Fixed issues with node driver and differing ZIPs.

Review changes.

Refactor GeneratedAttachment into node-api module.

Merge branch 'clint/hash-constraint' of https://github.com/corda/corda into clint/hash-constraint

Fixed compile error following rebase.

wip - test to check that app code isn't loaded from attachments sent over the wire.

Use Kotlin copyTo() rather than Apache's IOUtils.

Fixes

more fixes.

Removing unconstrained output.

More fixes.

Fixed another test.

Added missing plugin definition in net.corda.core.node.CordaPluginRegistry: net.corda.finance.contracts.isolated.IsolatedPlugin

Re-added missing magic string used in unit test.

Remove unused FlowSession variable.

* Review fixes.

* More review fixes.

* Moved Cordapp implementation to an internal package.

* More JVMOverloads.
2017-09-25 17:05:18 +01:00
Shams Asari
a11577840c Moved ServiceInfo and ServiceType into internal package (#1599) 2017-09-22 10:15:03 +01:00
Andras Slemmer
33421bdd44 CORDA-577: FlowSession porting (#1530)
* Throw exception if a flow is initiated twice for the same Party

* Chunk of porting

* Need ReceiveTransactionFlow

(cherry picked from commit 774383e)

* Notaries compile

* TwoPartyTrade

* SimmFlow & StateRevisionFlow

(cherry picked from commit da602b1)

* TwoPArtyDealFlow regulator send

* installCoreFlow

* IRSTradeFlow
UpdateBusinessDayFlow
RatesFixFlow
NodeInterestRates

(cherry picked from commit 6c8d314)

* Added recordTransaction parameter to ReceiveTransactionFlow

* Some Tests, Flows

* Fixed typo in record tx param

* more things

* Fix CollectSignatures

* FlowFrameworkTests

(cherry picked from commit 2c50bc3)

* Fix TwoPartyTradeFlow

* CustomVaultQuery

(cherry picked from commit 48f88e8)

* FlowsInJavaTest

* WorkflowTransactionBuildTutorial

* PersistentNetworkMapCacheTest

* FlowCookBookJava

(cherry picked from commit 9b48114)

* Fix RatesFixFlow

* Fix TwoPartyDealFlow to get signature of initiating side

* Integration tests

(cherry picked from commit dbcd965)

* CordappSmokeTest

(cherry picked from commit d19cbd6)

* Inlined FinalityFlow

* Updated uses of FinalityFlow

* ContractUpgradeFlowTest passes

* CollectSignaturesFlow refactor

(cherry picked from commit 5e7b1a7)

* Check that we are not the recipient of cash

* Fix Simm demo

* WorkflowTransactionBuildTutorialTest

* Fix CashPaymentFlowTests

* ScheduledFlowTests

* FlowFrameworkTests

* Add cordappPackagesToScan Driver param

* FinalityFlowTests

* Fix LoaderTestFlow

* NodeMonitorModelTest

* BankOfCordaRPCClientTest

* rename to extraCordappPackagesToScan

* Fixed broken merge

* BankOfCordaHttpAPITest

* Fix CollectSignaturesFlow

* Fix annotation on DummyFlow to stop warning

* Fix TraderDemoTest

* Review feedback

* Doc improvements and minor changes

* Address some PR comments

* Looping regulators into the FinalityFlow broadcast rather than sending separately in TwoPartyDealFlow.

* Add Uninitiated FlowState

* Add test for double initiateFlow exception

* Some more s&r victims

* FlowSession utilities (#1562)

* Merge fix

* CollectSignatureFlow can handle several signing keys

* Actually handle several signing keys

* update kdoc

* Correct SignTransactionFlow error message

* Create deprecated flows package

* Add internal deprecated flows

* Reverted FinalityFlow to auto-broadcast all tx participants

* Move the deprecated packages into another PR
2017-09-21 12:12:25 +01:00
Katarzyna Streich
fd57cf1c0c Remove advertised services from NodeInfo (#1521)
* Remove advertisedServices from NodeInfo.

Introduce notaryIdentities in NetworkMapCache, that will be filled in
later from NetworkParameters. Clean up NetworkMapCache API. Expose
notaryIdentities through RPC. For now we assume as temporary solution
that notaries in NetworkMap have to contain "notary" in name.

* Further clean up of NetworkMapCache API

Remve partyNodes. Introduce getAllNodeInfos function

* Remove notaryIdentity from ServiceHub

* Address Shams review comments

* Address Andrius review comments

* Add comments, cleanup

* Fixes

* Address comments

* Yet another commit with comments addressed

* Move ServiceType and ServiceInfo to node-api

Add changelog entry. Address rest of comments.

* Minor comments
2017-09-20 13:19:57 +01:00
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
Ross Nicoll
de3468f8a7 Replace X500Name with CordaX500Name (#1447)
Replace X500Name with CordaX500Name, which enforces the specific constraints Corda expects on legal/service identity names.
2017-09-12 01:03:10 +01:00