Commit Graph

251 Commits

Author SHA1 Message Date
szymonsztuka
bbebea234d remove reference to repository with JetBrains/Exposed library 2017-08-31 13:42:08 +01:00
Katarzyna Streich
472ecc65c6 NetworkMapCache database backed (#1135)
Work on database backed NetworkMapCache

Make NodeInfo JPA entity.

Enable node startup with it's database network map cache. Fix schema.
Make node not wait for finishing network map service registration if it
successfully loaded data from database.

Add tests for startup without NetworkMapService.

* Rename networkMapRegistrationFuture

Change networkMapRegistrationFuture to nodeReadyFuture, it no longer
indicates the NetworkMapService registration, because we are able to run
network without map service configured.

* Partially integrate database into NetworkMapCache

Full integrtion will come with service removal.

Move MockServiceHubInternal to net.corda.node.testing

* Add workaround to transaction scope race

Temporary workaround to force isolated transaction (otherwise it causes race conditions when processing
network map registration on network map node).

* Remove WorldMapLocation from NodeInfo

Infer the node's location based on X500 name

Add serial number on NodeInfo

For tests of running without NetworkMap, start nodes with nonexistent NetworkMap address

Make clearNetworkMapCache callable via RPC.
2017-08-31 11:00:11 +01:00
Chris Rankin
ca1d5287b1 Upgrade to TornadoFX 1.7.10 (#1288)
We can do this now that we've upgraded to Kotlin 1.1.4.
2017-08-30 11:13:07 +01:00
Patrick Kuo
3b9c1ec0ff Use identity service to resolve anonymised identities in explorer 2017-08-29 16:07:09 +01:00
mkit
a84cd567d8 Removing Kt suffixed Java class (#1344) 2017-08-29 13:41:17 +01:00
Andrzej Cichocki
98e2ea9352 Add cordaCompile to graphs (#1282) 2017-08-29 11:45:19 +01:00
Clinton
1750ab07af Merge pull request #1315 from corda/clint-gradle4
Upgraded to gradle 4.1.
2017-08-24 22:55:50 +01:00
mkit
412a54d5ac Fixing demobench freeze on terminal command 'bye' (#1319)
* Fixing demobench freeze on terminal command 'bye'

* Addressing review comments

* Adding docs.
2017-08-24 16:40:20 +01:00
Clinton Alexander
ce7ce6c8b7 Used a more robust location for the caplet classes now that gradle 4 has changed the classes directory structure. 2017-08-24 15:58:41 +01:00
Matthew Nesbit
c86e78599f Rename finance module to own package
Fixup after rebase

Correct bad merges

Fixup docs

Fix integration test

Correct doc references to finance
2017-08-22 13:25:31 +01:00
mkit
a4052f9126 Adding permissions for flow execution (#1297)
* Adding permissions for flow execution

* Addressing review comments
2017-08-22 10:24:57 +01:00
mkit
2744079b4b Removing usages of the deprecated CashFlowCommand (#1289)
* Removing usages of the deprecated CashFlowCommand

* Addressing review comments
2017-08-21 13:32:08 +01:00
Chris Rankin
f364f3aaee Install the finance module as a CorDapp into every DemoBench node. (#1290) 2017-08-21 11:51:23 +01:00
Mike Hearn
d22cdac2dd Move some extension methods for summing to new locations.
This improves the Java API and makes it more idiomatic. The methods
were not moved to be static methods of the relevant types in all cases
due to a bad interaction with a Kotlin auto-completion bug, and because
static methods on interfaces are new in Java 8 and Kotlin is not yet
emitting Java 8 bytecode.

Also, introduce a packages.md file so packages can be documented.
2017-08-18 12:39:12 +02:00
Ross Nicoll
b76d036843 Change CashIssueFlow to always issue to ourselves
Change CashIssueFlow to always issue to ourselves, and require the cash is then moved in a separate payment
operation. This more closely models actual operation inside banks, and is a step towards making all move-like
operations go through a uniform verification process.
2017-08-15 22:32:30 +01:00
Ross Nicoll
89476904fc Remove IssuerFlow
* Remove IssuerFlow as it is dangerous and its presence in the finance module risks accidental use in non-test code. As written it will issue arbitary amounts of currency on request from any node on the network, with no validation barring that the currency type is valid.
* Unify interface to CashIssueFlow to match the previous IssuerFlow
2017-08-15 22:32:30 +01:00
Shams Asari
62b26bcd89 Moved Currency stuff in ContractsDSL out of core and into finance 2017-08-15 18:08:02 +01:00
Joel Dudley
ccdab6af4d For convenience, creates RPC snapshot methods for feeds. 2017-08-15 16:18:15 +01:00
Chris Rankin
ce0f931716 Comment which specific OpenJDK bug we are working around. (#1231)
Use runtime configuration for the application's classpath.
Fix whitespace issues in build.gradle.
2017-08-15 15:07:28 +01:00
Matthew Nesbit
af13371510 Move certificate builder code from core to node utilities.
Address PR comments

Fixup dead reference
2017-08-11 12:02:38 +01:00
Mike Hearn
5cda7e30d5 Minor: fix a DemoBench crash that can occur if the web server fails to start. 2017-08-10 15:19:39 +02:00
Matthew Nesbit
bc4223712b Remove kotlin.Pair from Public APIs 2017-08-08 14:44:04 +01:00
Andrzej Cichocki
3a3ead2dfe Remove ListenableFuture from core/main (#1030) 2017-08-07 14:31:24 +01:00
josecoll
64ba8d3a88 Updated samples and demos to use new Vault Query service. (#924)
* Updated all sample code to use new Vault Query service APIs.

* Fix broken Unit test.

* Added missing transaction boundary.

* Fix broken ScheduledFlow test (caused by assertion on non-ordered collection)

* Remove redundant negative test (as new Vault Query no longer returns iterators).

* Whitespace formatting fixed following PR review from SA.

* Force query to specify a PAGE SIZE equivalent to total states to be exited (RP review comment).

* Use single (and fail fast) instead of first - when only expecting a single result.

* Demonstrate paging and sorting; failfast on single expected result.

* Enhancement: added Sorting by CommonStateAttribute (StateRef txnId and index)

* Fix: incorrect total states count.

* Fixed incorrect total states counting.

* Remove redundant filter (UNCONSUMED).

* Updated tutorial code and associated documentation (building transactions).

* Updated all vaultAndUpdates to vault[Track|Query]By.

* Temporary disable failing Vault Query tests (awaiting pagination PR fix).

* Rebase from master to pick up pagination changes/fix.

* Fixed criteria filter on track.

* Cleanup redundant print output.

* Refactor to extract common function for Vault Query paging and sorting.

* Identified problem in SimmValuation demo failing test caused by query by single participant in participants list (not yet supported in VaultQuery criteria).

* Minor fixes following rebase from master.

* Minor updates following rebase.

* Removed redundant import.

* Fixed type casting error.

* Minor fixes following rebase from master.

* VQ Fix - applied in other PR.

* Removed duplication after rebase and minor fix to failing smoke test.
2017-08-03 11:47:15 +01:00
Shams Asari
4312dc0771 Resolved all non-deprecation warnings 2017-08-02 12:17:52 +01:00
Shams Asari
4a600121cc Removed deprecated methods in DataFeed and deprecated feed-based methods in CordaRPCOps 2017-07-31 15:11:00 +01: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
39e7c25627 Add graphviz-based module-module compile dependency graphs (#1081) 2017-07-26 14:05:38 +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
Shams Asari
e702025f62 Cleaned up TimeWindow and added a bit more docs. 2017-07-20 13:43:11 +01:00
Chris Rankin
bf98f64269 Patch DemoBench for JavaFX bugs when building installers. (#1069)
* Replace buggy classes in rt.jar with patched versions.
* Apply Java bugfixes to MacOSX.
* Initial support for patching Windows JRE.
* Resign DemoBench DMG after the bugfixe source has been deleted.
* Apply Java bugfixes for DemoBench on Windows.
2017-07-20 11:04:09 +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
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
Chris Rankin
729eaed362 Update DemoBench packager scripts to fail when packaging fails. (#1023) 2017-07-14 14:53:09 +01:00
Chris Rankin
5be63adae0 Comment that vault returns the total number of available states, irresepective of the query's pagination. (#1045) 2017-07-14 09:07:20 +01:00
Chris Rankin
75473e2782 Update DemoBench to use the new Vault APIs. (#1008)
* Update to use the new Vault API.
* Add a page specification for the Vault query.
* Query vault for all contract states, not just cash states.
Also only request one item per page from the vault because we're not interested in them anyway.
* The first VaultQuery page is now page 1.
2017-07-13 15:47:06 +01:00
Shams Asari
e93cdf29f8 Moved the core flows into net.corda.core.flows 2017-07-13 13:27:11 +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
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
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
8f1529b863 Moved ByteArrays.kt to core.utilities 2017-07-06 17:58:18 +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
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
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
Patrick Kuo
1c2265d3b7 Pat remove stability test randomness (#891)
* Remove randomness from stability test

* address PR issues
2017-06-30 11:45:08 +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
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
Andrzej Cichocki
c6d1274e47 Add tz to all non-test logging config (#894)
* Use millis comma and pattern= consistently
2017-06-27 16:34:02 +01:00
Chris Rankin
92c238b2aa Alter logging patterns to a more explicit form. (#918) 2017-06-26 13:24:24 +01:00
Chris Rankin
433a9ab5c3 DemoBench operates exclusively on localhost, so no need for public IP. (#919) 2017-06-26 10:12:48 +01:00
Ross Nicoll
19ff72a411 Correct ISO country code in names 2017-06-21 14:04:22 +01:00
Katarzyna Streich
ab1b7eb551 Move all changes unrelated to flow view in explorer to open source. 2017-06-20 18:01:49 +02:00
Patrick Kuo
66421692a3 pass consoleLogLevel parameter to load test to enable log to console (#866) 2017-06-20 10:52:47 +01:00
Katarzyna Streich
20403d806a Cleanup of the explorer code related to internal flow view work. (#832)
Cleanup of the explorer code related to internal flow view work.
Changes in simulation, widgets, minor visual.
2017-06-20 10:45:42 +01:00
Patrick Kuo
28afb6d3ff Added throttling to the load test tool and added stability test. (#847)
* Added throttling to the load test tool.
* Added stability test to the tool.
* Some refactoring to allow some configuration via vm option.
* updated doc.
* gradle now passes system parameter to load test.
* using Guava's RateLimiter instead of execute at fix rate.
2017-06-16 15:30:11 +01: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
Chris Rankin
d3de125166 Update documentation for DemoBench's MacOSX signing key. (#826) 2017-06-12 12:50:22 +01:00
Patrick Kuo
58114f817c A better looking scrollbar css for corda explorer (#802) 2017-06-08 16:54:54 +01:00
FredericDalibard
d76c23824e Add EUR to the cash app and demobench tool. Authored by Frederic Dalibard. 2017-06-08 16:33:49 +02:00
Katarzyna Streich
73e5eddb13 Fix wrong layout of new added nodes to map view in explorer. (#794)
* Fix wrong layout of new added nodes to map view in explorer. Fix double rendering of myIdentity label.

* Make buttons in map view take the whole available space.

* Remove party full name from network map view in explorer.
2017-06-07 13:28:29 +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
Chris Rankin
db9cc3a460 Upgrade DemoBench to purejavacomm 0.0.18 (#791) 2017-06-05 15:31:33 +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
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
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
Chris Rankin
e117ab7703 Allow DemoBench to install Explorer's CorDapps multiple times. (#761) 2017-05-31 10:31:10 +01:00
Chris Rankin
bcf4c4a2bb Document how we should test DemoBench. (#742) 2017-05-25 15:24:18 +01:00
Chris Rankin
35ee60f12b Require user R3CEV for DemoBench DMG signing key. (#737) 2017-05-25 14:12:58 +01:00
Chris Rankin
1aae41214f Unpack DemoBench's capsules within $HOME/demobench directory. (#738)
* Unpack the capsules into a subdirectory of $HOME/demobench.
* Minor tidy up.
* Add a new suggested bank.
2017-05-25 11:49:21 +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
Chris Rankin
975866590b Prevent DemoBench hanging on shutdown (#722)
* We need to close the RPC client as otherwise the rpc-client-reaper-* thread is leaked, which also prevents shutdown. Sleep instead when the server exits, just long enough for the client to realise that the server is dead.
* Fix warning about leaking private types.
2017-05-22 12:18:53 +01:00
Mike Hearn
7244f2eeea Temp hack to fix DemoBench in master: leak the RPC connections when a node shuts down to avoid a hang. 2017-05-19 16:45:22 +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
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
Chris Rankin
6bc885fb09 Create X.500 names for DemoBench nodes. (#674) 2017-05-12 12:15:17 +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
Chris Rankin
9a5775698b Try to copy the CorDapp if we fail to create a symlink, e.g. on Win10. (#659) 2017-05-10 10:31:34 +01:00
Andras Slemmer
de88ad4f40 RPC muxing, multithreading, RPC driver, performance tests 2017-05-05 17:10:52 +01:00
Ross Nicoll
25dbac0f07 Change party to hold an X.500 name
Change the legal name of parties to be an X500 name. This ensures that we aren't converting between
common names and X500 names in various places, eliminating substantial scope for error in the conversion
process. As a result, all node names must now be full X500 names, which has impact on most configurations.
2017-05-05 16:13:29 +01:00
Ross Nicoll
b64e7f51f6 Enforce X.500 distinguished names in configuration 2017-05-05 16:13:29 +01:00
Katarzyna Streich
c062d48e6e Explorer x500names (#631)
Format party names in explorer, so they look nice after X500 name changes.
2017-05-05 14:00:55 +01:00
Chris Rankin
0309426cb9 Include log4j2.xml into application jars only. This allows applications to use their own log4j2.xml files, if required. (#635) 2017-05-05 13:12:36 +01:00
Ross Nicoll
e85ed639bb Clean up X500 names in Corda simulation
Clean up X500 names in Corda simulation, and ensure they're consistent with the standard test names.
This includes using the locations present in those test names, which requires updates to the node
config test.
2017-05-03 15:55:19 +01:00
Ross Nicoll
d65d63e4f6 Interim patch introducing X500Names
This is an intermediary step to introducing X500Names in all Party instances, which adds:

* Party constructor which accepts X500Name and then converts it to string.
* startNode() function which takes in X500Name instead of String
* Numerous legal name fixes to use full distinguished names
2017-05-03 10:46:03 +01:00
Chris Rankin
af36e0f731 Basic clean-up for demos, load-test and examples (#590)
* Fix RPC usage by marking unused Observables.
* Update Client RPC tutorial documentation to mention the importance of "notUsed" observables.
2017-04-26 11:01:09 +01:00
Matthew Nesbit
7e3b9a8934 Fix duplicate content root problems in IntelliJ 2017-04-26 10:37:16 +02:00
Mike Hearn
b6fa7095e3 DemoBench: symlink or copy apps into the plugins folder for the Explorer, as a temp deserialisation hack. 2017-04-25 19:43:26 +02:00
Mike Hearn
b4e7944a18 DemoBench: address review comments 2017-04-25 14:13:20 +02:00
Mike Hearn
238d4e29e2 Webserver: Redirect / to the first static web path.
DemoBench: Misc usability improvements:

- Pre-fill details for some fictional banks when Add Node is pushed.
- Make services a checkbox list rather than one where you have to know how to use the keyboard to do multi-select.
- Make web server launch button spin until server is launched to show activity.
- Suppress an exception that spams the log due to inability to load all the states. It'll get fixed as part of the vault API and serialisation work.
2017-04-25 14:13:20 +02:00
Chris Rankin
35f6de9c50 Ignore any unsubscribe exception when closing DemoBench tab. (#579)
E.g. the node may already have exited and closed the RPC session.
2017-04-25 10:41:32 +01:00
Chris Rankin
ab8bfec76f DemoBench now subscribes to updates for transaction and vault RPCs. (#571)
* Subscribe to updates for transaction and vault RPCs.
* Ensure we unsubscribe our observables at the end.
* Use Rx scheduler that can observe on FX application thread.
2017-04-24 17:59:51 +01:00
Shams Asari
b5e022f350 Introducing Platform Version and its use by the NMS for min version requirements for the network 2017-04-24 15:31:10 +01:00
Ross Nicoll
684d1089f0 Introduce full legal names for test parties
Use full names for test parties, ahead of complete X.500 name support.
2017-04-24 15:18:21 +01:00