Commit Graph

1207 Commits

Author SHA1 Message Date
Michal Kit
66d6c2b44e Extending NetwokMapCache with a convenience method for by type service retrieval 2017-07-27 16:12:13 +01:00
Andrius Dagys
4487408526 Refactor notary change mechanism (#1019)
* Introduce new NotaryChangeWireTransaction (similar to WireTransaction and NotaryChangeTransaction (similar to LedgerTransaction) types.

Remove 'mustSign' and 'signers' fields from transactions

Deprecate the TransactionType concept. When receiving a SignedTransaction, the verification and signature checking branches out for regular and notary change transactions.

Add custom handling logic for notary change transactions to the vault
2017-07-27 08:32:33 +01:00
Andrzej Cichocki
25be649f7b Workaround BFT bug that causes redundant replicas to get stuck in startup (#1100) 2017-07-26 19:41:29 +01:00
Mike Hearn
a9a50ce8f3 Add generics to Vault.Update 2017-07-26 18:30:59 +02:00
Matthew Nesbit
b4ca0cdde9 Remove getCashBalances first part
More removal of getCashBalances

Get rid of duplicated code

Move onto new getCashBalance extension methods

Move onto new getCashBalance extension methods

Correct balance query code

Address PR request comments

Address PR request comments

Address PR request comments
2017-07-26 15:00:03 +01:00
Andrzej Cichocki
dca2274bff Retire setup, and start return value. (#1101) 2017-07-25 12:42:02 +01:00
Shams Asari
407b467f67 Moved the majority of the contents of Utils.kt into either InternalUtils.kt or KotlinUtils.kt.
What remains is being dealt with in another PR.
2017-07-24 19:25:56 +01:00
Shams Asari
800f710fbb Generified Command so that it's more easier to use when querying from LedgerTransaction 2017-07-24 15:33:41 +01:00
Andrius Dagys
d2eb5507f9 Refactor transaction serialization caching (#1078)
* Cache deserialized rather than serialized WireTransaction. Prevent repeated deserialization when adding signatures to the SignedTransaction.

* Added a test to check that stx copying and signature collection still works properly after (de)serialization
2017-07-24 14:48:39 +01:00
Shams Asari
3e199e51fc Simplified the implementation of the tx query APIs with the introduction of Class.castIfPossible 2017-07-21 19:18:48 +01:00
Shams Asari
a485bbada8 Moved ThreadBox into core.internal 2017-07-21 18:01:29 +01:00
Matthew Nesbit
9a02a27619 Add state query methods to LedgerTransaction.
Update to use LedgerTransaction api

Push query output logic onto BaseTransaction and update usages where possible

Migrate a few more uses

Address some PR comments

Address some PR comments

Fixup after rebase
2017-07-21 15:41:00 +01:00
Rick Parker
fe9db6f1f7 Remove links to Kryo from serialization "clients" (#1079) 2017-07-21 14:23:05 +01:00
Shams Asari
e702025f62 Cleaned up TimeWindow and added a bit more docs. 2017-07-20 13:43:11 +01:00
Patrick Kuo
0e0b99eaf0 * Remove Kryo from ServiceIdentityGenerator (#1083)
* Store encoded private, public and composite key to file instead of Party and Key using Kryo.
2017-07-19 16:34:56 +01:00
Ross Nicoll
9d3ad5fe06 Remove dummy cash issuer from two party trade flows
Switch to using a dedicated bank node in two party trade flows so that when KYC checks are enforced, all nodes on the network know who the issuer is.
2017-07-19 16:00:14 +01:00
Shams Asari
070f0c040e Moved a bunch of stuff which shouldn't be public out of core.utilities and into core.internal 2017-07-19 14:09:03 +01:00
Ross Nicoll
c4c551dbd2 Confidential identities API improvements
* Registering anonymous identities now takes in AnonymisedIdentity
* AnonymousParty.toString() now uses toStringShort() to match other toString() functions
* Add verifyAnonymousIdentity() function to verify without storing an identity
* Replace pathForAnonymous() with anonymousFromKey() which matches actual use-cases better
* Add unit test for fetching the anonymous identity from a key
* Update verifyAnonymousIdentity() function signature to match registerAnonymousIdentity()
* Rename AnonymisedIdentity to AnonymousPartyAndPath
* Remove certificate from AnonymousPartyAndPath as it's not actually used.
* Rename registerAnonymousIdentity() to verifyAndRegisterAnonymousIdentity()
2017-07-19 14:03:34 +01:00
Patrick Kuo
264b9316e3 Store notaries's identity composite key in keystore (#1036)
* * Store composite key in keystore from file for notaries's identity.
* Some refactoring.

* * Addressed PR issues

* * Remove unintended format changes

* * Fixed failing test due to getting keys from wrong keystore
2017-07-19 11:14:48 +01:00
Andrius Dagys
cb306a22fe Modify NodeVaultServiceTest to not access makeUpdate() directly 2017-07-18 17:38:45 +01:00
Ross Nicoll
f571aeb6a7 Remove createTwoNodes()
Remove `createTwoNodes()` from mock network as its behaviour is inconsistent with creating a set of nodes. `createSomeNodes()` is generally a better fit and creates a network map and notary, and registers all nodes. Where that's not the intention, it's acceptable to manually create each node.
2017-07-18 16:54:32 +01:00
Shams Asari
2778e294f3 FiberBox and RetryableException removed as they're not used 2017-07-18 15:14:35 +01:00
Shams Asari
b0c299707b Moved DeclaredField utility to internal and expanded its use 2017-07-18 14:33:09 +01:00
Clinton
0ccfae252f POMs generated by publishing are now correct. (#1055)
* POMs generated by publishing are now correct. The publish extension now requires an explicit call to configure the publishing instead of waiting until after evaluation. This prevents evaluation order issues with the artifact renaming code that causes the POM to have the original, incorrect, artifact names.

* Fixed new test compile issues caused by removal of some dependencies in test utils that caused webserver code to be automatically included in any project also compiling test utils.
2017-07-18 12:34:56 +01:00
Shams Asari
561a329064 Moved the various extension methods for creating Durations from Utils.kt to KotlinUtils.kt 2017-07-18 10:26:53 +01:00
josecoll
65ce5fec4b Fixed Vault Query over RPC using custom attributes. (#1066)
* Implemented Kryo custom serializers for Field and KProperty types.

* Adjusted KPropertySerializer to use kotlin member properties upon read() due to failing RPC tests.
Added additional Kotlin and Java tests (CordaRPCClient, StandaaloneCordaRPCClient)
Annotated schemas to be CordaSerializable (required when referencing as KProperty in custom queries).
Cleanup some outstanding compiler warnings.

* Added client RPC Java integration and smoke tests to build.

* Clean up compiler warnings in Java tests.

* Fixed incorrect assertion expectation.

* Backed out Field and KProperty custom serializers.

* Backed out Field and KProperty custom serializers.

* Store VaultQueryCustom custom column references as name and class (from Java Field and Kotlin KProperty1 types respectively).
Custom serialization of Field and KProperty type no longer required.

* Removed blank lines as per RP review comments.
2017-07-17 18:20:02 +01:00
Shams Asari
195189070a Moved the Path extension methods that were in Utils.kt into the internal package 2017-07-17 16:01:19 +01:00
Joel Dudley
b37c73827f Splits verifySigs into verifySigsExcept and verifyRequiredSigs to clarify usage. 2017-07-17 15:42:08 +01:00
Matthew Nesbit
7d1d5cc0f8 Merge pull request #1050 from corda/mnesbit-services-in-separate-files
Put Services.kt in separate files
2017-07-17 14:29:01 +01:00
Ross Nicoll
dfbf06a66d Flow cleanup
* Change "for who" to "for whom"
* Don't pass parties to FinalityFlow, it can derive them automatically
* Create a basket of nodes instead of individually assembling nodes
* Switch two party trade flow tests to generate a full anonymous identity
2017-07-17 10:24:20 +01:00
Matthew Nesbit
7a06d941c4 Put Services.kt in clear files, so that at a glance people can see what public services there are.
Fix include

Correct doc links after code movement
2017-07-17 09:34:07 +01:00
Andrius Dagys
7aafcf8c57 Prevent exception causes showing up as null in logs (#1018)
* Passing exception messages via constructor instead of overriding toString
2017-07-14 20:40:21 +01:00
Mike Hearn
a56540a3d6 Fix support for large attachments by de-batching tx/attachment fetch. This is a workaround until the upstream Artemis large message streaming bugs are fixed. 2017-07-14 18:21:33 +01:00
Shams Asari
ae01d658b6 Renamed FlowSessionException to UnexpectedFlowEndException 2017-07-14 15:14:54 +01:00
szymonsztuka
05327f3826 decouple Exposed (#1028)
Exposed library decoupled from transaction management and JDBC connection creation for Hibernate and ReQuery
2017-07-14 14:39:59 +01:00
Andrzej Cichocki
1996c39b9a Disable the BFT tests. (#1051) 2017-07-14 14:06:59 +01:00
Shams Asari
a49baddd4b Moved KeyStoreUtilities out of core and into node 2017-07-13 16:54:30 +01:00
Shams Asari
e93cdf29f8 Moved the core flows into net.corda.core.flows 2017-07-13 13:27:11 +01:00
Shams Asari
fa4577d236 Cleaned up NonEmptySet and expanded its usage in the codebase 2017-07-13 12:32:33 +01:00
Konstantinos Chalkias
ce06ad3878 Remove DigitalSignature.LegallyIdentifiable
Remove DigitialSignature.LegallyIdentifiable
2017-07-13 11:24:33 +01:00
Ross Nicoll
773aa28873 Clean up IssuerFlow
* Switch to using anonymous party as recipient
* Enable anonymisation for issuance as well as move in issuer flows.
* Pass notary into issuer flow rather than taking a notary at random from the network map.
* Enable anonymisation in Bank of Corda RPC test
* Parameterize issuer flow tests into anonymous and deanonymised versions
2017-07-13 11:23:56 +01:00
Ross Nicoll
f6aa672215 Add unit tests around vault update derivation 2017-07-13 11:10:23 +01:00
Shams Asari
7eed258bcb Fixed incorrect package declarations in CommonSchema and VaultSchema 2017-07-12 20:04:28 +01:00
Shams Asari
6e570b4d65 Moved dummy stuff from core into test-utils 2017-07-12 18:11:57 +01:00
josecoll
d6deeb2bd6 Fixed failing SmokeTests using Vault Query (#1032)
* Fixed failing SmokeTest caused by incorrect default count filter.

* Fixed incorrect spend value for expected assertion.

* Remove deprecated test (unintentionally merged after rebase from master)
2017-07-12 18:11:04 +01:00
Patrick Kuo
78ecff7933 Added composite key provider for storing composite keys in keystore (#1006)
* Add unit tests around decoding composite keys

(cherry picked from commit 9ccdd8e)

* Start writing a Composite signature scheme

(cherry picked from commit 72ac3a5)

* Composite key serialisation

* refactoring

* * Address PR issues

* * Address PR issues

* * Address PR issues

* * Address PR issues

* fix up after rebase
2017-07-12 12:13:29 +01:00
josecoll
5f7b8f6ec3 Vault Query Pagination simplification (#997)
* Pagination improvements (fail-fast on too many results without pagination specification)
* Fix incorrectly returned results count.
* Performance optimisation: only return totalStatesAvailable count on Pagination specification.
* Changed DEFAULT_PAGE_NUMBER to 1 (eg. page numbering starts from 1)
* Changed MAX_PAGE_SIZE to Int.MAX_VALUE
* Fixed compiler WARNINGs in Unit tests.
* Fixed minimum page size check (1).
* Updated API-RST docs with behavioural notes.
* Updated documentation (RST and API);
2017-07-12 09:53:15 +01:00
Matthew Nesbit
0b2188d27b Fix a bug in the wrapper code for the vault.
If we dip down to zero subscribers, no future updates are streamed. This hasn't been seen historically, because the cash metrics observer is always present, but this will be moved out of node.
2017-07-11 14:13:52 +01:00
Shams Asari
7caee508ec Refactored ErrorOr into Try, with Success and Failure data sub-classes, and moved it into core.utilities 2017-07-11 12:10:38 +01:00
Patrick Kuo
7e8de79848 Legal name validation for X500Name (#983)
* * Legal name validation for X500Name while loading from config file.

* * Removed unintended changes.
2017-07-11 12:09:30 +01:00
josecoll
c81ef7eb93 Vault Query Sort by StateRef (or constituents: txId, index) (#990)
* Provide sorting by state reference (and individual constituents of: txId, index)

* Fixed formatting.

* Updated import following rebase from master.

* Updated import following rebase from master.
2017-07-10 12:49:00 +01:00
Andrzej Cichocki
365364ddd5 Re-enable BFT tests after porting away from NodeBasedTest (#889) 2017-07-10 09:30:28 +01:00
Andrzej Cichocki
d2869e4f45 Refactor then/success/failure (#984)
to make ListenableFuture replacement less fiddly.
2017-07-07 15:50:50 +01:00
Shams Asari
fb0a043485 Moved dummy contracts to test-utils 2017-07-07 15:16:29 +01:00
Andrzej Cichocki
cefa14507a Retire HostAndPort (#962)
* Don't attempt to parse a resolved InetSocketAddress toString
* A mock node isn't reachable via an address
2017-07-07 15:11:07 +01:00
Shams Asari
7822118835 Moved random63BitValue() to CryptoUtils 2017-07-07 12:19:55 +01:00
Shams Asari
984fbd8995 Moved loggerFor and other useful Kotlin extensions into KotilnUtils.kt and moved LogHelper into test-utils 2017-07-07 00:14:20 +01:00
Shams Asari
8f1529b863 Moved ByteArrays.kt to core.utilities 2017-07-06 17:58:18 +01:00
Shams Asari
fc97fb2368 Removed DeserializeAsKotlinObjectDef interface as serialisation of Kotlin objects is now handled automatically 2017-07-06 15:57:20 +01:00
Shams Asari
8fc76b3803 Moved VersionInfo out of core and into node 2017-07-06 14:31:43 +01:00
Shams Asari
c6e165947b Added background checkpoint checker to make sure they're at least deserialisable 2017-07-06 13:11:46 +01:00
Shams Asari
182c9cceb5 Cleaned up the QueryCriteria API to be more Java friendly 2017-07-06 11:08:54 +01:00
josecoll
44f57639d2 Vault Query Aggregate Function support (#950)
* Partial (ie. incomplete) implementation of Aggregate Functions.

* Completed implementation of Aggregate Functions (sum, count, max, min, avg) with optional grouping.

* Completed Java DSL and associated JUnit tests.

* Added optional sorting by aggregate function.

* Added Jvm filename annotation on QueryCriteriaUtils.

* Added documentation (API and RST with code samples).

* Incorporating feedback from MH - improved readability in structuring Java and/or queries.

* Remove redundant import.

* Removed redundant commas.

* Streamlined expression parsing (in doing so, remove the ugly try-catch raised by RP in PR review comments.)

* Added JvmStatic and JvmOverloads to Java DSL; removed duplicate Kotlin DSL functions using default params; changed varargs to lists due to ambiguity

* Fix missing imports after rebase from master.

* Fix errors following rebase from master.

* Updates on expression handling following feedback from RP.
2017-07-06 10:57:59 +01:00
Patrick Kuo
4e355ba95e Add certificate subject name check on node startup (#897)
* Add certificate subject name check on node startup

* address PR issues
2017-07-05 15:34:04 +01:00
Shams Asari
2973755bc8 Moved TestConstants.kt from core into test-utils 2017-07-05 11:54:43 +01:00
Ross Nicoll
3176ecfecf Clean up transaction key flow
* Identities returned from TxKeyFlow were backwards, meaning keys were incorrectly assigned to the remote and local identities. Added unit test covering this case and corrected the flow logic.
* Rename TxKeyFlow to TransactionKeyFlow
* Correct registration of transaction key flows
* Move TransactionKeyFlow.Provider into CoreFlowHandlers
* Move TransactionKeyFlow.Request up to the top level class instead of being a class within an object.
* Remove AbstractIdentityFlow and move the validation logic into individual flows to make it clearer that it's registering the received identities.
* Cash flows now return the recipient identity instead of full identity lookup, as this is what
the caller actually needs and simplifies a lot of cases.
2017-07-05 11:39:08 +01:00
Joel Dudley
65f385953f Changes the name of the addTimeWindow method to setTimeWindow. 2017-07-05 10:57:18 +01:00
Matthew Nesbit
7eaac8a306 Merge pull request #968 from corda/mnesbit-tidy-test-classes
Move test classes out of api namespaces
2017-07-05 10:20:03 +01:00
josecoll
f732d2cefe FIX Vault Query defaults to UNCONSUMED in all QueryCriteria types (#958)
* Fix https://github.com/corda/corda/issues/949 by providing a default StateStatus argument to all QueryCriteria types.

* Abstracted Common Criteria into its own abstract data class + associated visitor.

* Incorporating feedback from RP PR review.
2017-07-05 10:01:35 +01:00
Matthew Nesbit
3ef5c39633 Put test classes into clear namespaces, so that they don't pollute the API. 2017-07-05 09:14:22 +01:00
Clinton
1707fb67c1 Merge pull request #932 from corda/clint-releasefixes
Misc fixes for the release process
2017-07-04 19:33:33 +01:00
Clinton Alexander
b4e7d7ca1b Can now publish to artifactory. 2017-07-03 18:12:56 +01:00
Shams Asari
46e23b7716 Clean up of ServiceHubInternal, including how it's created in AbstractNode 2017-07-03 17:05:36 +01:00
Joel Dudley
7df8c50167 Adds helper methods to grab a LedgerTx or verify a SignedTx. Deprecates builder signing methods. 2017-07-03 15:53:48 +01:00
Clinton
c1088038b7 Cordapps now contain their own dependencies (#915)
* Cordapps now contain all explicitly specified dependencies (and sub
dependencies).

* Removed some useless compile dependencies for trader demo.

* Dependent Cordapps are excluded from the build.
:Removed unnecessary dependencies of demos.

* Cleaned up exclusion rules for cordapp dependencies.
2017-06-30 14:18:46 +01:00
Mike Hearn
82f68f212a Minor: add another emoji, import a couple of changes for Enterprise 2017-06-30 13:06:46 +01:00
Andrzej Cichocki
88c8f4b351 Avoid BFT printStackTraces when cluster is starting up (#899) 2017-06-30 10:52:24 +01:00
Shams Asari
a08f701dc5 Removed the StorageService and puts its components directly into the service hub 2017-06-30 09:37:29 +01:00
Andrius Dagys
00b272906a Decouple notary implementations from AbstractNode. Allow custom notaries to be provided via CorDapps. 2017-06-29 18:05:44 +01:00
Andrius Dagys
79823531cf Minor: update log message 2017-06-28 18:15:48 +01:00
Ross Nicoll
1a4965c294 Change CashIssueFlow to use anonymous identity
* Add functions for:
    * Retrieving nodes via their legal identity
    * Filtering a set of public keys down to those the node has corresponding private keys for
* Modify contract upgrade flows to handle identifying participants after an anomymisation step
* Correct terminology: "party who" -> "party which"
* Modify CashIssueFlow and CashPaymentFlow to optionally use an anonymous identity for the recipient.
2017-06-28 13:47:50 +01:00
Andrzej Cichocki
e5395fe1b7 Enforce node death on failure to register with network map (#905)
* Give up polling when result future cancelled
2017-06-28 12:07:53 +01:00
Patrick Kuo
c3ca2744aa Replace Vault.PageAndUpdates with DataFeed data class (#931)
* Replace kotlin Pair with DataFeed data class

* remove unintended changes

* Replace Vault.PageAndUpdates with DataFeed data class

* Remove PageAndUpdates
2017-06-28 11:29:14 +01:00
Patrick Kuo
e02c37c06d Replace kotlin Pair with DataFeed data class (#930)
* Replace kotlin Pair with DataFeed data class

* remove unintended changes

* minor fix

* address PR issues
2017-06-28 11:06:06 +01:00
Andrzej Cichocki
0aadc037ef Make logging available in IntelliJ between gradle clean and assemble (#929)
* Enforce absence of node from client rpc smokeTest classpath
2017-06-28 09:54:09 +01:00
Katarzyna Streich
58da76c052 Network map redesign: Change field types in NodeInfo, move away messaging data from NodeInfo (#921)
* First stage of changing fields in NodeInfo.

Part of work related to NetworkMapService upgrade. Create slots for
multiple IP addresses and legalIdentities per node.

* NodeInfo stores HostAndPort.

Move information specific to messaging layer away from NodeInfo.
Only HostAndPort addresses are stored. Add peer name - peer handle
mapping to MockNetwork to reflect that change.
2017-06-27 18:14:51 +01:00
josecoll
4139cf497d Added vault query as tokenizable service. (#926)
* Added vault query as tokenizable service.

* Add JUnit test to test access of vault query service within a flow.

* Improved JUnit test to correctly validate tokenizable behaviour.

* Minor cleanup
2017-06-27 17:22:06 +01:00
Andrzej Cichocki
37c918a8f5 BFT tests no longer use NodeBasedTest (#917)
* Move Raft config to the interface
* Inline method only used in 1 test
2017-06-27 11:49:19 +01:00
josecoll
3e124b0b48 Automatically persist Linear and/or FungibleState attributes for quer… (#920)
* Automatically persist Linear and/or FungibleState attributes for querying (even when Contract does not implement QueryableState).

* Return single() state.
2017-06-26 18:01:07 +01:00
Ross Nicoll
14068f1b96 Enforce certificate constraints on all identities
* Enforce that the identity service must always have a root CA specified, which all identities have
certificates signed by (or intermediaries of). Also adds a certificate store to the identity service
for help building/verifying certificate paths.
* Add a certificate store for the CA certificate and intermediaries
* Use the certificate factory directly to build paths rather than assembling them via an interim
API call. After reducing the complexity of the utility API, it's replacing two lines of code,
at which point it seems better to make the behaviour clearer rather than having a function
hide what's actually going on.
2017-06-23 15:18:13 +01:00
josecoll
1866f6ff7f Align CordaRPCOps Vault Query API's for Java/Kotlin with VaultQuery service equivalents. (#914)
Added Kotlin extension functions for ease of use in simplest case.
Added missing Java contractType class (previously was forced cast of ContractState::class)

Fixed generic typing.

Addressed items raised in SA PR review.

Removed 2 blank lines.

Fixed generics typing.

Updates RST doc and grouped API helpers accordingly.
2017-06-23 14:35:55 +01:00
Andrius Dagys
7804c68401 Add a config option to toggle auto IP discovery 2017-06-23 13:14:37 +01:00
Andrzej Cichocki
cf5b089412 Make 2 tests no longer depend on working directory (#893) 2017-06-23 11:25:49 +01:00
Andrzej Cichocki
5233c50098 More specific message when a corda service fails to instantiate. (#901) 2017-06-23 10:17:49 +01:00
Andrzej Cichocki
48bb191ea2 Fix the corda logo, protect it from IDE formatter. (#882) 2017-06-23 10:17:28 +01:00
Andrius Dagys
aaf7de0d02 RPC server: buffer response messages until the client queue is fully set up.
The issue arises when the server restarts, and the client is sometimes
not able to recreate its queue in time, so the server is unable to send
back a response message and just drops it, causing the client to hang.
2017-06-22 11:26:04 +01:00
Andrius Dagys
4f16512dcf Revert "Reverting "Upgrade Artemis to 2.1.0" as the new version seems to introduce a race condition that causes a RPC stability test to randomly hang."
This reverts commit 022fb7b8cb.
2017-06-22 11:26:04 +01:00
josecoll
f8ad5c9d10 Vault Query Service JPA implementation (#840)
* Vault Query Service API implementation using JPA Hibernate

Added queryBy(QueryCriteria) Vault API and Junit tests.

Minor cosmetic API changes following rebase.

Fixes following rebase from master

Upgraded to requery 1.3.1

WIP - removed 'latestOnly' from LinearStateQueryCriteria

WIP - CommercialSchemas V2, V3, V4 testing

WIP - sort out generics handling.

WIP - most general queries completed.

WIP - join queries, contractStateType derivation

WIP - refactoring Requery

WIP - refactored VaultService to extract a VaultQueryService interface (and associated Requery implementation).

WIP - HibernateVaultQuery implementation

WIP - Re-structured all Schema definitions (requery/jpa) and make Hibernate Config reusable.

WIP - Multi-version schema testing, hibernate query testing.

WIP - Custom Criteria and Fungible Criteria impl & testing.

WIP - Kotlin Comparable Generics error

WIP - Party queries all working now

WIP - All VaultQueryTests now working (refactored for AND / OR composition)

WIP - added schema registration in CordaPluginRegistry to enable custom vault queries on arbitrary schemas.

WIP - added new default Sort NULL order to be NONE + added lots more tests for Logical Operator testing.

Mostly identity fixes following rebase from master.

Exception handling and public API cleanup in prep for PR.

Additional tests for Logical Operators; additional tests for NULLS sort ordering; additional logging;

Additional parser to handle Nullable attribute values; added Unary and Collection logical expression handlers

Lots of cleanup: participants; trackBy interfaces; additional fungible tests; parser cleanup and improved support for Java

Removed all traces of Requery implementation.

Further minor cleanup and Junit test fix.

Final identity and schema related identity clean-up.

Revert unrelated changes.

PR review updates: blank lines, isRelevant.

Fixed wiring of updatesPublisher for dynamic trackBy queries.

PR review changes: multi-versioned schema samples and associated dummy contracts moved to test packages.

Fixed problem with sorted queries (not specifying any filterable criteria).

PR review: minor updates to address RP comments.

Typesafe custom query criteria

Cleanup: remove redundant tests.

Further clean-up and make all Java test work successfully.

Remove debugging print statements.

Rebased from master - changes required due to DealState module change.

fixed broken assertion caused by DealState ordering change (different package)

Fixed transaction demarcation issue causing "java.lang.IllegalStateException: Was not expecting to find existing database transaction on current strand"

trackBy() now filters on ContractType and StateStatus (CONSUMED, UNCONSUMED, ALL)

Added tests to exercise RPCOps trackBy and queryBy (RPC smoke test and CordaRPCOps)

Added additional @CordaSerializable annotations.

Updated documentation and referenced sample code.

Added deprecation annotations.

Re-added missing deprecation annotation.

Hibernate debug logging is now configurable and disabled by default.

Introduced common Sort attributes based on the node schemas.

Completely removed NULL_HANDLING sort parameter as this is not supported in JPA.

Revisited and fixed usage of @CordaSerializable.

* Minor fix following rebase from master.

* Remove blank line as per RP PR feedback request.

* Minor Java documentation and example clean-up.

* Disable BFT Notary Service tests.
2017-06-22 10:35:49 +01:00
Ross Nicoll
19ff72a411 Correct ISO country code in names 2017-06-21 14:04:22 +01:00
Shams Asari
a4e4ecff8a Moved FlowStateMachine into an internal package 2017-06-21 12:19:09 +01:00
Ross Nicoll
a1450b5990 Force certificate keys into a known format before comparing
Force certificate keys into a well known key format before comparing during path validation.
This works around Sun's X509Key class appearing in certificates, which is incomparable to other
key types (i.e. EdDSAKey).
2017-06-21 11:42:55 +01:00
Andrzej Cichocki
ef74a0a618 Fix the command line notary demos (#875)
* The fancy classloader setup in Cordform.loadCordformDefinition is defeated by certificates in 2 ways
** Class cast when creating a cert (via TestConstants) in a CordformDefinition
** Some issue when persisting a cert in ServiceIdentityGenerator
* This PR is a quickfix to get the demos working again
* Proper fix (not this PR) is to work out why it's not enough for eddsa to be in the project runtime classpath - if it can be removed from the gradle environment that ought to properly fix the above problems
2017-06-21 10:25:11 +01:00
josecoll
8aa325d9f7 Tighten up transaction creation code to flag situations where calling code SHOULD BE within a demarcated transaction boundary. (#869)
Now fail fast with an appropriate message indicating course of action to be taken.
2017-06-20 20:33:31 +01:00
Ross Nicoll
d54f66ccb0 Replace certificate path generation
Use the certificate factory directly to build paths rather than assembling them via an interim
API call. After reducing the complexity of the utility API, it's replacing two lines of code,
at which point it seems better to make the behaviour clearer rather than having a function
hide what's actually going on.
2017-06-20 17:59:38 +01:00
Ross Nicoll
09ce52a33f Correct certificate path validation in identity service
* Unify certificate path validation in identity service
* Ensure we won't accept trust root or intermediaries as owner of a transaction certificate
* Fix subject key parsing
2017-06-20 17:59:38 +01:00
Ross Nicoll
b7bec90fae Add DER format encoding for CompositeKey
Add extremely rough DER format encoding for CompositeKey so that they can be used in X.509 certificates,
and switch service identity generator to using the proper identity cert for signing.
2017-06-20 16:39:11 +01:00
Shams Asari
155bb029da Cleaned up the trader, irs and simm demos so that things like the driver are used in test so that the node module isn't a compile dependency.
This has resulted in some classes moving into core, such as ClockUtils and FiberBox.
2017-06-20 16:02:51 +01:00
Andras Slemmer
4dc06ed25b Merge pull request #703 from corda/aslemmer-in-process-driver-nodes-performance-tests
driver, node: Allow in-process starting of nodes, add a couple of node performance tests
2017-06-20 14:57:54 +01:00
Andrzej Cichocki
52c7100267 BFT fixes (#844)
* Fix BFT config that only worked with clusters of size 4
* Shutdown BFT properly so that tests can run back to back in theory
* Wait for initial connection between client and all replicas before touching it
* Add test for non-trivial BFT cluster
* Shutdown NodeBasedTest nodes in parallel, as BFT shutdown time is non-trivial
* Overlapping ports check no longer assumes all on localhost
* Fix overlapping ports test to actually check the messages
2017-06-20 11:01:52 +01:00
Andras Slemmer
70717cf33f driver, node: Allow in-process starting of nodes, add a couple of node performance tests 2017-06-19 13:45:48 +01:00
Ross Nicoll
b874b3e62a Correct identity service tests
* Correct path composition in identity service tests
* Correct identity service certificate path verification to handle the owning certificate being anywhere in the path, rather than expecting it to be trust root
2017-06-16 16:15:23 +01:00
Matthew Nesbit
6933c8fda3 Move all advanced finance types into finance module.
Fixup after rebase

Also pull in the interpolator code, which is used for financial calculations.

Fix up rebase
2017-06-16 11:19:24 +01:00
Scott James
aab536646f Fixed various compiler warnings, mostly removing unused parameters and replacing calls to getDevX509Name with getX509Name with specific data, this should be a nullop. Remainign compiler warnings will require changing semantics of code 2017-06-16 09:59:52 +02:00
Mike Hearn
28b850ec85 Cleanup: move node startup code into a class that can be sub-classed to customise behaviour. 2017-06-15 17:27:27 +02:00
Shams Asari
b52d3706eb Moved Driver.kt to net.corda.testing.driver in the test-utils module 2017-06-14 15:12:39 +01:00
Chris Rankin
97053be4f7 Build capsules using runtime dependencies instead of compile ones. (#842)
This restores `artemis-amqp-protocol` to Corda Node.
2017-06-14 15:10:59 +01:00
Andrzej Cichocki
77ab6d4af3 Refactoring related to BFT state persistence/transfer (#829)
* Remove unused type param
* If we drop Runnable we can use conciser syntax
* Sometimes we need the fully-fledged object, so retire separate handle class
* Implement IntelliJ suggestion
2017-06-14 09:57:46 +01:00
Mike Hearn
a9b794ace5 Cleanup: add an extension function to X509CertificateHolder and use that instead of the verbose JcaX509CertificateConverter construct everywhere. 2017-06-13 17:11:01 +02:00
Mike Hearn
475044597d Address review comments. 2017-06-13 16:19:55 +02:00
Mike Hearn
ccf43a8e17 Support fuzzy matching for identities.
Matching can be done with case insensitive substrings in the identity service, RPC and shell. In future cleverer matching should be possible, e.g. using Lucene or RDBMS free text search features.
2017-06-13 16:19:55 +02:00
Katarzyna Streich
d7635bcbda Add stateMachines CRaSH command (#800)
Add flow watch command to CRaSH shell.
2017-06-08 12:54:51 +01:00
Konstantinos Chalkias
6f43811f60 bug fix on null checking Corda.kt 2017-06-06 18:30:01 +03:00
Shams Asari
71072eafb5 Merge pull request #789 from corda/shams-flow-testing-fixes
Fixed issue where Corda services installed in unit tests were not be…
2017-06-06 15:46:26 +01:00
Konstantinos Chalkias
30088a4984 Descriptive error and suggest fix for unknown curve during node startup 2017-06-06 17:24:17 +03:00
Shams Asari
afa3efb308 Fixes relating to testing flows and services.
Fixed issue where Corda services installed in unit tests were not being marked as serialise as singleton. Also the driver now automatically picks up the scanning annotations. This required moving the NodeFactory used in smoke tests into a separate module.
2017-06-06 15:22:43 +01:00
Clinton
08cbcac40c Corda publications and JARs now have cord or corda at the start. (#749)
Core corda publications and JARs now have cord or corda at the start (excluding gradle plugins). Removed an unnecessary dependency on test-utils in node-schemas to prevent an evaluation order bug in gradle.
2017-06-06 15:05:47 +01:00
Mike Hearn
f4321affad DemoBench: enable emoji in the terminal when built with a JetBrains JRE. 2017-06-06 14:55:09 +02:00
Andrius Dagys
34ca2e34d8 Reverting "Upgrade Artemis to 2.1.0" as the new version seems to introduce a race condition that causes a RPC stability test to randomly hang.
This reverts commit 81d32fd6a7.
2017-06-06 12:20:12 +01:00
Andrzej Cichocki
c2ab4cf26f Replace mapToArray with Streams-based code (#739)
and you can now do (1..10).stream()...
2017-06-06 11:02:26 +01:00
Andrzej Cichocki
101e96d8d7 Rename net to network (#773)
* So net no longer interferes with IntelliJ auto-import of net.* packages
* Use mockNet for MockNetwork to avoid clashing with Node network
2017-06-05 14:00:14 +01:00
Joel Dudley
e5fba5d0af Docsite reorg ahead of beta launch. 2017-06-05 13:37:23 +01:00
Andrzej Cichocki
51ea9fec1a IRS demo fixes (#782)
* Increase max network map request size so the notary can register
* Suppress oracle service installation errors in non-oracle nodes
* Make demos automatically build capsule jars
2017-06-02 16:23:05 +01:00
Andrzej Cichocki
c510e67ed5 Move ShutdownHook to node-api. (#770) 2017-06-02 15:32:20 +01:00
Ross Nicoll
e2214c95b4 Change PartyAndCertificate to an aggregate class (#778)
Change PartyAndCertificate to an aggregate class instead of a subclass of Party. This reduces the changes compared to M11, as well as avoiding risk of accidental serialization of a PartyAndCertificate (which may be very large) where a Party is expected.

Cleaned up initial nodes known to the identity service, in particular mock nodes now know about themselves; previously full nodes registered themselves but mock nodes did not.
2017-06-01 18:54:44 +01:00
Mike Hearn
73666dbc7d Minor: Modernise startup messages 2017-06-01 18:34:06 +02:00
Andrius Dagys
81d32fd6a7 Upgrade Artemis to 2.1.0 2017-06-01 11:10:15 +01:00
Joel Dudley
f646936ab8 Updates TwoPartyTradeFlow to use the CollectSignaturesFlow. 2017-06-01 11:08:39 +01:00
Clinton
f8e2766924 Merge pull request #774 from corda/clint-fixdocsbuild
Fix docs build
2017-05-31 21:50:44 +01:00
Clinton Alexander
53e8fe23d7 Fix docs build by replacing an expression which crashes Dokka with an older more verbose notation. 2017-05-31 21:05:41 +01:00
Rick Parker
d3f027cea8 Custom serialiser support for AMQP (#741) 2017-05-31 18:33:57 +01:00
Andrzej Cichocki
4bd38d381a Fix tests that check ports are bound/unbound (#756)
* Specifically, DriverTests and WebserverDriverTests
* RPCDriver.startRpcBroker now waits for port to be unbound, as was probably intended
* Explicitly drop network map future while ensuring the error is logged
2017-05-31 17:12:25 +01:00
Katarzyna Streich
39fdb353ad Remove nearestCity from node configuration. (#721)
* Fix bug in demobench. Explorer didn't show correctly location of a node.
There was no nearestCity override in config.

* Remove nearestCity from node configuration. Now information about the location is always taken from
node's legal name. If not present - exception on node startup.

* Add X500Name.locationOrNull that soft fails when location is not in X500 name. Address PR comments.

* Remove unused imports.
2017-05-31 16:07:13 +01:00
Andrius Dagys
f210370885 Pass ports instead of hostAndPorts to the message broker. Pass an address for the NodeMessagingClient to advertise to the network map service. 2017-05-31 15:41:40 +01:00
Ross Nicoll
34eb5a3b70 Store certificate and path with well known identity (#726)
* Construct standard flows using PartyAndCertificate, and add support for launching
flows that are constructed with PartyAndCertificate or just Party.
* Store PartyAndCertificate in network map service
* Expand identity service to store certificates along with all identities.
2017-05-31 14:45:58 +01:00
Ross Nicoll
08c91bd611 Add certificate to node identity (#769)
Add certificate and path to node identity via the `NodeInfo` class.
2017-05-31 11:52:50 +01:00
Ross Nicoll
f148765c57 Add RPC registration diagnostics
Add diagnostic information if attempting to use an RPC interface with duplicate
method names, rather than throwing a collection error.
2017-05-31 11:42:45 +01:00
Shams Asari
329e5ff17b Introducing InitiatedBy annotation to be used on initiated flows to simplify flow registration.
This removes the need to do manual registration using the PluginServiceHub. As a result CordaPluginRegistry.servicePlugins is no longer needed. For oracles and services there is a CorDappService annotation.

I've also fixed the InitiatingFlow annotation such that client flows can be customised (sub-typed) without it breaking the flow sessions.
2017-05-31 10:50:16 +01:00
Ross Nicoll
0e1e4042dc Add PartyAndCertificate class
Add PartyAndCertificate class for pairing proof of a party's identity with the party.
2017-05-31 09:45:40 +01:00
Ross Nicoll
c003ec0042 Replace X509Certificate with X509CertificateHolder
Replace X509Certificate with X509CertificateHolder for consistency in implementation of how X.509 certificates
are managed. Using the Java standard class entails the actual implementing class being one of several options
depending how a certificate is built, which makes serialization/deserialization with Kryo inconsistent as some
of these forms cannot be directly built from outside restricted classes.
2017-05-30 17:05:43 +01:00
Chris Rankin
bb0cc85295 Allow RPC for internal classes with special serialisers. (#751)
Also ensure that HashCheckingStream validates the hash afterwards.
2017-05-26 15:28:22 +01:00
Ross Nicoll
a8d4dccea4 Infrastructure for confidential identities
* De-anonymise parties in AbstractStateReplacementFlow flows
* Convert transaction key negotiation to a subflow instead of utility functions
* Add serialization support for CertPath
* Restructure cash flows so that a counterparty flow can be added later
2017-05-26 10:00:57 +01:00
Andrzej Cichocki
851cccbf7e Don't persist loaded keyPair to the keystore when owningKey is composite (#744) 2017-05-25 17:31:14 +01:00
Konstantinos Chalkias
9f2b44f8f7 Rename Timestamp to TimeWindow (#706)
Rename Timestamp to TimeWindow + refactoring
2017-05-25 13:18:49 +01:00
Andrzej Cichocki
ca36b4676d Unduplicate certificatesDirectory (#740) 2017-05-25 10:30:28 +01:00
Patrick Kuo
246de55433 Create client CA certificate with X509 name constraint (#731)
* The node will be issued a CA certificate with name constraint which will allow the node to create keys with a valid certificate chain.
2017-05-24 16:13:37 +01:00
Andrzej Cichocki
bbe4c170c2 BFT notary demo (#725)
* Rename raft-notary-demo project to notary-demo
* Refactor serialisation filtering to allow BFT SMaRt to work, it no longer relies on the jdk.serialFilter system property
* In NodeBasedTest remove whitespace in node directory names for consistency with cordform and driver
2017-05-24 12:25:06 +01:00
Chris Rankin
375392d32d Compile caplets against correct version of capsule. (#732) 2017-05-24 09:58:33 +01:00
Chris Rankin
179eccdd20 Modify how Gradle creates capsules: (#730)
- Better Gradle dependency management.
- Remove empty module jars from the capsules.
2017-05-23 18:04:20 +01:00
Ross Nicoll
36a091dd6a Add support for X509Certificate and CertPath serialization 2017-05-23 15:42:11 +01:00
Konstantinos Chalkias
53276c1f06 faster key encoding/decoding and generic converters between key implementations 2017-05-22 11:14:05 +01:00
Mike Hearn
207d3b0b8f Vault: any state that has us as a participant is relevant. 2017-05-19 16:45:22 +02:00
Mike Hearn
8dde7757f1 Minor: downgrade another spammy error to warning. 2017-05-19 16:45:22 +02:00
Mike Hearn
c79f369c83 Minor: degrade a log.error to a log.warn as errors get written to the console. 2017-05-19 16:45:22 +02:00
Mike Hearn
a5be12a81b Minor: print org name at startup instead of full X.500 name. 2017-05-19 16:45:22 +02:00
Ross Nicoll
794ce03958 Remove mock identity service
Remove mock identity service and merge it with the in memory identity service. The two services
provide extremely similar functionality, and having two different version for production/test
risks subtle implementation differences. On that note, this patch includes changes to a number
of tests which worked only with mock identity service.
2017-05-19 11:22:47 +01:00
Matthew Nesbit
05a97b11f3 First cut at removing PrivateKey leakage from KeyManagementService
Fixup after rebase

Restore original key property names

Fixup after rebase

Undo extra import that IntelliJ keeps erroneously adding.

Add comments and fix docs for transaction signing.

Fixes after rebase

More fixes after rebase

Address PR requests

Address PR requests
2017-05-18 17:34:04 +01:00
Andrzej Cichocki
c8d71a96f5 One demo definition for both IntelliJ and gradle (#697)
* Raft notary demo now defined in one place that both IntelliJ/driver and gradle/runnodes can run
* New module cordform-common for code common to cordformation and corda
* Add single notary demo
2017-05-18 15:58:35 +01:00
Mike Hearn
cca30ade1e Fix issue with automatic shutdown if the app is paused for longer than 30 seconds. This can happen on Mac laptops that put the node to sleep to save energy. 2017-05-17 09:45:37 +02:00
Chris Rankin
5cf304e8c4 Disable the DemoBench tab if the node exits abnormally. (#692)
* Log a message when the CRaSH shell exits.
* Disable the DemoBench tab if the node exits abnormally.
2017-05-17 00:19:48 +01:00
Rick Parker
68f0e5d683 Fix JPA annotations in test so that columns are correctly named. (#694) 2017-05-16 14:19:19 +01:00
Katarzyna Streich
81501150aa Add Cash flows to default RPC flow list, so they can be invoked by shell commands. (#690)
Add Cash flows to default RPC flow list, so they can be invoked by shell commands.
It should be removed once we separate cash flows into cordapp.
2017-05-16 13:29:57 +01:00
Ross Nicoll
c13a99a2f9 Replaces keys and parties in states with AbstractParty
Switch to using AbstractParty as the standard identifier for parties in
states, so that full parties can be used during construction of
transactions and anonymised parties when the transaction is being added
to the ledger.
2017-05-16 12:07:14 +01:00
Andrzej Cichocki
d3bb040355 Refactoring related to BFT notary demo (#680)
* Fix: Add missing @StartableByRPC to fix the Raft notary demo
* Make loadConfig take a Config object, for cordformation Node
* Unduplicate User.toMap
* Unduplicate WHITESPACE regex, choose possessive form
* Use slash to make a Path
* Remove Companion where redundant
* Remove unused code
2017-05-16 11:30:50 +01:00
Andras Slemmer
f445590cff Address #665, add more leak tests 2017-05-15 15:20:00 +01:00
Andras Slemmer
b192a86a30 Address comments #665 2017-05-15 13:18:45 +01:00
Andras Slemmer
7c3a566197 RPC: call close() on startup failure, add thread leak tests 2017-05-15 13:18:45 +01:00
Andrius Dagys
885f951dc3 Node IP auto-detection (#666)
* If the p2pAddress provided by the configuration is not public, the node tries to discover the public IP:
- First by checking the network interfaces
- If not found, sends a request to the network map service

* Enable initial connection retry

* Improve error handling

* Update docs
2017-05-12 14:09:02 +01:00
Andrzej Cichocki
e981632184 RAFT notary demo refactoring (#629)
Specifically, make the IDE/driver and gradle/NodeRunner methods of launching the demo behave more similarly, with a view to configuring them the same way.
* Add option to driver to nominate a node as network map, so that the driver-based demo doesn't run an additional node
* Change gradle ports to match those chosen by driver
2017-05-12 11:33:26 +01:00
Shams Asari
47c6b9c135 Making use of latest FastClasspathScanner version and cleanup of CollectSignaturesFlow.kt 2017-05-12 10:33:43 +01:00
Andrzej Cichocki
1df29ab06f Make webserver reconnect to rebooted node. (#662) 2017-05-12 10:27:27 +01:00
Shams Asari
8cb7c5eab1 Fix node crash when the plugins dir is empty 2017-05-11 21:34:31 +01:00
Ross Nicoll
edfc4dd7d9 Add certificate path storage to identity service
Add functionality for generating certificate paths from identity
certificates to transaction certificates, validating, storing and
retrieving those certificate paths.
2017-05-11 16:55:23 +01:00
Patrick Kuo
af7ba082a4 Store identity key to keystore with self sign cert (#645)
* Support signing and storing EdDSA key and certificate in java keystore.
2017-05-11 16:53:44 +01:00
Andras Slemmer
1ecce79913 Merge pull request #669 from corda/aslemmer-quasar-hook
Add quasar-hook agent for inspecting quasar instrumentation
2017-05-11 15:34:46 +01:00
Shams Asari
48f58b6dbc Introducing StartableByRPC and SchedulableFlow annotations, needed by flows started via RPC and schedulable flows respectively.
CordaPluginRegistry.requiredFlows is no longer needed as a result.
2017-05-11 14:55:40 +01:00
Ross Nicoll
e4a0bc6e11 Move party classes into identity package
Move AbstractParty, AnonymousParty and Party into a new net.corda.core.identity package,
as they're not really cryptography tools, and in preparation for further code coming in
for identity.

Optimize imports on many files to clean up the resulting refactor.
2017-05-11 11:25:59 +01:00
Andras Slemmer
4cd1f1677f Add quasar-hook agent for inspecting quasar instrumentation 2017-05-10 19:11:34 +01:00
Matthew Nesbit
8aa341dc7b Merge pull request #620 from corda/mnesbit-audit-interface
Create header files for discussion of possible flow audit api.
2017-05-10 16:42:49 +01:00
Matthew Nesbit
540fd746bb Create header files for discussion of possible flow audit api.
Fix compile error

Address PR comments

Change from a general interface to a restricted set of audit event types.

Fixup after rebase
2017-05-10 14:49:11 +01:00
Shams Asari
e75732af91 Making sure non-serialisable objects in FlowException do not interfere with the flow session (#651)
Also TransactionVerificationException no longer has reference to non-serialisable LedgerTransaction
2017-05-10 11:07:28 +01:00
Andras Slemmer
f4354d25dd Merge pull request #644 from corda/aslemmer-fix-issue-55
Fix issue #55
2017-05-10 10:53:11 +01:00
Chris Rankin
d3075928b2 Move FlowHandle implementations back into core so that RPC clients can use them. (#653) 2017-05-09 18:25:43 +01:00
Chris Rankin
bb0ac3253d Move FlowSessionException into core so that it can be serialised. (#654) 2017-05-09 18:09:34 +01:00
Shams Asari
60b1f9b0b2 Merge pull request #639 from corda/shams-initiating-flow-annotation
Introducing InitiatingFlow annotation which has to be annotated by in…
2017-05-09 12:24:33 +01:00
Mike Hearn
670f1256e9 Address review comments from Richard 2017-05-09 11:59:51 +02:00
Andras Slemmer
f153e9a347 #55, #644 Address comments 2017-05-09 10:38:50 +01:00
Ross Nicoll
546d96934a Expand X509Utilities
Mark several functions in X509Utilities as @JvmStatic so they're readily accessible from Java.

Add functions for modifying common name of an X.500 name, either direct replacement or adding a postfix.
2017-05-09 10:27:01 +01:00
Shams Asari
221bb81f84 Introducing InitiatingFlow annotation which has to be annotated by initiating flows.
This removes the need for the shareParentSessions parameter of FlowLogic.subFlow. It also has the flow's version number so FlowVersion is now no longer needed.
2017-05-08 20:19:45 +01:00
Patrick Kuo
1f4535bc2e Support signing and storing EdDSA key and certificate in java keystore. (#601) 2017-05-08 17:38:59 +01:00
Andras Slemmer
5db4e4723d Fix issue #55 2017-05-08 15:33:45 +01:00