Commit Graph

1544 Commits

Author SHA1 Message Date
Andrzej Cichocki
32ea59d085
Inline some DUMMY constants. (#2200) 2017-12-08 10:45:22 +00:00
Katelyn Baker
8878fa99a0 CORDA-553 - Remove CordaCustomSerializer annotation
It isn't actually needed as we can scan the jar for classes implementing
the interface.
2017-12-07 21:15:33 +00:00
Katelyn Baker
fcec60e232 CORDA-786 - Use reflection to infer proxy and proxied types in CorDapp custom serializers
This removes any need for the user implement and override types from the
super class

    * CORDA-786 - Docs update
    * CORDA-786 - Remove unneeded second annotation on the proxy objects
    * Fix merge conflicts
2017-12-07 21:15:14 +00:00
Katelyn Baker
d25b7f560c CORDA-786 - Genericise the CorDapp Proxy 2017-12-07 21:15:14 +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
Ross Nicoll
ce859178eb
Correct identities passed to generateSpend (#2199)
Pass well known identities instead of confidential into `generateSpend()`
2017-12-07 18:12:25 +00:00
Andrzej Cichocki
c36bea3af5
CORDA-654 MockServices no longer has hard-coded identities (#2192)
* Resurrect a test
* Fix a broken test
* Pass in the initial identity
* Make IdentityService easier to mock
2017-12-07 11:55:18 +00:00
Shams Asari
cb11379d98 Addressing some of the technical debt 2017-12-06 22:01:41 +00:00
Alberto Arri
eb3b816d90
Rename NetworkisRegistrationHelperTest to NetworkRegistrationHelperTest (#2185) 2017-12-06 14:36:09 +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
Andrzej Cichocki
b0ebf3d7e0
CORDA-654 Various MockServices refactorings (#2167)
* Remove MockServices.stateMachineRecordedTransactionMapping which does nothing
* Inline StateLoaderImpl
* Remove unused MockServices
* MockServices well-known identities not needed in a place
* A few things don't need a full-blown ServiceHub
2017-12-05 16:22:53 +00:00
Andrzej Cichocki
e4d76204c1
Pass some key constants into MockServices. (#2173) 2017-12-05 14:50:56 +00:00
Alberto Arri
b6427a3128
remove calls to exitnodes from NodeStartup (#2080) 2017-12-04 15:44:18 +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
Andrzej Cichocki
d2f66acff7
Use non-static Rx pool when testing. (#2165) 2017-12-04 12:41:43 +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
Katarzyna Streich
6958cbbc44
Fix demobench as part of network parameters work (#2148)
* Fix demobench - network parameters

Demobench uses ServiceIdentityGenerator to pregenerate notary identity
for network parameters.
2017-12-01 16:14:03 +00:00
Andrzej Cichocki
15f677a2fb
Make rigorousMock callRealMethod by default for concrete methods. (#2159) 2017-12-01 10:10:27 +00:00
Shams Asari
c2731c6797 More merge fixes and moved NodesInfoFilesCopier into internal package 2017-11-30 16:46:32 +00:00
Andrzej Cichocki
10e686bc82
Inline DriverConstants. (#2156) 2017-11-30 16:28:58 +00:00
Andrzej Cichocki
a314a6a125
CORDA-654 Simplify TransactionDSL API (#2152) 2017-11-30 16:28:44 +00:00
igor nitto
0db7dce985
Dynamic registration of RPC users security roles in ArtemisMessagingS… (#2140)
Dynamic registration of RPC users security roles in ArtemisMessagingServer [ENT-1000]
2017-11-30 15:06:53 +00:00
Shams Asari
fdc31091a6 Merge branch 'feature-network-parameters' into shams-master-merge-291117
# Conflicts:
#	constants.properties
#	gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordform.kt
#	gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Node.kt
2017-11-30 12:05:42 +00:00
Katarzyna Streich
c9f3e98795
Another approach to fixing deployNodes task and network parameters generation (#2066)
* Generate networkParameteres for Cordformation.

Fix deployNodes task in Cordformation to generate NetworkParameters before running the nodes.
Add TestNetworkParametersGenerator utility loaded after node infos generation step.

* Get rid of bouncy castle provider dependency
For cordform-common. It caused problems with loading our custom
X509EdDSAEngine for generation of network parameters in deployNodes
task.
2017-11-30 10:39:29 +00:00
Shams Asari
71763ff1d3 Merge branch 'master' into shams-master-merge-291117
# Conflicts:
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/services/network/PersistentNetworkMapCache.kt
#	node/src/test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTests.kt
#	samples/notary-demo/src/main/kotlin/net/corda/notarydemo/BFTNotaryCordform.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/demorun/DemoRunner.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt
2017-11-29 18:00:16 +00:00
Shams Asari
286ff65e60
Merge pull request #2147 from corda/shams-doorman-node-persistence-deps
Moved CordaPersistence and dependent classes into internal package in…
2017-11-29 17:51:35 +00:00
Andrzej Cichocki
3c31fdf31d
CORDA-806 Remove initialiseSerialization from rpcDriver (#2084)
and fix a leak or two
2017-11-29 17:42:39 +00:00
Shams Asari
b638b30d2a Moved CordaPersistence and dependent classes into internal package in node-api. This is so that the doorman can make use of them without needing a compile dependency to node. 2017-11-29 17:14:05 +00:00
Patrick Kuo
572c4af40c
Use NetworkMap and SignedNetworkMap in NetworkMapClient, and enable signature verification. (#2054)
* new network map object for network map, and verify signature and root in Signed network map and node info

* fixup after rebase

* * added certificate and key to network map server
* move DigitalSignature.WithCert back to NetworkMap.kt, as its breaking API test, will raise another PR to move it back.
* Make DigitalSignature.WithCert not extend WithKey, as per PR discussion.
* various fixes after rebase.

* move Network map back to core/node, as its breaking API test

* revert unintended changes

* move network map objects to node-api
2017-11-29 15:55:13 +00:00
Shams Asari
5c53a91785 Overhaul of the Bank of Corda demo to fix two problems it had:
1. The runRPCCashIssue and runWebCashIssue gradle tasks didn't work because they were using the wrong ports
2. Notary lookup was failing because the lookup name didn't include the correct CN for the notary name (this slipped through when reverting the network parameters)

The ports change occurred in #1922 which was attempting the fix the runIssuer gradle task. This is actually a misleading and redundant task as all it does is start up the nodes, which is what the documented deployNodes already does. The ports runIssuer allocated to the nodes were different to the ones specified in deployNodes.

To make sure we have integration tests which closely match deployNodes, the BoC demo has been updated to make use of CordformDefinition. This keeps the node definitions in one place, removing the need to have disparate files in sync. runIssuer has been removed.
2017-11-29 14:48:05 +00:00
Andrzej Cichocki
b45d9e957b
CORDA-654 Pass key constants into VaultFiller (#2118) 2017-11-29 12:51:01 +00:00
Andrzej Cichocki
dbe2dca7b9
CORDA-654 Make VaultFiller a class so I can change its hardcoded bits (#2141) 2017-11-29 09:49:34 +00:00
Michele Sollecito
cb1fa2e017
Corda now works with H2 without the need to allow Hibernate to create the database automatically. (#2124)
[CORDA-815]: Corda now instructs Hibernate to either adjust or validate the schema based on `devMode` property.

Also renamed property `database.initDatabase` to `database.createSchemaAutomatically`.

* [CORDA-815]: Renamed database.initDatabase to database.adjustSchemas.

* Code review changes: removed property `database.initDatabase` altogether.

* Code review changes: removed property `database.initDatabase` altogether.

* Code review changes: removed property `database.initDatabase` altogether.

* Code review changes: removed property `database.initDatabase` altogether.
2017-11-28 17:33:02 +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
Andrzej Cichocki
ff9e7474b1
CORDA-654 Make MOCK_IDENTITIES less special (#2114)
* Make rigorousMock usable from Java
* Show args in mock failure message
2017-11-28 11:35:59 +00:00
bpaunescu
614779d4ec
ENT-1128 fix node restarts when using AzureSQLServer (#2139) 2017-11-28 10:32:30 +00:00
Andrzej Cichocki
4bd6fef0f9
StateMachineManager is no longer lateinit. (#2123) 2017-11-27 17:55:08 +00:00
Shams Asari
9fefabbb88 Merge branch 'master' into shams-master-merge-271117 2017-11-27 17:08:13 +00:00
Shams Asari
4ca54b73fe Added tests to make sure the platform version is correctly available 2017-11-27 17:04:19 +00:00
Shams Asari
2ceb6283af Moved X509Utilities, and some other crypto utilities in node, into node-api so that they can be used by services outside of the node.
There's also some cleanup as well.
2017-11-27 15:49:33 +00:00
Shams Asari
1705df4d1f Made the database config option typesafe, rather than relying on String properties 2017-11-27 13:51:53 +00:00
Andrzej Cichocki
449155cea3
IdentityService is no longer obtained lazily. (#2130) 2017-11-27 12:34:33 +00:00
Maksymilian Pawlak
ce9b6c1f18
CORDA-311-post PR merged fixes (#2106)
* SSH server integration
2017-11-23 16:34:57 +00:00
Konstantinos Chalkias
502d0df630
Mutual TLS auth - mixed RSA and ECDSA keys (#2095) 2017-11-23 16:07:08 +00:00
Shams Asari
9097107d2e Revert "Revert "Introducing network parameters.""
This reverts commit 953a4a3790.
2017-11-21 15:05:24 +00:00
Andrzej Cichocki
288eb5fcc4
CORDA-716 Call stop on InMemoryMessagingNetwork (#2077)
* Inline code used by only 1 test
* Remove superfluous interface
* Warnings crusade
* Inline Builder, remove unused method
* Remove stop from interface
* Register stops up-front
2017-11-21 12:49:21 +00:00
bpaunescu
15dbbb2de9
remove NodeState and nodeStateObservable remnants (#2102) 2017-11-21 12:03:51 +00:00
szymonsztuka
ad9f335dde
Consistent database columns naming convention. (#2097) 2017-11-21 09:57:38 +00:00
bpaunescu
c467a056ae
Revert CORDA-296: added rpc that returns an observable for node state (#2091)
* Revert "CORDA-296: added rpc that returns an observable for node state (#2004)"

This reverts commit 7d1f7ab

* Revert "CORDA-296: added rpc that returns an observable for node state (#2004)"

This reverts commit 7d1f7ab
2017-11-21 09:52:17 +00:00
Maksymilian Pawlak
e63b6d1386
CORDA-311 Shell via SSH server (#2087)
* SSH server integration
2017-11-20 17:41:38 +00:00
Rick Parker
6a2c170b82
Additional index to vault_states table to stop a table scan. (#2093) 2017-11-20 16:49:17 +00:00
Richard Green
d84e9aab7b Added exception if same attachment uploaded. Added test 2017-11-20 16:41:41 +00:00
Andrzej Cichocki
f26aa33553
Introduce contextLogger (#2085)
* Revert with comment, probably lazy for a reason.
2017-11-20 11:31:08 +00:00
Alberto Arri
273965f17a
remove cordacon code (#2082) 2017-11-20 11:24:19 +00:00
Mike Hearn
49cdad58c7 Minor: Add a brief comment to the RPC role setup code that explains the security justification for it. 2017-11-20 11:54:23 +01:00
Andrzej Cichocki
55e4688cc5
CORDA-787 Split NodeMessagingClient into 3 (#2063) 2017-11-20 10:33:13 +00:00
Ross Nicoll
8e7165db41
CORDA-759: Enforce key checks on identity de-anonymisation (#1993)
Previously when de-anonymising a Party instance, the name of the Party was used rather than
the key, meaning a Party could be constructed with a random nonsense key and any name, and be treated as corresponding to the well known identity. This is not a security hole in itself as
in any real scenario a party shouldn't be trusted without having been registered, it creates
a significant risk of a security hole depending on how trusted the anonymous identity is, and
the returned identity is considered.
2017-11-17 18:13:35 +00:00
Ross Nicoll
1f98293377
Stabilise NodeStatePersistenceTests (#2079)
Pass notary identity into flow in `NodeStatePersistenceTests` rather than resolving it from the network map cache, which avoids a race condition between the flow starting and the notary registration being sent to the cache.
2017-11-17 18:13:10 +00:00
Tudor Malene
817748c87e
Performance improvement: cache app classloaders (#2060)
Cache results of the classpath scanning for cordapps
2017-11-17 15:35:05 +00:00
josecoll
f5c9fd8f44
Cross provider Issuer Reference database storage (#2032)
* consistent storage of Issuer Reference using `ByteArray` Kotlin type in Schema definition and a custom Hibernate Type to map this to a VARBINARY database type.
Creation of a new Issued type now also validates maximum size permissible (512).
2017-11-17 14:18:16 +00:00
Ross Nicoll
19aba62fc6
Move tests to using named identities (#1879)
Move tests to using named identities in preparation for multiple identities work. Includes:

* NetworkMapCacheTest
* NodeInterestRatesTest
* NodeVaultServiceTest
* ContractUpgradeFlowTest
* Cash tests
* AttachmentSerializationTest
* CordaRPCOpsImplTest
* VaultWithCashTest
* ScheduledFlowTests
2017-11-17 14:16:17 +00:00
Thomas Schroeter
9d6d027523
Merge pull request #2056 from thschroeter/raft-cluster-monitor-available-members
Raft notary cluster: metrics for available members
2017-11-17 13:14:25 +00:00
Andrzej Cichocki
aabc3c5b02
NodeInfo is no longer lateinit. (#2068) 2017-11-17 13:07:18 +00:00
Andrzej Cichocki
787de9d956
CORDA-716 Fix last of the test thread leaks (#2069)
* copycat servers/clients
* an SMM CheckpointChecker
* and log error rather than fail on propagation of stale inheritable thread local
2017-11-17 12:28:34 +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
Thomas Schroeter
3d87a1a735 RaftCluster metrics for available members 2017-11-17 12:00:19 +00:00
Shams Asari
953a4a3790 Revert "Introducing network parameters."
This reverts commit d04e487
2017-11-17 10:04:38 +00:00
Ross Nicoll
e4f5e16bf4
Clean up identities in tests, stage 1 (#2059)
* Clean up identities in CashTests so that the mini/mega corp keys and identities are correctly
paired together throughout. Previously `miniCorpServices` presented the same key as the
MegaCorp identity, but with the name Mini Corp attached.
* Correct key/name matches in VaultWithCashTest
* Split services in CashTests to not have multiple identities per service hub
2017-11-16 17:17:45 +00:00
Andrzej Cichocki
37b34c6fc1
Remove unused code. (#2071) 2017-11-16 17:01:46 +00:00
Andrzej Cichocki
55bcf295ee
Move class to the only place that uses it. (#2067) 2017-11-16 14:40:39 +00:00
josecoll
5bdbd2457a
Removal of transaction contract state as BLOB in VaultStates table. (#2034)
* Removal of transaction contract state as BLOB in VaultStates table.
Transaction contract state now resolved using StateLoader (from DBTransactionStorage).

Fixed broken JUnits.

* Changes to address review comments by RP

Address logic error.

* Fixed failing JUnit (CashExitFlowTests.exit zero cash).

* Fix VaultQueryTests to respect transaction visibility boundaries.

* Adopt consistent use of "session" using DatabaseTransactionManager.

* Removed redundant transaction demarcation boundaries in Vault Query tests.
2017-11-15 19:28:04 +00:00
szymonsztuka
b423fea537
Consistent database tables naming convention. (#2064)
* Added explicit table names (mostly for join tables).
* Shorten or alter name of 2 tables backing notaries.
* Change a compound index declaration to one column index.
2017-11-15 18:35:26 +00:00
Ross Nicoll
d78308f510
Detangle issuers in NodeVaultServiceTest (#2057)
Detangle issuers in NodeVaultServiceTest, which has been using two keys on a single node, for different
issuing identities, which doesn't work right now because we don't actually have multiple identity support.

Also remove duplicate data in parameters to fillWithSomeTestCash().
2017-11-15 15:26:17 +00:00
Rick Parker
7337996e08
Add config library and default config to webserver JAR (#2047)
* Add config library and default config to webserver JAR

* Applied Clinton's feedback to create a config rather than do filtering.
2017-11-15 15:03:15 +00:00
Michele Sollecito
92c8861802
[CORDA-760]: Propagate invocation context across the codebase. (#2016) 2017-11-15 14:58:43 +00:00
szymonsztuka
f0a5ea96e7
Consistent database columns naming convention. (#2043)
* Consistent database column naming convention.
* Remove a column length constraint in NodeAttachmentService.
2017-11-15 13:09:25 +00:00
Thomas Schroeter
419fe5063f
Merge pull request #2055 from thschroeter/thomas-store-raft-index
Store Raft commit index in DistributedImmutableMap
2017-11-15 11:40:00 +00:00
Andrzej Cichocki
b5fffa76f2
Retire a lateinit var. (#2038) 2017-11-15 11:24:27 +00:00
Andrzej Cichocki
c4a9320e70
CORDA-716 Don't allow the netty global executor to inherit serialization env holder (#2048)
and close some dangling RPC connections.
2017-11-15 11:22:35 +00:00
Thomas Schroeter
ecd09b7e6c Store raft commit index in DistributedImmutableMap 2017-11-15 10:52:22 +00:00
Thomas Schroeter
2577c75f28
Merge pull request #2046 from thschroeter/thomas-remove-snapshotting
CORDA-767: Raft Notary: remove snapshotting
2017-11-15 09:59:34 +00:00
Thomas Schroeter
fc8ed34205 Switch from compaction mode sequential to full
Full requires the command to be `closed` before it can be removed from
the log during compaction. We don't close commands, thus and retaining
the log forever, allowing users to increase the cluster size. The
downsize is the unbounded growth of the size of the log.

Cluster membership changes need testing.
2017-11-14 16:34:41 +00:00
Thomas Schroeter
0d2382619b Raft Notary: bootstrap command line flag 2017-11-14 13:51:21 +00:00
Patrick Kuo
64a9946f03
Replace artemis network map with http network map (#1970)
* Network map cache using Network map client instead of artemis. -- WIP

* fix up after rebase

* address PR issues, split network map update test, added todos to remove sleeps

* move jimfs and baseDir to field variable
2017-11-14 11:37:50 +00:00
szymonsztuka
3627cc9fc2
Vault query - return single column which groups multiple aggregation functions.
* Vault query was returning redundant selects (repeated column used to 'group by') for query with multiple aggregation functions.
2017-11-14 11:20:57 +00:00
Andrzej Cichocki
2d997b1fa7
Retire verifierDriver serialization init. (#2026) 2017-11-14 10:45:36 +00:00
Thomas Schroeter
b23e727685 Raft Notary: change compaction mode to sequential
Keep log until it has been applied to all replicas.
2017-11-14 10:39:16 +00:00
Thomas Schroeter
cf33be66ff Raft Notary: remove snapshotting 2017-11-14 10:39:16 +00:00
Maksymilian Pawlak
1a02c9a74f
AttachmentCriteriaQuery class and infrastructure (#2022)
* Attachments metadata support
2017-11-14 10:22:02 +00:00
Ross Nicoll
c583af8f4b
Add AbstractPartyDescriptor to stop Hibernate warning (#1878) 2017-11-13 18:04:38 +00:00
Andrzej Cichocki
b8b3911ceb
Fix the BFT startup consensus workaround. (#2042) 2017-11-13 15:45:26 +00:00
Ross Nicoll
076a8ab937
Step through cert path when registering (#2027)
Ensure when registering identities, we store the certificate closest to the trust root, with the same name. This ensures that looking up an identity by name produces the best match, not earliest registered identity (often but not necessarily the same).
2017-11-10 17:41:45 +00:00
Andrzej Cichocki
6a569fb3f1
Retire findTokenizableService. (#2036) 2017-11-10 16:40:18 +00:00
Andrzej Cichocki
052124bbe0
CORDA-716 Make serialization init less static (#1996) 2017-11-10 15:44:43 +00:00
Christian Sailer
2a83167d3b
Merge pull request #2024 from corda/christians_public-key-caching-hooks
Public key customization hooks
2017-11-10 13:37:37 +00:00
Christian Sailer
52dea9e5c3
Merge pull request #1958 from corda/christians_nodeconfig-fix
Add helper for checking whether to check checkpoints and unit test it.
2017-11-10 11:28:13 +00:00
Andrzej Cichocki
6b71c6cf75
Retire some initialiseSerialization booleans. (#2019) 2017-11-10 10:15:55 +00:00
Christian Sailer
219433c3cd Hooks for PublicKeySerializer 2017-11-09 14:49:23 +00:00